Class MXNarReader

java.lang.Object
com.metasolv.nm.processor.MXAggregator.MXNarReader
All Implemented Interfaces:
Callback, StateBufferSaveable

public class MXNarReader extends Object implements StateBufferSaveable, Callback
  • Field Details

    • InputFileProp

      public static final String InputFileProp
    • NAROffsetProp

      public static final String NAROffsetProp
    • NARsInFileProp

      public static final String NARsInFileProp
  • Constructor Details

  • Method Details

    • shutdown

      public void shutdown()
      Tells the NarReader it is time to shut down. Don't forget to remember which file and which offset we were working on...
    • readNAR

      public NAR readNAR()
      Returns the next NAR. Will automatically go to the next file if necessary.
      Returns:
    • readNARs

      public NAR[] readNARs()
    • removeInputFile

      public boolean removeInputFile(File removeFile)
    • deleteOrRemoveFiles

      protected boolean deleteOrRemoveFiles()
      This implmentation is not thread-safe.
      Parameters:
      removeFile -
      Returns:
    • callback

      public void callback()
      This callback is made when the NarReader's call to saveState() has successfully saved the state of the system to disk. This method can then clean up the input files.
      Specified by:
      callback in interface Callback
    • saveState

      public void saveState(StateBuffer buffer)
      Saves the state of the NarReader to a buffer.
      Specified by:
      saveState in interface StateBufferSaveable
      Parameters:
      buffer - Buffer containing state data
    • restoreState

      public void restoreState(StateBuffer buffer) throws StateException
      Restores the runtime state of the Reader from a StateBuffer.
      Specified by:
      restoreState in interface StateBufferSaveable
      Parameters:
      buffer - Buffer, holding the Reader data
      Throws:
      StateException
    • checkInput

      public boolean checkInput()
      This method checks for an empty input directory.
      Returns:
      true, if directory contains files
    • isDataAvailable

      public boolean isDataAvailable()
      Returns whether there are more records available for processing.
      Returns:
      true, if data is available