Class OITransport

java.lang.Object
com.nt.udc.ndk.node.OITransport
All Implemented Interfaces:
DataReceiverIfc, DCTransport, FileDataReceiverIfc, Runnable
Direct Known Subclasses:
FileOITransport, JDBCOITransport, RadiusOITransport, TcpOITransport, UdpOITransport

public abstract class OITransport extends Object implements DCTransport, DataReceiverIfc, FileDataReceiverIfc
This is the base class for all OI transports. It provides methods to set the transport's DataReceiver and other configuration attributes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected DataProviderIfc
    Reference to the DataProvider of the transport.
    Reference to the FileDataProvider of the transport.
    protected OINode
    Reference to the OINode to which the transport is associated.
    protected long
    Time interval at which the node will check for data.
    protected boolean
    Indicates whether the transport is running.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    This method is used by the DataProvider to tell the receiver that data is available.
    void
    This method is used by the FileDataProvider to tell the receiver that data is available.
    Returns the object from which this DataReceiver is receiving data.
    Returns the object from which this FileDataReceiver is receiving data.
    Returns the OINode containing this transport.
    long
    Returns the time interval between polls for available data.
    long
     
    protected void
    Subclasses should call this whenever a record is written out successfully.
    boolean
    This method is used to check the transport's state of health.
    abstract void
    This method should be overridden with the transport-specific logic to accept a DCFieldContainer object and send the information out through the desired protocol.
    boolean
    Allows FileDataProvider to indicate end of file record This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
    boolean
    This method should be overridden with the transport-specific logic to accept a DCFieldContainer object and send the information out through the desired protocol.
    boolean
    Manipulates the set of data provided by its DataProvider This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
    boolean
    Allows FileDataProvider to indicate rejection of the file This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
    boolean
    processStartOfFileData(String originalFileName)
    Allows FileDataProvider to indicate start of file This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
    abstract void
    run()
    This method is used to control processing when the receiver 'pulls' the data from the DataProvider as it becomes available.
    void
    Sets the object from which this DataReceiver will obtain its data.
    void
    Sets the object from which this FileDataReceiver will obtain its data.
    void
    setNode(OINode oinode)
    Sets the node within which this OITransport is contained.
    void
    setPollingInterval(long interval)
    Sets the time interval between polls for available data.
    void
     
    abstract void
    This method is used to provide a means of shutting down the transport in an orderly fashion.

    Methods 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.DataReceiverIfc

    processData
  • Field Details

    • node

      protected OINode node
      Reference to the OINode to which the transport is associated.
    • dataProvider

      protected DataProviderIfc dataProvider
      Reference to the DataProvider of the transport.
    • filedataProvider

      protected FileDataProviderIfc filedataProvider
      Reference to the FileDataProvider of the transport.
    • running

      protected boolean running
      Indicates whether the transport is running.
    • pollingInterval

      protected long pollingInterval
      Time interval at which the node will check for data. Default is 20 seconds.
  • Constructor Details

    • OITransport

      public OITransport()
  • Method Details

    • setDataProvider

      public void setDataProvider(DataProviderIfc provider)
      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
    • setFileDataProvider

      public void setFileDataProvider(FileDataProviderIfc provider)
      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
    • getDataProvider

      public DataProviderIfc getDataProvider()
      Returns the object from which this DataReceiver is receiving data.
      Specified by:
      getDataProvider in interface DataReceiverIfc
      Returns:
      Returns the DataProvider of this receiver.
    • getFileDataProvider

      public FileDataProviderIfc getFileDataProvider()
      Returns the object from which this FileDataReceiver is receiving data.
      Specified by:
      getFileDataProvider in interface FileDataReceiverIfc
      Returns:
      Returns the FileDataProvider of this receiver.
    • dataIsAvailable

      public abstract void dataIsAvailable()
      This method is used by the DataProvider to tell the receiver that data is available. It is then the receiver's responsibility to obtain the data and process it. This method should be used when the intent is for the DataProvider to 'push' the data to the receiver.
      Specified by:
      dataIsAvailable in interface DataReceiverIfc
    • fileDataIsAvailable

      public void fileDataIsAvailable()
      This method is used by the FileDataProvider to tell the receiver that data is available. It is then the receiver's responsibility to obtain the data and process it. This method should be used when the intent is for the DataProvider to 'push' the data to the receiver. This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      fileDataIsAvailable in interface FileDataReceiverIfc
    • processData

      public abstract void processData(DCFieldContainer dcfContainer) throws NodeProcessingException
      This method should be overridden with the transport-specific logic to accept a DCFieldContainer object and send the information out through the desired protocol.
      Specified by:
      processData in interface DataReceiverIfc
      Parameters:
      dcfContainer - DCFieldContainer object containing the data.
      Throws:
      NodeProcessingException
    • processFileData

      public boolean processFileData(DCFieldContainer dcfContainer) throws NodeProcessingException
      This method should be overridden with the transport-specific logic to accept a DCFieldContainer object and send the information out through the desired protocol. This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      processFileData in interface FileDataReceiverIfc
      Parameters:
      dcfContainer - DCFieldContainer object containing the data.
      Returns:
      true, if data is processed successfully
      Throws:
      NodeProcessingException
    • processFileData

      public boolean processFileData(DCFieldContainer[] data) throws NodeProcessingException
      Manipulates the set of data provided by its DataProvider This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      processFileData in interface FileDataReceiverIfc
      Returns:
      true, if data is processed successfully
      Throws:
      NodeProcessingException
    • processStartOfFileData

      public boolean processStartOfFileData(String originalFileName) throws NodeProcessingException
      Allows FileDataProvider to indicate start of file This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      processStartOfFileData in interface FileDataReceiverIfc
      Returns:
      true, if data is available
      Throws:
      NodeProcessingException
    • processEndOfFileData

      public boolean processEndOfFileData(String transactionID) throws NodeProcessingException
      Allows FileDataProvider to indicate end of file record This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      processEndOfFileData in interface FileDataReceiverIfc
      Returns:
      true , if processed successfully
      Throws:
      NodeProcessingException
    • processRejectFile

      public boolean processRejectFile() throws NodeProcessingException
      Allows FileDataProvider to indicate rejection of the file This is just a dummy implementation, any transport needing to have file level transaction, should override this method and provide implementation.
      Specified by:
      processRejectFile in interface FileDataReceiverIfc
      Returns:
      true , if processed successfully
      Throws:
      NodeProcessingException
    • run

      public abstract void run()
      This method is used to control processing when the receiver 'pulls' the data from the DataProvider as it becomes available.
      Specified by:
      run in interface Runnable
    • shutdown

      public abstract void shutdown()
      This method is used to provide a means of shutting down the transport in an orderly fashion.
      Specified by:
      shutdown in interface DCTransport
    • setNode

      public void setNode(OINode oinode)
      Sets the node within which this OITransport is contained.
      Parameters:
      oinode - The OINode which contains this transport.
    • getNode

      public OINode getNode()
      Returns the OINode containing this transport.
      Returns:
      Returns the OINode of this transport.
    • setPollingInterval

      public void setPollingInterval(long interval)
      Sets the time interval between polls for available data.
      Parameters:
      interval - Number of milliseconds to wait.
    • getPollingInterval

      public long getPollingInterval()
      Returns the time interval between polls for available data.
      Returns:
      Returns the polling interval.
    • isHealthy

      public boolean isHealthy()
      This method is used to check the transport's state of health. By default it returns true. It is to be overridden by subclasses.
      Specified by:
      isHealthy in interface DCTransport
      Returns:
      true if the transport is healthy, false otherwise
    • getRealNarsOut

      public long getRealNarsOut()
      Returns:
      The output count, since the node was last restarted, as recorded in the field realNarsOut.
    • incrementOut

      protected void incrementOut()
      Subclasses should call this whenever a record is written out successfully.
    • setTransactionID

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