Package com.nt.udc.ndk.node
Class DCFieldProcessor
java.lang.Object
com.nt.udc.ndk.node.DCFieldProcessor
- All Implemented Interfaces:
DataProviderIfc
,DataReceiverIfc
,FileDataProviderIfc
,FileDataReceiverIfc
,Runnable
- Direct Known Subclasses:
DeclNPLFieldProcessor
,NPLFieldProcessor
public abstract class DCFieldProcessor
extends Object
implements DataReceiverIfc, DataProviderIfc, FileDataProviderIfc, FileDataReceiverIfc, Runnable
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for those field processors that do not automatically create an output type.DCFieldProcessor
(Class outputDataType) Constructor which sets the Class of Objects that this DCFieldProcessor will produce as its output. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Allows a DataProvider to indicate that some data is available for processingvoid
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.Allows a DataReceiver to obtain the currently processing .arch fileabstract DCFieldContainer
getData()
Allows a DataReceiver to obtain the available data in a known format.Allows a DataReceiver to obtain the available data in a known format.Gets the object that is holding data for this DataReceiverGets the object that is retrieving data from this DataProviderAllows a FileDataReceiver to obtain the available data in a known format.Allows a FileDataReceiver to obtain the available data in a known format.Gets the object that is holding data for this FileDataReceiverGets the object that is retrieving data from this FileDataProviderReturns the Class of the objects that this FieldProcessor will produce as output.boolean
Allows a DataReceiver to obtain the last processed .arch filevoid
To handle the remaining input files when there is reject of a fileabstract boolean
Allows a DataReceiver to determine whether some data is available for processingboolean
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.boolean
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.boolean
Determines if the record received is start of file indicationabstract void
processData
(DCFieldContainer inputData) Manipulates the data provided by its DataProviderboolean
processEndOfFileData
(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
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
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
(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
Indicates data provider to stop reading from the input file and reject itvoid
removeProcessedFile
(File currArchFile) Allows a DataReceiver to remove .arch file once processed currArchFile - processed .arch fileabstract 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
(Class type) Sets the Class of the objects that this FieldProcessor will produce as output.void
void
setProcessedArchFile
(String file) Sets the processed .arch file absolute pathvoid
setTransactionID
(String tID) abstract void
shutdown()
Performs all steps necessary to gracefully stop this FieldProcessor.void
signalBatchCompletion
(String batch) Allows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiverboolean
Allows a DataReceiver to check if Minor Type supported for disaster recoveryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.nt.udc.ndk.node.DataProviderIfc
getBulkData
Methods inherited from interface com.nt.udc.ndk.node.DataReceiverIfc
processData
-
Constructor Details
-
DCFieldProcessor
Constructor which sets the Class of Objects that this DCFieldProcessor will produce as its output.- Parameters:
outputDataType
- Class of Objects that this DCFieldProcessor should produce. This class must implement theDCFieldContainer
interface.
-
DCFieldProcessor
public DCFieldProcessor()Constructor for those field processors that do not automatically create an output type.
-
-
Method Details
-
run
public abstract void run() -
shutdown
public abstract void shutdown()Performs all steps necessary to gracefully stop this FieldProcessor. -
isDataAvailable
public abstract boolean isDataAvailable()Description copied from interface:DataProviderIfc
Allows a DataReceiver to determine whether some data is available for processing- Specified by:
isDataAvailable
in interfaceDataProviderIfc
- Returns:
true
, if data is available
-
getData
Description copied from interface:DataProviderIfc
Allows a DataReceiver to obtain the available data in a known format.- Specified by:
getData
in interfaceDataProviderIfc
- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getData
Description copied from interface:DataProviderIfc
Allows a DataReceiver to obtain the available data in a known format. batch - The nars read will be grouped under the specified batch- Specified by:
getData
in interfaceDataProviderIfc
- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getDataReceiver
Description copied from interface:DataProviderIfc
Gets the object that is retrieving data from this DataProvider- Specified by:
getDataReceiver
in interfaceDataProviderIfc
- Returns:
- Object to which this DataProvider is sending data
-
setDataReceiver
Description copied from interface:DataProviderIfc
Sets the object to which this DataProvider will send its data.- Specified by:
setDataReceiver
in interfaceDataProviderIfc
- Parameters:
receiver
- Object which will obtain data from this DataProvider
-
signalBatchCompletion
Description copied from interface:DataProviderIfc
Allows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiver- Specified by:
signalBatchCompletion
in interfaceDataProviderIfc
-
setFileDataReceiver
Description copied from interface:FileDataProviderIfc
Sets the object to which this FileDataProvider will send its data.- Specified by:
setFileDataReceiver
in interfaceFileDataProviderIfc
- Parameters:
receiver
- Object which will obtain data from this FileDataProvider
-
getFileDataReceiver
Description copied from interface:FileDataProviderIfc
Gets the object that is retrieving data from this FileDataProvider- Specified by:
getFileDataReceiver
in interfaceFileDataProviderIfc
- Returns:
- Object to which this FileDataProvider is sending data
-
setFileDataProvider
Description copied from interface:FileDataReceiverIfc
Sets the object from which this FileDataReceiver will obtain its data.- Specified by:
setFileDataProvider
in interfaceFileDataReceiverIfc
- Parameters:
provider
- Object which has data that needs to be retrieved by this DataReceiver
-
getFileDataProvider
Description copied from interface:FileDataReceiverIfc
Gets the object that is holding data for this FileDataReceiver- Specified by:
getFileDataProvider
in interfaceFileDataReceiverIfc
- Returns:
- Object from which this DataReceiver is retrieving data
-
dataIsAvailable
public abstract void dataIsAvailable()Description copied from interface:DataReceiverIfc
Allows a DataProvider to indicate that some data is available for processing- Specified by:
dataIsAvailable
in interfaceDataReceiverIfc
-
processData
Description copied from interface:DataReceiverIfc
Manipulates the data provided by its DataProvider- Specified by:
processData
in interfaceDataReceiverIfc
- Throws:
NodeProcessingException
-
fileDataIsAvailable
public 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.- Specified by:
fileDataIsAvailable
in interfaceFileDataReceiverIfc
-
processStartOfFileData
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
processStartOfFileData
in interfaceFileDataReceiverIfc
- Returns:
true
, if data is available- Throws:
NodeProcessingException
-
processFileData
public boolean processFileData(DCFieldContainer data) throws NodeProcessingException, FileRejectException This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
processFileData
in interfaceFileDataReceiverIfc
- Returns:
true
, if data is processed successfully- Throws:
NodeProcessingException
FileRejectException
-
processFileData
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
processFileData
in interfaceFileDataReceiverIfc
- Returns:
true
, if data is processed successfully- Throws:
NodeProcessingException
-
processEndOfFileData
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
processEndOfFileData
in interfaceFileDataReceiverIfc
- Returns:
true
, if processed successfully- Throws:
NodeProcessingException
-
processRejectFile
This is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
processRejectFile
in interfaceFileDataReceiverIfc
- Returns:
true
, if processed successfully- Throws:
NodeProcessingException
-
isFileDataAvailable
public 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.- Specified by:
isFileDataAvailable
in interfaceFileDataProviderIfc
- Returns:
true
, if data is available
-
isEndOfFile
public 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.- Specified by:
isEndOfFile
in interfaceFileDataProviderIfc
- Returns:
true
, if data is available
-
isStartOfFile
public boolean isStartOfFile()Description copied from interface:FileDataProviderIfc
Determines if the record received is start of file indication- Specified by:
isStartOfFile
in interfaceFileDataProviderIfc
- Returns:
-
getFileData
Description copied from interface:FileDataProviderIfc
Allows a FileDataReceiver to obtain the available data in a known format.- Specified by:
getFileData
in interfaceFileDataProviderIfc
- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getFileBulkData
Description copied from interface:FileDataProviderIfc
Allows a FileDataReceiver to obtain the available data in a known format.- Specified by:
getFileBulkData
in interfaceFileDataProviderIfc
- Returns:
- DCFieldContainer object array, containing the data that is for processing
-
setPollForData
public void setPollForData() -
getPollForData
public boolean getPollForData() -
getDataProvider
Description copied from interface:DataReceiverIfc
Gets the object that is holding data for this DataReceiver- Specified by:
getDataProvider
in interfaceDataReceiverIfc
- Returns:
- Object from which this DataReceiver is retrieving data
-
setDataProvider
Description copied from interface:DataReceiverIfc
Sets the object from which this DataReceiver will obtain its data.- Specified by:
setDataProvider
in interfaceDataReceiverIfc
- Parameters:
provider
- Object which has data that needs to be retrieved by this DataReceiver
-
getOutputType
Returns the Class of the objects that this FieldProcessor will produce as output. -
setOutputType
Sets the Class of the objects that this FieldProcessor will produce as output. This class must implementDCFieldContainer
-
getDiscardedCounter
-
setDiscardedCounter
-
setMultiThreadConfig
public void setMultiThreadConfig(boolean mtChecked, boolean isOrdered, int numThreads) -
setBulkProcessing
public void setBulkProcessing(boolean b) -
rejectFile
public boolean rejectFile()Description copied from interface:FileDataProviderIfc
Indicates data provider to stop reading from the input file and reject it- Specified by:
rejectFile
in interfaceFileDataProviderIfc
- Returns:
true
for successful rejection of input file
-
openInputFile
- Specified by:
openInputFile
in interfaceFileDataProviderIfc
- Returns:
- Throws:
Exception
-
handleRejectOfFile
public void handleRejectOfFile()Description copied from interface:FileDataProviderIfc
To handle the remaining input files when there is reject of a file- Specified by:
handleRejectOfFile
in interfaceFileDataProviderIfc
-
setTransactionID
- Specified by:
setTransactionID
in interfaceFileDataReceiverIfc
-
getCurrArchFile
Description copied from interface:DataProviderIfc
Allows a DataReceiver to obtain the currently processing .arch file- Specified by:
getCurrArchFile
in interfaceDataProviderIfc
- Returns:
- currently processing .arch file
-
getProcessedArchFile
Description copied from interface:DataProviderIfc
Allows a DataReceiver to obtain the last processed .arch file- Specified by:
getProcessedArchFile
in interfaceDataProviderIfc
- Returns:
- currently processing .arch file absolute path
-
setProcessedArchFile
Description copied from interface:DataProviderIfc
Sets the processed .arch file absolute path- Specified by:
setProcessedArchFile
in interfaceDataProviderIfc
- Parameters:
file
- absolute path of processed .arch file
-
removeProcessedFile
Description copied from interface:DataProviderIfc
Allows a DataReceiver to remove .arch file once processed currArchFile - processed .arch file- Specified by:
removeProcessedFile
in interfaceDataProviderIfc
-
validOIMinorType
public boolean validOIMinorType()Description copied from interface:DataProviderIfc
Allows a DataReceiver to check if Minor Type supported for disaster recovery- Specified by:
validOIMinorType
in interfaceDataProviderIfc
- Returns:
- true if valid
-
setbulkIOConfig
public void setbulkIOConfig(boolean bulkio)
-