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 voidAllows a DataProvider to indicate that some data is available for processingvoidThis 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 DCFieldContainergetData()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.booleanAllows a DataReceiver to obtain the last processed .arch filevoidTo handle the remaining input files when there is reject of a fileabstract booleanAllows a DataReceiver to determine whether some data is available for processingbooleanThis is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.booleanThis is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.booleanDetermines if the record received is start of file indicationabstract voidprocessData(DCFieldContainer inputData) Manipulates the data provided by its DataProviderbooleanprocessEndOfFileData(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.booleanThis is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.booleanprocessFileData(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.booleanThis is just a dummy implementation, any field processor needing the file level transaction behavior should override this method and implement correct behavior.booleanprocessStartOfFileData(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.booleanIndicates data provider to stop reading from the input file and reject itvoidremoveProcessedFile(File currArchFile) Allows a DataReceiver to remove .arch file once processed currArchFile - processed .arch fileabstract voidrun()voidsetbulkIOConfig(boolean bulkio) voidsetBulkProcessing(boolean b) voidsetDataProvider(DataProviderIfc provider) Sets the object from which this DataReceiver will obtain its data.voidsetDataReceiver(DataReceiverIfc receiver) Sets the object to which this DataProvider will send its data.voidsetDiscardedCounter(DiscardedStatisticsMonitorIfc discardedCounter) voidsetFileDataProvider(FileDataProviderIfc provider) Sets the object from which this FileDataReceiver will obtain its data.voidsetFileDataReceiver(FileDataReceiverIfc receiver) Sets the object to which this FileDataProvider will send its data.voidsetMultiThreadConfig(boolean mtChecked, boolean isOrdered, int numThreads) voidsetOutputType(Class type) Sets the Class of the objects that this FieldProcessor will produce as output.voidvoidsetProcessedArchFile(String file) Sets the processed .arch file absolute pathvoidsetTransactionID(String tID) abstract voidshutdown()Performs all steps necessary to gracefully stop this FieldProcessor.voidsignalBatchCompletion(String batch) Allows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiverbooleanAllows 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, waitMethods inherited from interface com.nt.udc.ndk.node.DataProviderIfc
getBulkDataMethods 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 theDCFieldContainerinterface.
-
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:DataProviderIfcAllows a DataReceiver to determine whether some data is available for processing- Specified by:
isDataAvailablein interfaceDataProviderIfc- Returns:
true, if data is available
-
getData
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the available data in a known format.- Specified by:
getDatain interfaceDataProviderIfc- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getData
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the available data in a known format. batch - The nars read will be grouped under the specified batch- Specified by:
getDatain interfaceDataProviderIfc- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getDataReceiver
Description copied from interface:DataProviderIfcGets the object that is retrieving data from this DataProvider- Specified by:
getDataReceiverin interfaceDataProviderIfc- Returns:
- Object to which this DataProvider is sending data
-
setDataReceiver
Description copied from interface:DataProviderIfcSets the object to which this DataProvider will send its data.- Specified by:
setDataReceiverin interfaceDataProviderIfc- Parameters:
receiver- Object which will obtain data from this DataProvider
-
signalBatchCompletion
Description copied from interface:DataProviderIfcAllows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiver- Specified by:
signalBatchCompletionin interfaceDataProviderIfc
-
setFileDataReceiver
Description copied from interface:FileDataProviderIfcSets the object to which this FileDataProvider will send its data.- Specified by:
setFileDataReceiverin interfaceFileDataProviderIfc- Parameters:
receiver- Object which will obtain data from this FileDataProvider
-
getFileDataReceiver
Description copied from interface:FileDataProviderIfcGets the object that is retrieving data from this FileDataProvider- Specified by:
getFileDataReceiverin interfaceFileDataProviderIfc- Returns:
- Object to which this FileDataProvider is sending data
-
setFileDataProvider
Description copied from interface:FileDataReceiverIfcSets the object from which this FileDataReceiver will obtain its data.- Specified by:
setFileDataProviderin interfaceFileDataReceiverIfc- Parameters:
provider- Object which has data that needs to be retrieved by this DataReceiver
-
getFileDataProvider
Description copied from interface:FileDataReceiverIfcGets the object that is holding data for this FileDataReceiver- Specified by:
getFileDataProviderin interfaceFileDataReceiverIfc- Returns:
- Object from which this DataReceiver is retrieving data
-
dataIsAvailable
public abstract void dataIsAvailable()Description copied from interface:DataReceiverIfcAllows a DataProvider to indicate that some data is available for processing- Specified by:
dataIsAvailablein interfaceDataReceiverIfc
-
processData
Description copied from interface:DataReceiverIfcManipulates the data provided by its DataProvider- Specified by:
processDatain 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:
fileDataIsAvailablein 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:
processStartOfFileDatain 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:
processFileDatain interfaceFileDataReceiverIfc- Returns:
true, if data is processed successfully- Throws:
NodeProcessingExceptionFileRejectException
-
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:
processFileDatain 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:
processEndOfFileDatain 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:
processRejectFilein 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:
isFileDataAvailablein 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:
isEndOfFilein interfaceFileDataProviderIfc- Returns:
true, if data is available
-
isStartOfFile
public boolean isStartOfFile()Description copied from interface:FileDataProviderIfcDetermines if the record received is start of file indication- Specified by:
isStartOfFilein interfaceFileDataProviderIfc- Returns:
-
getFileData
Description copied from interface:FileDataProviderIfcAllows a FileDataReceiver to obtain the available data in a known format.- Specified by:
getFileDatain interfaceFileDataProviderIfc- Returns:
- DCFieldContainer object containing the data that is available for processing
-
getFileBulkData
Description copied from interface:FileDataProviderIfcAllows a FileDataReceiver to obtain the available data in a known format.- Specified by:
getFileBulkDatain 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:DataReceiverIfcGets the object that is holding data for this DataReceiver- Specified by:
getDataProviderin interfaceDataReceiverIfc- Returns:
- Object from which this DataReceiver is retrieving data
-
setDataProvider
Description copied from interface:DataReceiverIfcSets the object from which this DataReceiver will obtain its data.- Specified by:
setDataProviderin 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:FileDataProviderIfcIndicates data provider to stop reading from the input file and reject it- Specified by:
rejectFilein interfaceFileDataProviderIfc- Returns:
truefor successful rejection of input file
-
openInputFile
- Specified by:
openInputFilein interfaceFileDataProviderIfc- Returns:
- Throws:
Exception
-
handleRejectOfFile
public void handleRejectOfFile()Description copied from interface:FileDataProviderIfcTo handle the remaining input files when there is reject of a file- Specified by:
handleRejectOfFilein interfaceFileDataProviderIfc
-
setTransactionID
- Specified by:
setTransactionIDin interfaceFileDataReceiverIfc
-
getCurrArchFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the currently processing .arch file- Specified by:
getCurrArchFilein interfaceDataProviderIfc- Returns:
- currently processing .arch file
-
getProcessedArchFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the last processed .arch file- Specified by:
getProcessedArchFilein interfaceDataProviderIfc- Returns:
- currently processing .arch file absolute path
-
setProcessedArchFile
Description copied from interface:DataProviderIfcSets the processed .arch file absolute path- Specified by:
setProcessedArchFilein interfaceDataProviderIfc- Parameters:
file- absolute path of processed .arch file
-
removeProcessedFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to remove .arch file once processed currArchFile - processed .arch file- Specified by:
removeProcessedFilein interfaceDataProviderIfc
-
validOIMinorType
public boolean validOIMinorType()Description copied from interface:DataProviderIfcAllows a DataReceiver to check if Minor Type supported for disaster recovery- Specified by:
validOIMinorTypein interfaceDataProviderIfc- Returns:
- true if valid
-
setbulkIOConfig
public void setbulkIOConfig(boolean bulkio)
-