public abstract class ARCBatchJob extends FileBatchJob
FileBatchJob.ExceptionOccurrence
Modifier and Type | Field and Description |
---|---|
protected int |
noOfRecordsProcessed
The total number of records processed.
|
batchJobTimeout, exceptions, filesFailed, noOfFilesProcessed
Constructor and Description |
---|
ARCBatchJob() |
Modifier and Type | Method and Description |
---|---|
abstract void |
finish(OutputStream os)
Finish up the job.
|
Exception[] |
getExceptionArray()
Returns a representation of the list of Exceptions recorded for this ARC batch job.
|
ARCBatchFilter |
getFilter()
returns a BatchFilter object which restricts the set of arcrecords in the archive on which this batch-job is
performed.
|
void |
handleException(Exception e,
File arcfile,
long index)
When the org.archive.io.arc classes throw IOExceptions while reading, this is where they go.
|
abstract void |
initialize(OutputStream os)
Initialize the job before running.
|
int |
noOfRecordsProcessed() |
boolean |
processFile(File arcFile,
OutputStream os)
Accepts only ARC and ARCGZ files.
|
abstract void |
processRecord(org.archive.io.arc.ARCRecord record,
OutputStream os)
Exceptions should be handled with the handleException() method.
|
addException, addFinishException, addInitializeException, getBatchJobTimeout, getExceptions, getFilenamePattern, getFilesFailed, getNoOfFilesProcessed, maxExceptionsReached, postProcess, processOnlyFileNamed, processOnlyFilesMatching, processOnlyFilesMatching, processOnlyFilesNamed, setBatchJobTimeout
protected int noOfRecordsProcessed
public ARCBatchJob()
public abstract void initialize(OutputStream os)
initialize
in class FileBatchJob
os
- The OutputStream to which output data is writtenpublic abstract void processRecord(org.archive.io.arc.ARCRecord record, OutputStream os)
os
- The OutputStream to which output data is writtenrecord
- the object to be processed.public abstract void finish(OutputStream os)
finish
in class FileBatchJob
os
- The OutputStream to which output data is writtenpublic ARCBatchFilter getFilter()
public final boolean processFile(File arcFile, OutputStream os) throws ArgumentNotValid
processFile
in class FileBatchJob
arcFile
- The ARC or ARCGZ file to be processed.os
- the OutputStream to which output is to be writtenArgumentNotValid
- if either argument is nullpublic void handleException(Exception e, File arcfile, long index) throws ArgumentNotValid
e
- An Exception thrown by the org.archive.io.arc classes.arcfile
- The arcFile that was processed while the Exception was thrownindex
- The index (in the ARC file) at which the Exception was thrownArgumentNotValid
- if e is nullpublic Exception[] getExceptionArray()
public int noOfRecordsProcessed()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.