Class ArchiveBatchJobBase

    • Field Detail

      • noOfRecordsProcessed

        protected int noOfRecordsProcessed
        The total number of records processed.
    • Constructor Detail

      • ArchiveBatchJobBase

        public ArchiveBatchJobBase()
    • Method Detail

      • initialize

        public abstract void initialize​(OutputStream os)
        Initialize the job before running. This is called before the processRecord() calls start coming.
        Specified by:
        initialize in class FileBatchJob
        Parameters:
        os - The OutputStream to which output data is written
      • finish

        public abstract void finish​(OutputStream os)
        Finish up the job. This is called after the last processRecord() call.
        Specified by:
        finish in class FileBatchJob
        Parameters:
        os - The OutputStream to which output data is written
      • handleOurException

        protected void handleOurException​(NetarkivetException e,
                                          File archiveFile,
                                          long index)
        Private method that handles our exception.
        Parameters:
        e - the given exception
        archiveFile - The archive file where the exception occurred.
        index - The offset in the archive file where the exception occurred.
      • handleException

        public void handleException​(Exception e,
                                    File archiveFile,
                                    long index)
                             throws ArgumentNotValid
        When the org.archive.io.arc classes throw IOExceptions while reading, this is where they go. Subclasses are welcome to override the default functionality which simply logs and records them in a list. TODO: Actually use the archive file/index entries in the exception list
        Parameters:
        e - An Exception thrown by the org.archive.io.arc classes.
        archiveFile - The archive file that was processed while the Exception was thrown
        index - The index (in the archive file) at which the Exception was thrown
        Throws:
        ArgumentNotValid - if e is null
      • getExceptionArray

        public Exception[] getExceptionArray()
        Returns a representation of the list of Exceptions recorded for this archive batch job. If called by a subclass, a method overriding handleException() should always call super.handleException().
        Returns:
        All Exceptions passed to handleException so far.
      • noOfRecordsProcessed

        public int noOfRecordsProcessed()
        Returns the number of records processed.
        Returns:
        the number of records processed.