Class StreamSourceFileMgr

java.lang.Object
com.nt.udc.node.util.StreamSourceFileMgr
All Implemented Interfaces:
IStreamSource

public class StreamSourceFileMgr extends Object implements 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 Details

    • m_debugLevel

      protected static int m_debugLevel
    • m_iLogger

      protected LoggerIfc m_iLogger
      This member is used for reporting errors and warnings.
    • m_fileMgr

      protected CFileMgr m_fileMgr
      This member is used to manage files to be processed
    • m_crtFile

      protected CManagedFile m_crtFile
      This member represents the file currently being processed.
    • m_reporter

      protected COSARReporter 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 files
      scratchDir - - scratch directory
      filter - - identifies files to return
      iLogger - - object to handle errors and warnings
      Throws:
      Exception
  • Method Details

    • getDebugLevel

      public static int getDebugLevel()
    • COSARReporter

      public COSARReporter COSARReporter()
    • setDebugLevel

      public static void setDebugLevel(int debugLevel)
    • setReporter

      public void setReporter(COSARReporter reporter)
    • setDoneFilePrefix

      public void setDoneFilePrefix(String prefix)
    • setDoneFileSuffix

      public void setDoneFileSuffix(String suffix)
    • setDeleteProcessedFiles

      public void setDeleteProcessedFiles(boolean doDelete)
    • getSourceName

      public String getSourceName()
      Specified by:
      getSourceName in interface IStreamSource
      Returns:
      The current filename
    • hasMoreData

      public boolean hasMoreData()
      Specified by:
      hasMoreData in interface IStreamSource
      Returns:
      true if there are more any files to process.
    • nextStream

      public InputStream nextStream()
      Specified by:
      nextStream in interface IStreamSource
    • getRecoveryFile

      public File getRecoveryFile()
      Specified by:
      getRecoveryFile in interface IStreamSource
    • initialize

      public boolean initialize()
      This function is used to initialize the data source.
      Specified by:
      initialize in interface IStreamSource
    • terminate

      public boolean terminate()
      This function is used to terminate the data source.
      Specified by:
      terminate in interface IStreamSource
    • start

      public boolean start()
      Function called to start reading
      Specified by:
      start in interface IStreamSource
      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 interface IStreamSource
      Returns:
      true if successful, false otherwise
    • cleanupCrtFile

      public boolean cleanupCrtFile()
      Returns:
      true if successful, false otherwise
    • initFileMgr

      protected boolean initFileMgr(String inputDir, String scratchDir, FilenameFilter filter)
      This function initializes the file manager. To be overridden if necessary.
      Returns:
      true if successful, false otherwise
    • checkDir

      protected boolean checkDir(String dir)
    • debug

      protected void debug(String fName, String msg)