Class DefaultDumpHandler

java.lang.Object
de.hybris.platform.impex.jalo.imp.AbstractDumpHandler
de.hybris.platform.impex.jalo.imp.DefaultDumpHandler
All Implemented Interfaces:
DumpHandler

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

    • DefaultDumpHandler

      public DefaultDumpHandler()
  • Method Details

    • init

      public void init() throws 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:
      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
    • switchDump

      public void switchDump() throws ImpExException
      Description copied from interface: DumpHandler
      References the 'current' dump storage as 'last' dump storage (DumpHandler.getReaderOfLastDump() now provides a reader object to that storage) and creates a new 'current' dump storage (DumpHandler.getWriterOfCurrentDump() now provides a writer object to that storage). If there was a storage referenced by 'last' it will be deleted.
      Throws:
      ImpExException - error while storage handling
    • getDumpAsFile

      public File getDumpAsFile()
      Description copied from interface: DumpHandler
      Gets the current dump as file.
      Specified by:
      getDumpAsFile in interface DumpHandler
      Overrides:
      getDumpAsFile in class AbstractDumpHandler
      Returns:
      current dump as file
    • getDumpAsMedia

      public ImpExMedia getDumpAsMedia()
      Description copied from interface: DumpHandler
      Gets the current dump as media object.
      Specified by:
      getDumpAsMedia in interface DumpHandler
      Overrides:
      getDumpAsMedia in class AbstractDumpHandler
      Returns:
      current dump as media
    • 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 IOException
      Creates a new reader using last dump file as input.
      Returns:
      reader object to last dump file
      Throws:
      IOException - error while accessing file
    • createWriter

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