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 Details

    • DCFieldProcessor

      public DCFieldProcessor(Class outputDataType)
      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 the DCFieldContainer interface.
    • DCFieldProcessor

      public DCFieldProcessor()
      Constructor for those field processors that do not automatically create an output type.
  • Method Details

    • run

      public abstract void run()
      Specified by:
      run in interface Runnable
    • 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 interface DataProviderIfc
      Returns:
      true, if data is available
    • getData

      public abstract DCFieldContainer getData()
      Description copied from interface: DataProviderIfc
      Allows a DataReceiver to obtain the available data in a known format.
      Specified by:
      getData in interface DataProviderIfc
      Returns:
      DCFieldContainer object containing the data that is available for processing
    • getData

      public DCFieldContainer getData(String batch)
      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 interface DataProviderIfc
      Returns:
      DCFieldContainer object containing the data that is available for processing
    • getDataReceiver

      public DataReceiverIfc getDataReceiver()
      Description copied from interface: DataProviderIfc
      Gets the object that is retrieving data from this DataProvider
      Specified by:
      getDataReceiver in interface DataProviderIfc
      Returns:
      Object to which this DataProvider is sending data
    • setDataReceiver

      public void setDataReceiver(DataReceiverIfc receiver)
      Description copied from interface: DataProviderIfc
      Sets the object to which this DataProvider will send its data.
      Specified by:
      setDataReceiver in interface DataProviderIfc
      Parameters:
      receiver - Object which will obtain data from this DataProvider
    • signalBatchCompletion

      public void signalBatchCompletion(String batch)
      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 interface DataProviderIfc
    • setFileDataReceiver

      public void setFileDataReceiver(FileDataReceiverIfc receiver)
      Description copied from interface: FileDataProviderIfc
      Sets the object to which this FileDataProvider will send its data.
      Specified by:
      setFileDataReceiver in interface FileDataProviderIfc
      Parameters:
      receiver - Object which will obtain data from this FileDataProvider
    • getFileDataReceiver

      public FileDataReceiverIfc getFileDataReceiver()
      Description copied from interface: FileDataProviderIfc
      Gets the object that is retrieving data from this FileDataProvider
      Specified by:
      getFileDataReceiver in interface FileDataProviderIfc
      Returns:
      Object to which this FileDataProvider is sending data
    • setFileDataProvider

      public void setFileDataProvider(FileDataProviderIfc provider)
      Description copied from interface: FileDataReceiverIfc
      Sets the object from which this FileDataReceiver will obtain its data.
      Specified by:
      setFileDataProvider in interface FileDataReceiverIfc
      Parameters:
      provider - Object which has data that needs to be retrieved by this DataReceiver
    • getFileDataProvider

      public FileDataProviderIfc getFileDataProvider()
      Description copied from interface: FileDataReceiverIfc
      Gets the object that is holding data for this FileDataReceiver
      Specified by:
      getFileDataProvider in interface FileDataReceiverIfc
      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 interface DataReceiverIfc
    • processData

      public abstract void processData(DCFieldContainer inputData) throws NodeProcessingException
      Description copied from interface: DataReceiverIfc
      Manipulates the data provided by its DataProvider
      Specified by:
      processData in interface DataReceiverIfc
      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 interface FileDataReceiverIfc
    • processStartOfFileData

      public boolean processStartOfFileData(String originalFileName) throws NodeProcessingException
      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 interface FileDataReceiverIfc
      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 interface FileDataReceiverIfc
      Returns:
      true, if data is processed successfully
      Throws:
      NodeProcessingException
      FileRejectException
    • processFileData

      public boolean processFileData(DCFieldContainer[] data) throws NodeProcessingException
      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 interface FileDataReceiverIfc
      Returns:
      true, if data is processed successfully
      Throws:
      NodeProcessingException
    • processEndOfFileData

      public boolean processEndOfFileData(String transactionID) throws NodeProcessingException
      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 interface FileDataReceiverIfc
      Returns:
      true , if processed successfully
      Throws:
      NodeProcessingException
    • processRejectFile

      public boolean processRejectFile() throws NodeProcessingException
      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 interface FileDataReceiverIfc
      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 interface FileDataProviderIfc
      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 interface FileDataProviderIfc
      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 interface FileDataProviderIfc
      Returns:
    • getFileData

      public DCFieldContainer getFileData()
      Description copied from interface: FileDataProviderIfc
      Allows a FileDataReceiver to obtain the available data in a known format.
      Specified by:
      getFileData in interface FileDataProviderIfc
      Returns:
      DCFieldContainer object containing the data that is available for processing
    • getFileBulkData

      public DCFieldContainer[] getFileBulkData()
      Description copied from interface: FileDataProviderIfc
      Allows a FileDataReceiver to obtain the available data in a known format.
      Specified by:
      getFileBulkData in interface FileDataProviderIfc
      Returns:
      DCFieldContainer object array, containing the data that is for processing
    • setPollForData

      public void setPollForData()
    • getPollForData

      public boolean getPollForData()
    • getDataProvider

      public DataProviderIfc getDataProvider()
      Description copied from interface: DataReceiverIfc
      Gets the object that is holding data for this DataReceiver
      Specified by:
      getDataProvider in interface DataReceiverIfc
      Returns:
      Object from which this DataReceiver is retrieving data
    • setDataProvider

      public void setDataProvider(DataProviderIfc provider)
      Description copied from interface: DataReceiverIfc
      Sets the object from which this DataReceiver will obtain its data.
      Specified by:
      setDataProvider in interface DataReceiverIfc
      Parameters:
      provider - Object which has data that needs to be retrieved by this DataReceiver
    • getOutputType

      public Class getOutputType()
      Returns the Class of the objects that this FieldProcessor will produce as output.
    • setOutputType

      public void setOutputType(Class type)
      Sets the Class of the objects that this FieldProcessor will produce as output. This class must implement DCFieldContainer
    • getDiscardedCounter

      public DiscardedStatisticsMonitorIfc getDiscardedCounter()
    • setDiscardedCounter

      public void setDiscardedCounter(DiscardedStatisticsMonitorIfc discardedCounter)
    • 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 interface FileDataProviderIfc
      Returns:
      true for successful rejection of input file
    • openInputFile

      public String openInputFile() throws Exception
      Specified by:
      openInputFile in interface FileDataProviderIfc
      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 interface FileDataProviderIfc
    • setTransactionID

      public void setTransactionID(String tID)
      Specified by:
      setTransactionID in interface FileDataReceiverIfc
    • getCurrArchFile

      public File getCurrArchFile()
      Description copied from interface: DataProviderIfc
      Allows a DataReceiver to obtain the currently processing .arch file
      Specified by:
      getCurrArchFile in interface DataProviderIfc
      Returns:
      currently processing .arch file
    • getProcessedArchFile

      public String getProcessedArchFile()
      Description copied from interface: DataProviderIfc
      Allows a DataReceiver to obtain the last processed .arch file
      Specified by:
      getProcessedArchFile in interface DataProviderIfc
      Returns:
      currently processing .arch file absolute path
    • setProcessedArchFile

      public void setProcessedArchFile(String file)
      Description copied from interface: DataProviderIfc
      Sets the processed .arch file absolute path
      Specified by:
      setProcessedArchFile in interface DataProviderIfc
      Parameters:
      file - absolute path of processed .arch file
    • removeProcessedFile

      public void removeProcessedFile(File currArchFile)
      Description copied from interface: DataProviderIfc
      Allows a DataReceiver to remove .arch file once processed currArchFile - processed .arch file
      Specified by:
      removeProcessedFile in interface DataProviderIfc
    • 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 interface DataProviderIfc
      Returns:
      true if valid
    • setbulkIOConfig

      public void setbulkIOConfig(boolean bulkio)