Class DefaultDumpHandler

  • All Implemented Interfaces:
    DumpHandler

    public class DefaultDumpHandler
    extends AbstractDumpHandler
    Default implementation of a DumpHeader using plain files as dump storage.
    • Constructor Detail

      • DefaultDumpHandler

        public DefaultDumpHandler()
    • Method Detail

      • init

        public void init()
                  throws java.io.IOException
        Description copied from interface: DumpHandler
        Initializes the handler by creating the first dump storage and providing a writer object to that storage when calling DumpHandler.getWriterOfCurrentDump().
        Throws:
        java.io.IOException - error while storage creation
      • finish

        public void finish​(boolean saveCurrentDump)
        Description copied from interface: DumpHandler
        Deletes last dump storage definitely and current one if given flag is set.
        Parameters:
        saveCurrentDump - should the current storage be deleted
      • deleteLastDump

        protected void deleteLastDump()
        Deletes the file holding the last dump.
      • deleteCurrentDump

        protected void deleteCurrentDump()
        Deletes the file holding the current dump.
      • switchCurrentToLastDump

        protected void switchCurrentToLastDump()
        Switches the reference of current dump file to last dump file.
      • createReader

        protected CSVReader createReader()
                                  throws java.io.IOException
        Creates a new reader using last dump file as input.
        Returns:
        reader object to last dump file
        Throws:
        java.io.IOException - error while accessing file
      • createWriter

        protected CSVWriter createWriter()
                                  throws java.io.IOException
        Creates a new writer using a new created temp file as current dump file.
        Returns:
        writer object to new current dump file
        Throws:
        java.io.IOException - error while accessing file