public abstract class OITransport extends java.lang.Object implements DCTransport, DataReceiverIfc, FileDataReceiverIfc
| Modifier and Type | Field and Description |
|---|---|
protected DataProviderIfc |
dataProvider
Reference to the DataProvider of the transport.
|
protected FileDataProviderIfc |
filedataProvider
Reference to the FileDataProvider of the transport.
|
protected OINode |
node
Reference to the
OINode to which the transport is
associated. |
protected long |
pollingInterval
Time interval at which the node will check for data.
|
protected boolean |
running
Indicates whether the transport is running.
|
| Constructor and Description |
|---|
OITransport() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
dataIsAvailable()
This method is used by the DataProvider to tell the receiver that
data is available.
|
void |
fileDataIsAvailable()
This method is used by the FileDataProvider to tell the receiver that
data is available.
|
DataProviderIfc |
getDataProvider()
Returns the object from which this DataReceiver is receiving data.
|
FileDataProviderIfc |
getFileDataProvider()
Returns the object from which this FileDataReceiver is receiving data.
|
OINode |
getNode()
Returns the
OINode containing this transport. |
long |
getPollingInterval()
Returns the time interval between polls for available data.
|
long |
getRealNarsOut() |
protected void |
incrementOut()
Subclasses should call this whenever a record is written out successfully.
|
boolean |
isHealthy()
This method is used to check the transport's state of health.
|
abstract void |
processData(DCFieldContainer dcfContainer)
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 |
processEndOfFileData(java.lang.String transactionID)
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 |
processFileData(DCFieldContainer dcfContainer)
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 |
processFileData(DCFieldContainer[] data)
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 |
processRejectFile()
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(java.lang.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 |
setDataProvider(DataProviderIfc provider)
Sets the object from which this DataReceiver will obtain
its data.
|
void |
setFileDataProvider(FileDataProviderIfc provider)
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 |
setTransactionID(java.lang.String tID) |
abstract void |
shutdown()
This method is used to provide a means of shutting down the transport
in an orderly fashion.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessDataprotected OINode node
OINode to which the transport is
associated.protected DataProviderIfc dataProvider
protected FileDataProviderIfc filedataProvider
protected boolean running
protected long pollingInterval
public void setDataProvider(DataProviderIfc provider)
setDataProvider in interface DataReceiverIfcprovider - Object which has data that needs to be
retrieved by this DataReceiverpublic void setFileDataProvider(FileDataProviderIfc provider)
setFileDataProvider in interface FileDataReceiverIfcprovider - Object which has data that needs to be
retrieved by this DataReceiverpublic DataProviderIfc getDataProvider()
getDataProvider in interface DataReceiverIfcpublic FileDataProviderIfc getFileDataProvider()
getFileDataProvider in interface FileDataReceiverIfcpublic abstract void dataIsAvailable()
dataIsAvailable in interface DataReceiverIfcpublic void fileDataIsAvailable()
fileDataIsAvailable in interface FileDataReceiverIfcpublic abstract void processData(DCFieldContainer dcfContainer) throws NodeProcessingException
DCFieldContainer object and send the
information out through the desired protocol.processData in interface DataReceiverIfcdcfContainer - DCFieldContainer object containing
the data.NodeProcessingExceptionpublic boolean processFileData(DCFieldContainer dcfContainer) throws NodeProcessingException
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.processFileData in interface FileDataReceiverIfcdcfContainer - DCFieldContainer object containing
the data.true, if data is processed successfullyNodeProcessingExceptionpublic boolean processFileData(DCFieldContainer[] data) throws NodeProcessingException
processFileData in interface FileDataReceiverIfctrue, if data is processed successfullyNodeProcessingExceptionpublic boolean processStartOfFileData(java.lang.String originalFileName)
throws NodeProcessingException
processStartOfFileData in interface FileDataReceiverIfctrue, if data is availableNodeProcessingExceptionpublic boolean processEndOfFileData(java.lang.String transactionID)
throws NodeProcessingException
processEndOfFileData in interface FileDataReceiverIfctrue , if processed successfullyNodeProcessingExceptionpublic boolean processRejectFile()
throws NodeProcessingException
processRejectFile in interface FileDataReceiverIfctrue , if processed successfullyNodeProcessingExceptionpublic abstract void run()
run in interface java.lang.Runnablepublic abstract void shutdown()
shutdown in interface DCTransportpublic void setNode(OINode oinode)
OITransport is contained.oinode - The OINode which contains this transport.public OINode getNode()
OINode containing this transport.OINode of this transport.public void setPollingInterval(long interval)
interval - Number of milliseconds to wait.public long getPollingInterval()
public boolean isHealthy()
isHealthy in interface DCTransportpublic long getRealNarsOut()
protected void incrementOut()
public void setTransactionID(java.lang.String tID)
setTransactionID in interface FileDataReceiverIfc