Package com.nt.udc.ei.transport
Class InputFileProcessor
java.lang.Object
com.nt.udc.ei.transport.InputFileProcessor
- All Implemented Interfaces:
InputFileProcessorIfc
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InputStatisticsMonitorIfcprotected LoggerIfcRepresents the logging facility for the EI node using this object.protected EINodeprotected booleanNumber of bytes having been read so far. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longReturns the length stored in the scratch file.protected voidbooleanpostProcessInputData(OpenFileInputStream inputStream, File fileToProcess, File scratchFile) booleanpreProcessInputData(OpenFileInputStream inputStream, File fileToProcess, File scratchFile) booleanprocessInputData(OpenFileInputStream inputStream, DataReceiverIfc dataReceiver) voidshutdown()Specifies actions needed to shut down the thread in which this object runs.protected voidwriteLength(File scratchfile, long len) Record a long in a file - used to write a length in a scratch file to keep track of how much of a file has been processed.
-
Field Details
-
running
protected boolean runningNumber of bytes having been read so far. -
logger
Represents the logging facility for the EI node using this object. -
node
-
inputCount
-
-
Constructor Details
-
InputFileProcessor
-
-
Method Details
-
preProcessInputData
public boolean preProcessInputData(OpenFileInputStream inputStream, File fileToProcess, File scratchFile) throws Exception - Specified by:
preProcessInputDatain interfaceInputFileProcessorIfc- Throws:
Exception
-
processInputData
public boolean processInputData(OpenFileInputStream inputStream, DataReceiverIfc dataReceiver) throws Exception - Specified by:
processInputDatain interfaceInputFileProcessorIfc- Throws:
Exception
-
postProcessInputData
public boolean postProcessInputData(OpenFileInputStream inputStream, File fileToProcess, File scratchFile) throws Exception - Specified by:
postProcessInputDatain interfaceInputFileProcessorIfc- Throws:
Exception
-
shutdown
public void shutdown()Specifies actions needed to shut down the thread in which this object runs.- Specified by:
shutdownin interfaceInputFileProcessorIfc
-
writeLength
Record a long in a file - used to write a length in a scratch file to keep track of how much of a file has been processed. Used for recovering when the node is shut down prematurely (or crashes or dies unexpectedly). To use this, call it from the appropriate place in your version of the "processFiles" method. -
getLength
Returns the length stored in the scratch file. Used to keep track of how much of a file has been processed.- Parameters:
file- Specifies the scratch file.- Returns:
- number of bytes that have already been read and processed.
-
getRecoveryInformation
- Specified by:
getRecoveryInformationin interfaceInputFileProcessorIfc
-
incrementIn
protected void incrementIn()
-