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 CManagedFile
This member represents the file currently being processed.protected static int
protected CFileMgr
This member is used to manage files to be processedprotected LoggerIfc
This member is used for reporting errors and warnings.protected COSARReporter
This member is used to send reports to. -
Constructor Summary
ConstructorsConstructorDescriptionStreamSourceFileMgr
(String inputDir, String scratchDir, FilenameFilter filter, LoggerIfc iLogger) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
protected void
boolean
end()
Function called to end reading.static int
boolean
protected boolean
initFileMgr
(String inputDir, String scratchDir, FilenameFilter filter) This function initializes the file manager.boolean
This function is used to initialize the data source.static void
setDebugLevel
(int debugLevel) void
setDeleteProcessedFiles
(boolean doDelete) void
setDoneFilePrefix
(String prefix) void
setDoneFileSuffix
(String suffix) void
setReporter
(COSARReporter reporter) boolean
start()
Function called to start readingboolean
This 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:
getSourceName
in interfaceIStreamSource
- Returns:
- The current filename
-
hasMoreData
public boolean hasMoreData()- Specified by:
hasMoreData
in interfaceIStreamSource
- Returns:
- true if there are more any files to process.
-
nextStream
- Specified by:
nextStream
in interfaceIStreamSource
-
getRecoveryFile
- Specified by:
getRecoveryFile
in interfaceIStreamSource
-
initialize
public boolean initialize()This function is used to initialize the data source.- Specified by:
initialize
in interfaceIStreamSource
-
terminate
public boolean terminate()This function is used to terminate the data source.- Specified by:
terminate
in interfaceIStreamSource
-
start
public boolean start()Function called to start reading- Specified by:
start
in 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:
end
in 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
-