public abstract class DCFieldProcessor extends java.lang.Object implements DataReceiverIfc, DataProviderIfc, FileDataProviderIfc, FileDataReceiverIfc, java.lang.Runnable
Constructor and Description |
---|
DCFieldProcessor()
Constructor for those field processors that do not
automatically create an output type.
|
DCFieldProcessor(java.lang.Class outputDataType)
Constructor which sets the Class of Objects that this
DCFieldProcessor will produce as its output.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
dataIsAvailable()
Allows a DataProvider to indicate that some data is
available for processing
|
void |
fileDataIsAvailable()
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
java.io.File |
getCurrArchFile()
Allows a DataReceiver to obtain the currently processing .arch file
|
abstract DCFieldContainer |
getData()
Allows a DataReceiver to obtain the available data in a
known format.
|
DCFieldContainer |
getData(java.lang.String batch)
Allows a DataReceiver to obtain the available data in a
known format.
|
DataProviderIfc |
getDataProvider()
Gets the object that is holding data for this DataReceiver
|
DataReceiverIfc |
getDataReceiver()
Gets the object that is retrieving data from this DataProvider
|
DiscardedStatisticsMonitorIfc |
getDiscardedCounter() |
DCFieldContainer[] |
getFileBulkData()
Allows a FileDataReceiver to obtain the available data in a
known format.
|
DCFieldContainer |
getFileData()
Allows a FileDataReceiver to obtain the available data in a
known format.
|
FileDataProviderIfc |
getFileDataProvider()
Gets the object that is holding data for this FileDataReceiver
|
FileDataReceiverIfc |
getFileDataReceiver()
Gets the object that is retrieving data from this FileDataProvider
|
java.lang.Class |
getOutputType()
Returns the Class of the objects that this FieldProcessor
will produce as output.
|
boolean |
getPollForData() |
java.lang.String |
getProcessedArchFile()
Allows a DataReceiver to obtain the last processed .arch file
|
void |
handleRejectOfFile()
To handle the remaining input files when there is reject of a file
|
abstract boolean |
isDataAvailable()
Allows a DataReceiver to determine whether some data is
available for processing
|
boolean |
isEndOfFile()
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
isFileDataAvailable()
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
isStartOfFile()
Determines if the record received is start of file indication
|
java.lang.String |
openInputFile() |
abstract void |
processData(DCFieldContainer inputData)
Manipulates the data provided by its DataProvider
|
boolean |
processEndOfFileData(java.lang.String transactionID)
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
processFileData(DCFieldContainer data)
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
processFileData(DCFieldContainer[] data)
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
processRejectFile()
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
processStartOfFileData(java.lang.String originalFileName)
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
rejectFile()
Indicates data provider to stop reading from the input file and reject it
|
void |
removeProcessedFile(java.io.File currArchFile)
Allows a DataReceiver to remove .arch file once processed
currArchFile - processed .arch file
|
abstract void |
run() |
void |
setbulkIOConfig(boolean bulkio) |
void |
setBulkProcessing(boolean b) |
void |
setDataProvider(DataProviderIfc provider)
Sets the object from which this DataReceiver will obtain
its data.
|
void |
setDataReceiver(DataReceiverIfc receiver)
Sets the object to which this DataProvider will send
its data.
|
void |
setDiscardedCounter(DiscardedStatisticsMonitorIfc discardedCounter) |
void |
setFileDataProvider(FileDataProviderIfc provider)
Sets the object from which this FileDataReceiver will obtain
its data.
|
void |
setFileDataReceiver(FileDataReceiverIfc receiver)
Sets the object to which this FileDataProvider will send
its data.
|
void |
setMultiThreadConfig(boolean mtChecked,
boolean isOrdered,
int numThreads) |
void |
setOutputType(java.lang.Class type)
Sets the Class of the objects that this FieldProcessor
will produce as output.
|
void |
setPollForData() |
void |
setProcessedArchFile(java.lang.String file)
Sets the processed .arch file absolute path
|
void |
setTransactionID(java.lang.String tID) |
abstract void |
shutdown()
Performs all steps necessary to gracefully stop this FieldProcessor.
|
void |
signalBatchCompletion(java.lang.String batch)
Allows a DataReceiver to know that the nars under the specified batch are
completed and handed over to the Data receiver
|
boolean |
validOIMinorType()
Allows a DataReceiver to check if Minor Type supported for disaster
recovery
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processData
getBulkData
public DCFieldProcessor(java.lang.Class outputDataType)
outputDataType
- Class of Objects that this
DCFieldProcessor should produce.
This class must implement the
DCFieldContainer
interface.public DCFieldProcessor()
public abstract void run()
run
in interface java.lang.Runnable
public abstract void shutdown()
public abstract boolean isDataAvailable()
DataProviderIfc
isDataAvailable
in interface DataProviderIfc
true
, if data is availablepublic abstract DCFieldContainer getData()
DataProviderIfc
getData
in interface DataProviderIfc
public DCFieldContainer getData(java.lang.String batch)
DataProviderIfc
getData
in interface DataProviderIfc
public DataReceiverIfc getDataReceiver()
DataProviderIfc
getDataReceiver
in interface DataProviderIfc
public void setDataReceiver(DataReceiverIfc receiver)
DataProviderIfc
setDataReceiver
in interface DataProviderIfc
receiver
- Object which will obtain data from this
DataProviderpublic void signalBatchCompletion(java.lang.String batch)
DataProviderIfc
signalBatchCompletion
in interface DataProviderIfc
public void setFileDataReceiver(FileDataReceiverIfc receiver)
FileDataProviderIfc
setFileDataReceiver
in interface FileDataProviderIfc
receiver
- Object which will obtain data from this
FileDataProviderpublic FileDataReceiverIfc getFileDataReceiver()
FileDataProviderIfc
getFileDataReceiver
in interface FileDataProviderIfc
public void setFileDataProvider(FileDataProviderIfc provider)
FileDataReceiverIfc
setFileDataProvider
in interface FileDataReceiverIfc
provider
- Object which has data that needs to be
retrieved by this DataReceiverpublic FileDataProviderIfc getFileDataProvider()
FileDataReceiverIfc
getFileDataProvider
in interface FileDataReceiverIfc
public abstract void dataIsAvailable()
DataReceiverIfc
dataIsAvailable
in interface DataReceiverIfc
public abstract void processData(DCFieldContainer inputData) throws NodeProcessingException
DataReceiverIfc
processData
in interface DataReceiverIfc
NodeProcessingException
public void fileDataIsAvailable()
fileDataIsAvailable
in interface FileDataReceiverIfc
public boolean processStartOfFileData(java.lang.String originalFileName) throws NodeProcessingException
processStartOfFileData
in interface FileDataReceiverIfc
true
, if data is availableNodeProcessingException
public boolean processFileData(DCFieldContainer data) throws NodeProcessingException, FileRejectException
processFileData
in interface FileDataReceiverIfc
true
, if data is processed successfullyNodeProcessingException
FileRejectException
public boolean processFileData(DCFieldContainer[] data) throws NodeProcessingException
processFileData
in interface FileDataReceiverIfc
true
, if data is processed successfullyNodeProcessingException
public boolean processEndOfFileData(java.lang.String transactionID) throws NodeProcessingException
processEndOfFileData
in interface FileDataReceiverIfc
true
, if processed successfullyNodeProcessingException
public boolean processRejectFile() throws NodeProcessingException
processRejectFile
in interface FileDataReceiverIfc
true
, if processed successfullyNodeProcessingException
public boolean isFileDataAvailable()
isFileDataAvailable
in interface FileDataProviderIfc
true
, if data is availablepublic boolean isEndOfFile()
isEndOfFile
in interface FileDataProviderIfc
true
, if data is availablepublic boolean isStartOfFile()
FileDataProviderIfc
isStartOfFile
in interface FileDataProviderIfc
public DCFieldContainer getFileData()
FileDataProviderIfc
getFileData
in interface FileDataProviderIfc
public DCFieldContainer[] getFileBulkData()
FileDataProviderIfc
getFileBulkData
in interface FileDataProviderIfc
public void setPollForData()
public boolean getPollForData()
public DataProviderIfc getDataProvider()
DataReceiverIfc
getDataProvider
in interface DataReceiverIfc
public void setDataProvider(DataProviderIfc provider)
DataReceiverIfc
setDataProvider
in interface DataReceiverIfc
provider
- Object which has data that needs to be
retrieved by this DataReceiverpublic java.lang.Class getOutputType()
public void setOutputType(java.lang.Class type)
DCFieldContainer
public DiscardedStatisticsMonitorIfc getDiscardedCounter()
public void setDiscardedCounter(DiscardedStatisticsMonitorIfc discardedCounter)
public void setMultiThreadConfig(boolean mtChecked, boolean isOrdered, int numThreads)
public void setBulkProcessing(boolean b)
public boolean rejectFile()
FileDataProviderIfc
rejectFile
in interface FileDataProviderIfc
true for successful rejection of input file
public java.lang.String openInputFile() throws java.lang.Exception
openInputFile
in interface FileDataProviderIfc
java.lang.Exception
public void handleRejectOfFile()
FileDataProviderIfc
handleRejectOfFile
in interface FileDataProviderIfc
public void setTransactionID(java.lang.String tID)
setTransactionID
in interface FileDataReceiverIfc
public java.io.File getCurrArchFile()
DataProviderIfc
getCurrArchFile
in interface DataProviderIfc
public java.lang.String getProcessedArchFile()
DataProviderIfc
getProcessedArchFile
in interface DataProviderIfc
public void setProcessedArchFile(java.lang.String file)
DataProviderIfc
setProcessedArchFile
in interface DataProviderIfc
file
- absolute path of processed .arch filepublic void removeProcessedFile(java.io.File currArchFile)
DataProviderIfc
removeProcessedFile
in interface DataProviderIfc
public boolean validOIMinorType()
DataProviderIfc
validOIMinorType
in interface DataProviderIfc
public void setbulkIOConfig(boolean bulkio)