Class DefaultDumpHandler
java.lang.Object
de.hybris.platform.impex.jalo.imp.AbstractDumpHandler
de.hybris.platform.impex.jalo.imp.DefaultDumpHandler
- All Implemented Interfaces:
DumpHandler
Default implementation of a
DumpHeader using plain files as dump storage.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CSVReaderCreates a new reader using last dump file as input.protected CSVWriterCreates a new writer using a new created temp file as current dump file.protected voidDeletes the file holding the current dump.protected voidDeletes the file holding the last dump.voidfinish(boolean saveCurrentDump) Deletes last dump storage definitely and current one if given flag is set.Gets the current dump as file.Gets the current dump as media object.voidinit()Initializes the handler by creating the first dump storage and providing a writer object to that storage when callingDumpHandler.getWriterOfCurrentDump().protected voidSwitches the reference of current dump file to last dump file.voidReferences 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).Methods inherited from class de.hybris.platform.impex.jalo.imp.AbstractDumpHandler
getDumpAsString, getReaderOfLastDump, getWriterOfCurrentDump, setReaderOfLastDump, setWriterOfCurrentDump
-
Constructor Details
-
DefaultDumpHandler
public DefaultDumpHandler()
-
-
Method Details
-
init
Description copied from interface:DumpHandlerInitializes the handler by creating the first dump storage and providing a writer object to that storage when callingDumpHandler.getWriterOfCurrentDump().- Throws:
IOException- error while storage creation
-
finish
public void finish(boolean saveCurrentDump) Description copied from interface:DumpHandlerDeletes last dump storage definitely and current one if given flag is set.- Parameters:
saveCurrentDump- should the current storage be deleted
-
switchDump
Description copied from interface:DumpHandlerReferences 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
Description copied from interface:DumpHandlerGets the current dump as file.- Specified by:
getDumpAsFilein interfaceDumpHandler- Overrides:
getDumpAsFilein classAbstractDumpHandler- Returns:
- current dump as file
-
getDumpAsMedia
Description copied from interface:DumpHandlerGets the current dump as media object.- Specified by:
getDumpAsMediain interfaceDumpHandler- Overrides:
getDumpAsMediain classAbstractDumpHandler- 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
Creates a new reader using last dump file as input.- Returns:
- reader object to last dump file
- Throws:
IOException- error while accessing file
-
createWriter
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
-