Package com.nt.udc.ndk.node
Class EITransport
java.lang.Object
com.nt.udc.ndk.node.EITransport
- All Implemented Interfaces:
DataProviderIfc,DCTransport,FileDataProviderIfc,Runnable
- Direct Known Subclasses:
FileEITransport,FileEITransport,FtpEITransport,GenericUdpEITransport,IPDRTransport,JDBCEITransport,OpenFileEITransport,SoapXmlEITransport,Sol42EITransport,TcpEITransport,UdpEITransport,XMLTransport
public abstract class EITransport
extends Object
implements DCTransport, DataProviderIfc, FileDataProviderIfc
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataReceiverIfcReference to the DataReceiver of the transport.booleanprotected FileDataReceiverIfcReference to the FileDataReceiver of the transport.protected Fileprotected InputStatisticsMonitorIfcInput record count object.protected booleanprotected DCNodeReference to theEINodeto which the transport is associated.protected longTime interval at which the node will check for data.protected booleanprotected booleanprotected booleanIndicates whether the transport is running. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DCFieldContainer[]This method is used by the DataReceiver to fetch a set of DCFieldContainer objects.Allows a DataReceiver to obtain the currently processing .arch fileabstract DCFieldContainergetData()This method is used by the DataReceiver to fetch a singleAllows a DataReceiver to obtain the available data in a known format.Gets the object that is retrieving data from this DataProviderbooleanThis 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.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.Gets the object that is retrieving data from this FileDataProvidergetFileList(File dir, DirectoryStream.Filter<Path> filter) booleangetNode()Returns theEINodecontaining this transport.longReturns the time interval between polls for available data.Allows a DataReceiver to obtain the last processed .arch filevoidTo handle the remaining input files when there is reject of a fileprotected voidprotected voidincrementIn(int count) abstract booleanThis method is used by the DataReceiver to ask this provider if data is available.booleanDetermines 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.booleanThis method is used by the FileDataReceiver to ask this provider if data is available.booleanThis method is used to check the transport's state of health.booleanbooleanbooleanDetermines 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.voidmoveCurrentFileToBackUp(File currentFile, String newFilename) This is just a dummy implementation, any transport needing the file level transaction behavior should override this method and implement correct behavior.booleanThis is just a dummy implementation, any transport needing the file level transaction behavior should override this method and implement correct behavior.voidremoveProcessedFile(File currArchFile) Allows a DataReceiver to remove .arch file once processed currArchFile - processed .arch fileabstract voidrun()This method is used to control processing for fetching data from the EI's source.protected voidSet a flag to indicate to the Record Statistics feature that there is something not trusted in the input counts.voidsetDataReceiver(DataReceiverIfc receiver) Sets the object to which this DataProvider will send its data.voidsetFileDataReceiver(FileDataReceiverIfc receiver) Sets the object to which this FileDataProvider will send its data.voidsetFileToProcess(File filetoProcess) voidsetMovedFileStatus(boolean fileMoved) voidSets the node within which thisEITransportis contained.voidsetPollingInterval(long interval) Sets the time interval between polls for available data.voidsetProcessedArchFile(String file) Sets the processed .arch file absolute pathvoidsetProcessing(boolean isProcessing) abstract voidshutdown()This method is used to provide a means of shutting down the transport in an orderly fashion.voidsignalBatchCompletion(String batch) Allows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiverbooleanAllows a DataReceiver to check if Minor Type supported for disaster recovery
-
Field Details
-
node
Reference to theEINodeto which the transport is associated. -
dataReceiver
Reference to the DataReceiver of the transport. -
filedataReceiver
Reference to the FileDataReceiver of the transport. -
running
protected boolean runningIndicates whether the transport is running. -
processing
protected boolean processing -
movedFile
protected boolean movedFile -
pollingInterval
protected long pollingIntervalTime interval at which the node will check for data. Default is 20 seconds. -
inputCount
Input record count object. Although initialized to a do-nothing object, subclasses should set its value to the result of the call DCNode.getInputStatsProcessor(). this.setNode() will also set this object. -
processingData
protected boolean processingData -
fileToProcess
-
lockFile
-
fdChecked
public boolean fdChecked -
fileduplicateCheck
-
-
Constructor Details
-
EITransport
public EITransport()
-
-
Method Details
-
setDataReceiver
Sets the object to which this DataProvider will send its data.- Specified by:
setDataReceiverin interfaceDataProviderIfc- Parameters:
receiver- Object which needs data sent to it.
-
setFileDataReceiver
Sets the object to which this FileDataProvider will send its data.- Specified by:
setFileDataReceiverin interfaceFileDataProviderIfc- Parameters:
receiver- Object which needs data sent to it.
-
getDataReceiver
Description copied from interface:DataProviderIfcGets the object that is retrieving data from this DataProvider- Specified by:
getDataReceiverin interfaceDataProviderIfc- Returns:
- Returns the object to which this DataProvider will send data.
-
getFileDataReceiver
Description copied from interface:FileDataProviderIfcGets the object that is retrieving data from this FileDataProvider- Specified by:
getFileDataReceiverin interfaceFileDataProviderIfc- Returns:
- Returns the object to which this DataProvider will send data.
-
isDataAvailable
public abstract boolean isDataAvailable()This method is used by the DataReceiver to ask this provider if data is available.- Specified by:
isDataAvailablein interfaceDataProviderIfc- Returns:
true, if data is available
-
isFileDataAvailable
public boolean isFileDataAvailable()This method is used by the FileDataReceiver to ask this provider if data is available. This is just a dummy implementation, any transport needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
isFileDataAvailablein interfaceFileDataProviderIfc- Returns:
true, if data is available
-
getData
This method is used by the DataReceiver to fetch a single- Specified by:
getDatain interfaceDataProviderIfc- Returns:
- DCFieldContainer.
-
getData
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the available data in a known format. batch - The nars read will be grouped under the specified batch- Specified by:
getDatain interfaceDataProviderIfc- Returns:
- DCFieldContainer object containing the data that is available for processing
-
signalBatchCompletion
Description copied from interface:DataProviderIfcAllows a DataReceiver to know that the nars under the specified batch are completed and handed over to the Data receiver- Specified by:
signalBatchCompletionin interfaceDataProviderIfc
-
removeProcessedFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to remove .arch file once processed currArchFile - processed .arch file- Specified by:
removeProcessedFilein interfaceDataProviderIfc
-
getCurrArchFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the currently processing .arch file- Specified by:
getCurrArchFilein interfaceDataProviderIfc- Returns:
- currently processing .arch file
-
getProcessedArchFile
Description copied from interface:DataProviderIfcAllows a DataReceiver to obtain the last processed .arch file- Specified by:
getProcessedArchFilein interfaceDataProviderIfc- Returns:
- currently processing .arch file absolute path
-
validOIMinorType
public boolean validOIMinorType()Description copied from interface:DataProviderIfcAllows a DataReceiver to check if Minor Type supported for disaster recovery- Specified by:
validOIMinorTypein interfaceDataProviderIfc- Returns:
- true if valid
-
setProcessedArchFile
Description copied from interface:DataProviderIfcSets the processed .arch file absolute path- Specified by:
setProcessedArchFilein interfaceDataProviderIfc- Parameters:
file- absolute path of processed .arch file
-
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.- Specified by:
getFileDatain interfaceFileDataProviderIfc- Returns:
- DCFieldContainer.
-
isEndOfFile
public 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.- Specified by:
isEndOfFilein interfaceFileDataProviderIfc- Returns:
true, if data is available
-
isStartOfFile
public 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.- Specified by:
isStartOfFilein interfaceFileDataProviderIfc- Returns:
-
getBulkData
This method is used by the DataReceiver to fetch a set of DCFieldContainer objects.- Specified by:
getBulkDatain interfaceDataProviderIfc- Returns:
- DCFieldContainer object array, containing the data that is for processing
-
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.- Specified by:
getFileBulkDatain interfaceFileDataProviderIfc- Returns:
- DCFieldContainer objects.
-
run
public abstract void run()This method is used to control processing for fetching data from the EI's source. -
shutdown
public abstract void shutdown()This method is used to provide a means of shutting down the transport in an orderly fashion.- Specified by:
shutdownin interfaceDCTransport
-
setNode
Sets the node within which thisEITransportis contained.- Parameters:
einode- TheEINodewhich contains this transport.
-
getNode
Returns theEINodecontaining this transport.- Returns:
- Returns the
EINodeof 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:
isHealthyin interfaceDCTransport- Returns:
- true if the transport is healthy, false otherwise
-
incrementIn
protected void incrementIn() -
incrementIn
protected void incrementIn(int count) -
setCountsSuspect
protected void setCountsSuspect()Set a flag to indicate to the Record Statistics feature that there is something not trusted in the input counts. Usual example is if the file parser chokes on a record in the middle of a file. -
isProcessingData
public boolean isProcessingData() -
setFileToProcess
-
isProcessing
public boolean isProcessing() -
setProcessing
public void setProcessing(boolean isProcessing) -
getMovedFileStatus
public boolean getMovedFileStatus() -
setMovedFileStatus
public void setMovedFileStatus(boolean fileMoved) -
openInputFile
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method and implement correct behavior.- Specified by:
openInputFilein interfaceFileDataProviderIfc- Returns:
- Throws:
Exception
-
rejectFile
This is just a dummy implementation, any transport needing the file level transaction behavior should override this method and implement correct behavior. Indicates data provider to stop reading from the input file and reject it- Specified by:
rejectFilein interfaceFileDataProviderIfc- Returns:
truefor successful rejection of input file- Throws:
Exception
-
handleRejectOfFile
public void handleRejectOfFile()Description copied from interface:FileDataProviderIfcTo handle the remaining input files when there is reject of a file- Specified by:
handleRejectOfFilein interfaceFileDataProviderIfc
-
getDupCheckFlag
public boolean getDupCheckFlag() -
getDubCheckObj
-
getFileList
public static List<File> getFileList(File dir, DirectoryStream.Filter<Path> filter) throws Exception - Throws:
Exception
-
moveCurrentFileToBackUp
- Throws:
IOException
-