Package com.nt.udc.node.util
Class StreamSourceFileMgr
java.lang.Object
com.nt.udc.node.util.StreamSourceFileMgr
- All Implemented Interfaces:
IStreamSource
This class is used for retrieving data from files specified by
a filter, that reside in an input directory.
- Since:
- JDK1.1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CManagedFileThis member represents the file currently being processed.protected static intprotected CFileMgrThis member is used to manage files to be processedprotected LoggerIfcThis member is used for reporting errors and warnings.protected COSARReporterThis member is used to send reports to. -
Constructor Summary
ConstructorsConstructorDescriptionStreamSourceFileMgr(String inputDir, String scratchDir, FilenameFilter filter, LoggerIfc iLogger) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanprotected voidbooleanend()Function called to end reading.static intbooleanprotected booleaninitFileMgr(String inputDir, String scratchDir, FilenameFilter filter) This function initializes the file manager.booleanThis function is used to initialize the data source.static voidsetDebugLevel(int debugLevel) voidsetDeleteProcessedFiles(boolean doDelete) voidsetDoneFilePrefix(String prefix) voidsetDoneFileSuffix(String suffix) voidsetReporter(COSARReporter reporter) booleanstart()Function called to start readingbooleanThis function is used to terminate the data source.
-
Field Details
-
m_debugLevel
protected static int m_debugLevel -
m_iLogger
This member is used for reporting errors and warnings. -
m_fileMgr
This member is used to manage files to be processed -
m_crtFile
This member represents the file currently being processed. -
m_reporter
This member is used to send reports to.
-
-
Constructor Details
-
StreamSourceFileMgr
public StreamSourceFileMgr(String inputDir, String scratchDir, FilenameFilter filter, LoggerIfc iLogger) throws Exception - Parameters:
inputDir- - directory to monitor for input filesscratchDir- - scratch directoryfilter- - identifies files to returniLogger- - object to handle errors and warnings- Throws:
Exception
-
-
Method Details
-
getDebugLevel
public static int getDebugLevel() -
COSARReporter
-
setDebugLevel
public static void setDebugLevel(int debugLevel) -
setReporter
-
setDoneFilePrefix
-
setDoneFileSuffix
-
setDeleteProcessedFiles
public void setDeleteProcessedFiles(boolean doDelete) -
getSourceName
- Specified by:
getSourceNamein interfaceIStreamSource- Returns:
- The current filename
-
hasMoreData
public boolean hasMoreData()- Specified by:
hasMoreDatain interfaceIStreamSource- Returns:
- true if there are more any files to process.
-
nextStream
- Specified by:
nextStreamin interfaceIStreamSource
-
getRecoveryFile
- Specified by:
getRecoveryFilein interfaceIStreamSource
-
initialize
public boolean initialize()This function is used to initialize the data source.- Specified by:
initializein interfaceIStreamSource
-
terminate
public boolean terminate()This function is used to terminate the data source.- Specified by:
terminatein interfaceIStreamSource
-
start
public boolean start()Function called to start reading- Specified by:
startin interfaceIStreamSource- Returns:
- true if successful, false otherwise
-
end
public boolean end()Function called to end reading. cleanupCrtFile (which generates the "done"-file) is called only if the current file has been processed completely.- Specified by:
endin interfaceIStreamSource- Returns:
- true if successful, false otherwise
-
cleanupCrtFile
public boolean cleanupCrtFile()- Returns:
- true if successful, false otherwise
-
initFileMgr
This function initializes the file manager. To be overridden if necessary.- Returns:
- true if successful, false otherwise
-
checkDir
-
debug
-