public class FileOITransport extends OITransport
| Modifier and Type | Field and Description |
|---|---|
protected AbstractOIFtpPusher |
pusher |
dataProvider, filedataProvider, node, pollingInterval, running| Constructor and Description |
|---|
FileOITransport(OINode oiNode,
DataProviderIfc dp,
OIFileFormatter oiFileFormatter)
Construct a new
FileOITransport to be used within the
specified OINode, receiving its data from the given
DataProvider. |
FileOITransport(OINode oiNode,
DataProviderIfc dp,
OIFileFormatter oiFileFormatter,
AbstractOIFtpPusher oiFtpPusher)
Construct a new
FileOITransport to be used within the
specified OINode, receiving its data from the given
DataProvider. |
FileOITransport(OINode oiNode,
OIFileFormatter oiFileFormatter)
Construct a new
FileOITransport to be used within the
specified OINode. |
FileOITransport(OINode oiNode,
OIFileFormatter oiFileFormatter,
AbstractOIFtpPusher oiFtpPusher)
Construct a new
FileOITransport to be used within the
specified OINode. |
| Modifier and Type | Method and Description |
|---|---|
void |
dataIsAvailable()
This method allows the transport's DataProvider to tell the transport
that data is waiting to be 'picked up'.
|
boolean |
isHealthy()
This method is used to check if the transport is fully functional.
|
boolean |
isShutdownOnError()
Indicates whether transport should shutdown upon processing error
|
void |
processData(DCFieldContainer record)
Accept a
DCFieldContainer to be written to the output
file. |
void |
processData(DCFieldContainer[] records)
Accept some
DCFieldContainer objects to be written to
the output file. |
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[] records)
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.
|
void |
run()
This method is used when the OITransport runs within its own thread.
|
void |
setShutdownOnError(boolean flag)
Indicates whether transport should shutdown upon processing error
|
void |
setTransactionID(java.lang.String tID) |
void |
shutdown()
Stop the transport.
|
fileDataIsAvailable, getDataProvider, getFileDataProvider, getNode, getPollingInterval, getRealNarsOut, incrementOut, setDataProvider, setFileDataProvider, setNode, setPollingIntervalprotected AbstractOIFtpPusher pusher
public FileOITransport(OINode oiNode, OIFileFormatter oiFileFormatter)
FileOITransport to be used within the
specified OINode. The OIFileFormatter()
object will create the output files.oiNode - Reference to the OINode
containing the transport.oiFileFormatter - OIFileFormatter() object
responsible for file output and managing
the output files.public FileOITransport(OINode oiNode, OIFileFormatter oiFileFormatter, AbstractOIFtpPusher oiFtpPusher)
FileOITransport to be used within the
specified OINode. The OIFileFormatter()
object will create the output files. The AbstractOIFtpPusher()
object will transfer the completed files to the remote host.oiNode - Reference to the OINode
containing the transport.oiFileFormatter - OIFileFormatter() object
responsible for file output and managing the
output files.abstractOiFtpPusher - AbastractOIFtpPusher()
object responsible for transferring completed
files to the remote host.public FileOITransport(OINode oiNode, DataProviderIfc dp, OIFileFormatter oiFileFormatter)
FileOITransport to be used within the
specified OINode, receiving its data from the given
DataProvider. The OIFileFormatter() object will create
the output files.oiNode - Reference to the OINode
containing the transport.dp - Reference to the transport's DataProvider.oiFileFormatter - OIFileWriter() object
responsible for file output and managing
the output files.public FileOITransport(OINode oiNode, DataProviderIfc dp, OIFileFormatter oiFileFormatter, AbstractOIFtpPusher oiFtpPusher)
FileOITransport to be used within the
specified OINode, receiving its data from the given
DataProvider. The OIFileFormatter() object will create
the output files. The AbstractOIFtpPusher() object
will transfer the completed files to the remote host.oiNode - Reference to the OINode
containing the transport.dp - Reference to the transport's DataProvider.oiFileFormatter - OIFileFormatter() object
responsible for file output and managing the
output files.AbstractoiFtpPusher - AbstractOIFtpPusher() object
responsible for transferring completed files
to the remote host.public boolean isShutdownOnError()
public void setShutdownOnError(boolean flag)
flag - true, if error should cause a shutdown.
Default is false.public void dataIsAvailable()
getData() method and the receiver's
processData() method.dataIsAvailable in interface DataReceiverIfcdataIsAvailable in class OITransportpublic void run()
run in interface java.lang.Runnablerun in class OITransportpublic void shutdown()
Upon shutdown, the currently open output file will be closed and a final check will be made for any output files which have exceeded the configured time threshold. Such files will be tagged with the appropriate file extension indicated by the 'processedfileextension' configuration parameter.
shutdown in interface DCTransportshutdown in class OITransportpublic void processData(DCFieldContainer record) throws NodeProcessingException
DCFieldContainer to be written to the output
file. Pass the record along to the file formatter to be output
to the file.processData in interface DataReceiverIfcprocessData in class OITransportrecord - DCFieldContainer containing the data.NodeProcessingExceptionpublic void processData(DCFieldContainer[] records) throws NodeProcessingException
DCFieldContainer objects to be written to
the output file. Pass the record along to the file formatter to
be output to the file.record - DCFieldContainer containing the data.NodeProcessingExceptionpublic boolean processFileData(DCFieldContainer dcfContainer) throws NodeProcessingException
OITransportDCFieldContainer 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 FileDataReceiverIfcprocessFileData in class OITransportdcfContainer - DCFieldContainer object containing
the data.true, if data is processed successfullyNodeProcessingExceptionpublic boolean processFileData(DCFieldContainer[] records) throws NodeProcessingException
OITransportprocessFileData in interface FileDataReceiverIfcprocessFileData in class OITransporttrue, if data is processed successfullyNodeProcessingExceptionpublic boolean processRejectFile()
OITransportprocessRejectFile in interface FileDataReceiverIfcprocessRejectFile in class OITransporttrue , if processed successfullypublic boolean processStartOfFileData(java.lang.String originalFileName)
OITransportprocessStartOfFileData in interface FileDataReceiverIfcprocessStartOfFileData in class OITransporttrue, if data is availablepublic boolean processEndOfFileData(java.lang.String transactionID)
OITransportprocessEndOfFileData in interface FileDataReceiverIfcprocessEndOfFileData in class OITransporttrue , if processed successfullypublic boolean isHealthy()
isHealthy in interface DCTransportisHealthy in class OITransportpublic void setTransactionID(java.lang.String tID)
setTransactionID in interface FileDataReceiverIfcsetTransactionID in class OITransport