public abstract class EITransport extends java.lang.Object implements DCTransport, DataProviderIfc, FileDataProviderIfc
| Modifier and Type | Field and Description |
|---|---|
protected DataReceiverIfc |
dataReceiver
Reference to the DataReceiver of the transport.
|
boolean |
fdChecked |
protected FileDataReceiverIfc |
filedataReceiver
Reference to the FileDataReceiver of the transport.
|
FileEIDuplicateCheck |
fileduplicateCheck |
protected java.io.File |
fileToProcess |
protected InputStatisticsMonitorIfc |
inputCount
Input record count object.
|
java.io.File |
lockFile |
protected boolean |
movedFile |
protected DCNode |
node
Reference to the
EINode to which the transport is
associated. |
protected long |
pollingInterval
Time interval at which the node will check for data.
|
protected boolean |
processing |
protected boolean |
processingData |
protected boolean |
running
Indicates whether the transport is running.
|
| Constructor and Description |
|---|
EITransport() |
| Modifier and Type | Method and Description |
|---|---|
abstract DCFieldContainer[] |
getBulkData()
This method is used by the DataReceiver to fetch a set of
DCFieldContainer objects.
|
java.io.File |
getCurrArchFile()
Allows a DataReceiver to obtain the currently processing .arch file
|
abstract DCFieldContainer |
getData()
This method is used by the DataReceiver to fetch a single
|
DCFieldContainer |
getData(java.lang.String batch)
Allows a DataReceiver to obtain the available data in a
known format.
|
DataReceiverIfc |
getDataReceiver()
Gets the object that is retrieving data from this DataProvider
|
FileEIDuplicateCheck |
getDubCheckObj() |
boolean |
getDupCheckFlag() |
DCFieldContainer[] |
getFileBulkData()
This method is used by the FileDataReceiver to fetch a set of
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
DCFieldContainer |
getFileData()
This method is used by the FileDataReceiver to fetch a single
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
FileDataReceiverIfc |
getFileDataReceiver()
Gets the object that is retrieving data from this FileDataProvider
|
static java.util.List<java.io.File> |
getFileList(java.io.File dir,
java.nio.file.DirectoryStream.Filter<java.nio.file.Path> filter) |
boolean |
getMovedFileStatus() |
DCNode |
getNode()
Returns the
EINode containing this transport. |
long |
getPollingInterval()
Returns the time interval between polls for available data.
|
java.lang.String |
getProcessedArchFile()
Allows a DataReceiver to obtain the last processed .arch file
|
void |
handleRejectOfFile()
To handle the remaining input files when there is reject of a file
|
protected void |
incrementIn() |
protected void |
incrementIn(int count) |
abstract boolean |
isDataAvailable()
This method is used by the DataReceiver to ask this provider if
data is available.
|
boolean |
isEndOfFile()
Determines if record received is an End of file indication
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
isFileDataAvailable()
This method is used by the FileDataReceiver to ask this provider if
data is available.
|
boolean |
isHealthy()
This method is used to check the transport's state of health.
|
boolean |
isProcessing() |
boolean |
isProcessingData() |
boolean |
isStartOfFile()
Determines if the record received is start of file indication
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
void |
moveCurrentFileToBackUp(java.io.File currentFile,
java.lang.String newFilename) |
java.lang.String |
openInputFile()
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
boolean |
rejectFile()
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method
and implement correct behavior.
|
void |
removeProcessedFile(java.io.File currArchFile)
Allows a DataReceiver to remove .arch file once processed
currArchFile - processed .arch file
|
abstract void |
run()
This method is used to control processing for fetching data from
the EI's source.
|
protected void |
setCountsSuspect()
Set a flag to indicate to the Record Statistics feature that there is
something not trusted in the input counts.
|
void |
setDataReceiver(DataReceiverIfc receiver)
Sets the object to which this DataProvider will send
its data.
|
void |
setFileDataReceiver(FileDataReceiverIfc receiver)
Sets the object to which this FileDataProvider will send
its data.
|
void |
setFileToProcess(java.io.File filetoProcess) |
void |
setMovedFileStatus(boolean fileMoved) |
void |
setNode(DCNode einode)
Sets the node within which this
EITransport is contained. |
void |
setPollingInterval(long interval)
Sets the time interval between polls for available data.
|
void |
setProcessedArchFile(java.lang.String file)
Sets the processed .arch file absolute path
|
void |
setProcessing(boolean isProcessing) |
abstract void |
shutdown()
This method is used to provide a means of shutting down the transport
in an orderly fashion.
|
void |
signalBatchCompletion(java.lang.String batch)
Allows a DataReceiver to know that the nars under the specified batch are
completed and handed over to the Data receiver
|
boolean |
validOIMinorType()
Allows a DataReceiver to check if Minor Type supported for disaster
recovery
|
protected DCNode node
EINode to which the transport is
associated.protected DataReceiverIfc dataReceiver
protected FileDataReceiverIfc filedataReceiver
protected boolean running
protected boolean processing
protected boolean movedFile
protected long pollingInterval
protected InputStatisticsMonitorIfc inputCount
protected boolean processingData
protected java.io.File fileToProcess
public java.io.File lockFile
public boolean fdChecked
public FileEIDuplicateCheck fileduplicateCheck
public void setDataReceiver(DataReceiverIfc receiver)
setDataReceiver in interface DataProviderIfcreceiver - Object which needs data sent to it.public void setFileDataReceiver(FileDataReceiverIfc receiver)
setFileDataReceiver in interface FileDataProviderIfcreceiver - Object which needs data sent to it.public DataReceiverIfc getDataReceiver()
DataProviderIfcgetDataReceiver in interface DataProviderIfcpublic FileDataReceiverIfc getFileDataReceiver()
FileDataProviderIfcgetFileDataReceiver in interface FileDataProviderIfcpublic abstract boolean isDataAvailable()
isDataAvailable in interface DataProviderIfctrue, if data is availablepublic boolean isFileDataAvailable()
isFileDataAvailable in interface FileDataProviderIfctrue, if data is availablepublic abstract DCFieldContainer getData()
getData in interface DataProviderIfcpublic DCFieldContainer getData(java.lang.String batch)
DataProviderIfcgetData in interface DataProviderIfcpublic void signalBatchCompletion(java.lang.String batch)
DataProviderIfcsignalBatchCompletion in interface DataProviderIfcpublic void removeProcessedFile(java.io.File currArchFile)
DataProviderIfcremoveProcessedFile in interface DataProviderIfcpublic java.io.File getCurrArchFile()
DataProviderIfcgetCurrArchFile in interface DataProviderIfcpublic java.lang.String getProcessedArchFile()
DataProviderIfcgetProcessedArchFile in interface DataProviderIfcpublic boolean validOIMinorType()
DataProviderIfcvalidOIMinorType in interface DataProviderIfcpublic void setProcessedArchFile(java.lang.String file)
DataProviderIfcsetProcessedArchFile in interface DataProviderIfcfile - absolute path of processed .arch filepublic DCFieldContainer getFileData()
getFileData in interface FileDataProviderIfcpublic boolean isEndOfFile()
isEndOfFile in interface FileDataProviderIfctrue, if data is availablepublic boolean isStartOfFile()
isStartOfFile in interface FileDataProviderIfcpublic abstract DCFieldContainer[] getBulkData()
getBulkData in interface DataProviderIfcpublic DCFieldContainer[] getFileBulkData()
getFileBulkData in interface FileDataProviderIfcpublic abstract void run()
run in interface java.lang.Runnablepublic abstract void shutdown()
shutdown in interface DCTransportpublic void setNode(DCNode einode)
EITransport is contained.einode - The EINode which contains this transport.public DCNode getNode()
EINode containing this transport.EINode of this transport.public void setPollingInterval(long interval)
interval - Number of milliseconds to wait.public long getPollingInterval()
public boolean isHealthy()
isHealthy in interface DCTransportprotected void incrementIn()
protected void incrementIn(int count)
protected void setCountsSuspect()
public boolean isProcessingData()
public void setFileToProcess(java.io.File filetoProcess)
public boolean isProcessing()
public void setProcessing(boolean isProcessing)
public boolean getMovedFileStatus()
public void setMovedFileStatus(boolean fileMoved)
public java.lang.String openInputFile()
throws java.lang.Exception
openInputFile in interface FileDataProviderIfcjava.lang.Exceptionpublic boolean rejectFile()
throws java.lang.Exception
rejectFile in interface FileDataProviderIfc true for successful rejection of input filejava.lang.Exceptionpublic void handleRejectOfFile()
FileDataProviderIfchandleRejectOfFile in interface FileDataProviderIfcpublic boolean getDupCheckFlag()
public FileEIDuplicateCheck getDubCheckObj()
public static java.util.List<java.io.File> getFileList(java.io.File dir,
java.nio.file.DirectoryStream.Filter<java.nio.file.Path> filter)
throws java.lang.Exception
java.lang.Exceptionpublic void moveCurrentFileToBackUp(java.io.File currentFile,
java.lang.String newFilename)
throws java.io.IOException
java.io.IOException