public interface DumpHandler
So an extension of this handler provides a writer object to a dump storage using
getWriterOfCurrentDump() after initialization using init(). After writing all unresolved
value lines using the writer object, the import process calls switchDump, to start a new import pass
with the dump as input. After first call of switchDump, the getReaderOfLastDump() will
return a reader object of the dump storage used before the switch for reading that dump storage as input of the next
import cycle.
If dump handling is needed anymore, a call of finish() has to be called.
Visualization:
call of init() -> dump storage A will be created call of getWriterOfCurrentDump() -> gets writer object of A call of switchDump() -> dump storage B will be created call of getWriterOfCurrentDump() -> gets writer object of B call of getReaderOfLastDump -> gets reader object of A call of switchDump() -> dump storage C will be created call of getWriterOfCurrentDump() -> gets writer object of C call of getReaderOfLastDump -> gets reader object of B call of finish() -> cleans dumps
| Modifier and Type | Method and Description |
|---|---|
void |
finish(boolean saveCurrentDump)
Deletes last dump storage definitely and current one if given flag is set.
|
java.io.File |
getDumpAsFile()
Gets the current dump as file.
|
ImpExMedia |
getDumpAsMedia()
Gets the current dump as media object.
|
java.lang.String |
getDumpAsString()
Gets the current dump as text.
|
CSVReader |
getReaderOfLastDump()
Gets a reader object to the last dump storage.
|
CSVWriter |
getWriterOfCurrentDump()
Gets a writer object to the current dump storage.
|
void |
init()
Initializes the handler by creating the first dump storage and providing a writer object to that storage when
calling
getWriterOfCurrentDump(). |
void |
switchDump()
References the 'current' dump storage as 'last' dump storage (
getReaderOfLastDump() now provides a reader
object to that storage) and creates a new 'current' dump storage (getWriterOfCurrentDump() now provides a
writer object to that storage). |
void init() throws java.io.IOException
getWriterOfCurrentDump().java.io.IOException - error while storage creationvoid switchDump()
throws ImpExException
getReaderOfLastDump() now provides a reader
object to that storage) and creates a new 'current' dump storage (getWriterOfCurrentDump() now provides a
writer object to that storage). If there was a storage referenced by 'last' it will be deleted.ImpExException - error while storage handlingvoid finish(boolean saveCurrentDump)
saveCurrentDump - should the current storage be deletedCSVReader getReaderOfLastDump()
CSVWriter getWriterOfCurrentDump()
ImpExMedia getDumpAsMedia()
java.io.File getDumpAsFile()
java.lang.String getDumpAsString()
Copyright © 2018 SAP SE. All Rights Reserved.