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 booleanIndicates whether the input stream of the StreamHandler is availableprotected LongTotal number of NARs readprotected LongTotal number of NARs writtenprotected DCNodePerformanceNode Performance objectprotected booleanIndicates whether the output stream of the StreamHandler is available -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancleanup()Deletes NARs files that have been processedReturns a node performance objectabstract longThis must return a count of how many records this node has read in, since it started.readData()Calls readNAR()abstract NARreadNAR()Retrieves a single NAR fileabstract NAR[]readNARs()Retrieves multiple NARsvoidshutdown()Performs tasks necessary to cleanly shutdown the stream handlervoidPerforms tasks necessary to cleanly shutdown the input stream of the stream handlervoidPerforms tasks necessary to cleanly shutdown the output stream of the stream handlerabstract booleanWrites a single NAR to the cache fileabstract booleanWrites a multiple NARs to the cache filebooleanwriteData(DCFieldContainer field) Calls storeNAR()booleanwriteData(DCFieldContainer[] fields) Calls storeNAR()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.nt.udc.ndk.node.DataProviderIfc
getBulkData, getCurrArchFile, getData, getData, getDataReceiver, getProcessedArchFile, isDataAvailable, removeProcessedFile, setDataReceiver, setProcessedArchFile, signalBatchCompletion, validOIMinorTypeMethods inherited from interface com.nt.udc.ndk.node.DataReceiverIfc
dataIsAvailable, getDataProvider, processData, processData, setDataProviderMethods inherited from interface com.nt.udc.ndk.node.DCStreamHandler
createNewCacheFile, moveToReadyToOut, readBulkDataMethods inherited from interface com.nt.udc.ndk.node.FileDataProviderIfc
getFileBulkData, getFileData, getFileDataReceiver, handleRejectOfFile, isEndOfFile, isFileDataAvailable, isStartOfFile, openInputFile, rejectFile, setFileDataReceiverMethods 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:
readDatain interfaceDCStreamHandler
-
readNAR
Retrieves a single NAR file -
readNARs
Retrieves multiple NARs -
writeData
Calls storeNAR()- Specified by:
writeDatain 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:
writeDatain interfaceDCStreamHandler- Returns:
true, if the data was successfully written to the object
-
getPerformanceMetrics
Returns a node performance object- Specified by:
getPerformanceMetricsin 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:
cleanupin interfaceDCStreamHandler
-
shutdown
public void shutdown()Performs tasks necessary to cleanly shutdown the stream handler- Specified by:
shutdownin interfaceDCStreamHandler
-
shutdownInput
public void shutdownInput()Performs tasks necessary to cleanly shutdown the input stream of the stream handler- Specified by:
shutdownInputin interfaceDCStreamHandler
-
shutdownOutput
public void shutdownOutput()Performs tasks necessary to cleanly shutdown the output stream of the stream handler- Specified by:
shutdownOutputin 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:
-