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, setPollingInterval
protected 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 DataReceiverIfc
dataIsAvailable
in class OITransport
public void run()
run
in interface java.lang.Runnable
run
in class OITransport
public 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 DCTransport
shutdown
in class OITransport
public 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 DataReceiverIfc
processData
in class OITransport
record
- DCFieldContainer
containing the data.NodeProcessingException
public 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.NodeProcessingException
public boolean processFileData(DCFieldContainer dcfContainer) throws NodeProcessingException
OITransport
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 FileDataReceiverIfc
processFileData
in class OITransport
dcfContainer
- DCFieldContainer
object containing
the data.true
, if data is processed successfullyNodeProcessingException
public boolean processFileData(DCFieldContainer[] records) throws NodeProcessingException
OITransport
processFileData
in interface FileDataReceiverIfc
processFileData
in class OITransport
true
, if data is processed successfullyNodeProcessingException
public boolean processRejectFile()
OITransport
processRejectFile
in interface FileDataReceiverIfc
processRejectFile
in class OITransport
true
, if processed successfullypublic boolean processStartOfFileData(java.lang.String originalFileName)
OITransport
processStartOfFileData
in interface FileDataReceiverIfc
processStartOfFileData
in class OITransport
true
, if data is availablepublic boolean processEndOfFileData(java.lang.String transactionID)
OITransport
processEndOfFileData
in interface FileDataReceiverIfc
processEndOfFileData
in class OITransport
true
, if processed successfullypublic boolean isHealthy()
isHealthy
in interface DCTransport
isHealthy
in class OITransport
public void setTransactionID(java.lang.String tID)
setTransactionID
in interface FileDataReceiverIfc
setTransactionID
in class OITransport