Package com.nt.udc.nar
Class NARStreamHandler
java.lang.Object
com.nt.udc.nar.NARStreamHandler
- All Implemented Interfaces:
DataProviderIfc
,DataReceiverIfc
,DCStreamHandler
,FileDataProviderIfc
,FileDataReceiverIfc
- Direct Known Subclasses:
MXNARFileManager
,NARFileManager
Provides file (or more generically stream) management for the node,
such as reading and writing NARs to and from the .cache files
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Indicates whether the input stream of the StreamHandler is availableprotected Long
Total number of NARs readprotected Long
Total number of NARs writtenprotected DCNodePerformance
Node Performance objectprotected boolean
Indicates whether the output stream of the StreamHandler is available -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
cleanup()
Deletes NARs files that have been processedReturns a node performance objectabstract long
This must return a count of how many records this node has read in, since it started.readData()
Calls readNAR()abstract NAR
readNAR()
Retrieves a single NAR fileabstract NAR[]
readNARs()
Retrieves multiple NARsvoid
shutdown()
Performs tasks necessary to cleanly shutdown the stream handlervoid
Performs tasks necessary to cleanly shutdown the input stream of the stream handlervoid
Performs tasks necessary to cleanly shutdown the output stream of the stream handlerabstract boolean
Writes a single NAR to the cache fileabstract boolean
Writes a multiple NARs to the cache fileboolean
writeData
(DCFieldContainer field) Calls storeNAR()boolean
writeData
(DCFieldContainer[] fields) Calls storeNAR()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.nt.udc.ndk.node.DataProviderIfc
getBulkData, getCurrArchFile, getData, getData, getDataReceiver, getProcessedArchFile, isDataAvailable, removeProcessedFile, setDataReceiver, setProcessedArchFile, signalBatchCompletion, validOIMinorType
Methods inherited from interface com.nt.udc.ndk.node.DataReceiverIfc
dataIsAvailable, getDataProvider, processData, processData, setDataProvider
Methods inherited from interface com.nt.udc.ndk.node.DCStreamHandler
createNewCacheFile, moveToReadyToOut, readBulkData
Methods inherited from interface com.nt.udc.ndk.node.FileDataProviderIfc
getFileBulkData, getFileData, getFileDataReceiver, handleRejectOfFile, isEndOfFile, isFileDataAvailable, isStartOfFile, openInputFile, rejectFile, setFileDataReceiver
Methods inherited from interface com.nt.udc.ndk.node.FileDataReceiverIfc
fileDataIsAvailable, getFileDataProvider, processEndOfFileData, processFileData, processFileData, processRejectFile, processStartOfFileData, setFileDataProvider, setTransactionID
-
Field Details
-
inputShutdown
protected boolean inputShutdownIndicates whether the input stream of the StreamHandler is available -
outputShutdown
protected boolean outputShutdownIndicates whether the output stream of the StreamHandler is available -
narsIn
Total number of NARs read -
narsOut
Total number of NARs written -
np
Node Performance object
-
-
Constructor Details
-
NARStreamHandler
public NARStreamHandler()
-
-
Method Details
-
readData
Calls readNAR()- Specified by:
readData
in interfaceDCStreamHandler
-
readNAR
Retrieves a single NAR file -
readNARs
Retrieves multiple NARs -
writeData
Calls storeNAR()- Specified by:
writeData
in interfaceDCStreamHandler
- Parameters:
field
- Object to put the information into- Returns:
true
, if the data was successfully written to the object
-
writeData
Calls storeNAR()- Specified by:
writeData
in interfaceDCStreamHandler
- Returns:
true
, if the data was successfully written to the object
-
getPerformanceMetrics
Returns a node performance object- Specified by:
getPerformanceMetrics
in interfaceDCStreamHandler
- Returns:
- DCNodePerformance object,
-
storeNAR
Writes a single NAR to the cache file -
storeNARs
Writes a multiple NARs to the cache file -
cleanup
public abstract boolean cleanup()Deletes NARs files that have been processed- Specified by:
cleanup
in interfaceDCStreamHandler
-
shutdown
public void shutdown()Performs tasks necessary to cleanly shutdown the stream handler- Specified by:
shutdown
in interfaceDCStreamHandler
-
shutdownInput
public void shutdownInput()Performs tasks necessary to cleanly shutdown the input stream of the stream handler- Specified by:
shutdownInput
in interfaceDCStreamHandler
-
shutdownOutput
public void shutdownOutput()Performs tasks necessary to cleanly shutdown the output stream of the stream handler- Specified by:
shutdownOutput
in interfaceDCStreamHandler
-
getRealNarsIn
public abstract long getRealNarsIn()This must return a count of how many records this node has read in, since it started. The counts should be accurate, even if this node is an EI/CC. (as opposed to the narsIN counter, which won't count any input records if the node is an EI.)- Returns:
-