Class IPDROIFormatter

java.lang.Object
com.nt.udc.ndk.node.OIFileFormatter
com.nt.udc.oi.node.ipdr.IPDROIFormatter
All Implemented Interfaces:
StateBufferSaveable
Direct Known Subclasses:
IPDROISimpleFormatter, IPDROITableFormatter

public abstract class IPDROIFormatter extends OIFileFormatter implements StateBufferSaveable
This class is responsible for properly formatting the output files of the IPDR OI node. For each output file created, the initial entry into the file will be a header line detailing the fields contained in the following lines.
Since:
JDK1.2.2
  • Field Details

    • m_timestampFormatter

      protected TimestampUtil m_timestampFormatter
    • m_recCount

      protected int m_recCount
    • m_docAttributes

      protected String m_docAttributes
    • m_docInfo

      protected String m_docInfo
    • m_recInfo

      protected String m_recInfo
    • m_docVersion

      protected String m_docVersion
    • m_recID

      protected String m_recID
    • m_docSeqNumber

      protected int m_docSeqNumber
    • m_useIPDRDocAttributes

      protected boolean m_useIPDRDocAttributes
    • m_useIPDRDocSequenceNumber

      protected boolean m_useIPDRDocSequenceNumber
    • m_useIPDRDocVersionNumber

      protected boolean m_useIPDRDocVersionNumber
    • m_useIPDRDocStartTime

      protected boolean m_useIPDRDocStartTime
    • m_useIPDRDocInfo

      protected boolean m_useIPDRDocInfo
    • m_useUseIPDRDocEnd

      protected boolean m_useUseIPDRDocEnd
    • m_useUseIPDRDocEndCount

      protected boolean m_useUseIPDRDocEndCount
    • m_useUseIPDRDocEndEndTime

      protected boolean m_useUseIPDRDocEndEndTime
    • m_useIPDRRecID

      protected boolean m_useIPDRRecID
    • m_useIPDRRecStartTime

      protected boolean m_useIPDRRecStartTime
    • m_useIPDRRecInfo

      protected boolean m_useIPDRRecInfo
  • Constructor Details

    • IPDROIFormatter

      public IPDROIFormatter(LoggerIfc logr, OIFileWriter oiFileWriter)
      Constructor
      Parameters:
      logr - LoggerIfc() object providing access to the node's log file
      oiFileWriter - OIFileWriter() object responsible for file output and managing the output files.
  • Method Details

    • setDocumentAttributes

      public void setDocumentAttributes(String attrs)
      Sets the additional attributes.
      Parameters:
      attrs - Contains the additional attributes (e.g. location of schema documents.
    • setDocumentInfo

      public void setDocumentInfo(String info)
      Sets the description infomation for the IPDRDoc element.
      Parameters:
      info - Contains the description information.
    • setDocumentVersion

      public void setDocumentVersion(String version)
      Sets the version number for the IPDRDoc element..
      Parameters:
      version - Indicates the version of the Master IPDRDoc Schema being used.
    • setRecordInfo

      public void setRecordInfo(String info)
      Sets the description infomation for the IPDRRec element.
      Parameters:
      info - Contains the description information.
    • setRecordID

      public void setRecordID(String id)
      Sets the unique identifier for the IPDRRec element.
      Parameters:
      id - Contains the unique identifier.
    • setUseIPDRDocAttributes

      public void setUseIPDRDocAttributes(boolean flag)
      Sets the usage of additional attributes for IPDRDoc element.
      Parameters:
      flag - Set to true to activate the generation of additional attributes for IPDRDoc element.
    • setUseIPDRDocSequenceNumber

      public void setUseIPDRDocSequenceNumber(boolean flag)
      Sets the usage of sequence number for IPDRDoc element.
      Parameters:
      flag - Set to true to activate the generation of sequence number for IPDRDoc element.
    • setUseIPDRDocVersionNumber

      public void setUseIPDRDocVersionNumber(boolean flag)
      Sets the usage of version number for IPDRDoc element.
      Parameters:
      flag - Set to true to activate the generation of version number for IPDRDoc element.
    • setUseIPDRDocStartTime

      public void setUseIPDRDocStartTime(boolean flag)
      Sets the usage of start time for IPDRDoc element.
      Parameters:
      flag - Set to true to activate the generation of start time for IPDRDoc element.
    • setUseIPDRDocInfo

      public void setUseIPDRDocInfo(boolean flag)
      Sets the usage of description infomation for IPDRDoc element.
      Parameters:
      flag - Set to true to activate the generation of description infomation for IPDRDoc element.
    • setUseIPDRDocEnd

      public void setUseIPDRDocEnd(boolean flag)
      Sets the usage of end marker (IPDRDoc.End) for the document.
      Parameters:
      flag - Set to true to activate the generation of end marker for document.
    • setUseIPDRDocEndCount

      public void setUseIPDRDocEndCount(boolean flag)
      Sets the usage of count for the end marker (IPDRDoc.End).
      Parameters:
      flag - Set to true to activate the generation of count for end marker.
    • setUseIPDRDocEndEndTime

      public void setUseIPDRDocEndEndTime(boolean flag)
      Sets the usage of end time for the end marker (IPDRDoc.End).
      Parameters:
      flag - Set to true to activate the generation of end time for end marker.
    • setUseIPDRRecID

      public void setUseIPDRRecID(boolean flag)
      Sets the usage of unique identifier for IPDRRec element.
      Parameters:
      flag - Set to true to activate the generation of unique identifier for IPDRRec element.
    • setUseIPDRRecStartTime

      public void setUseIPDRRecStartTime(boolean flag)
      Sets the usage of start time for IPDRRec element.
      Parameters:
      flag - Set to true to activate the generation of start time for IPDRRec element.
    • setUseIPDRRecInfo

      public void setUseIPDRRecInfo(boolean flag)
      Sets the usage of description infomation for IPDRRec element.
      Parameters:
      flag - Set to true to activate the generation of description infomation for IPDRRec element.
    • setTimestampFormatter

      public void setTimestampFormatter(int type)
      Sets the type of timestamp for the timestamp formatter.
      Parameters:
      type - Contains the type of timestamp. 0 - Z timestamp type 1 - UTC timestamp type
    • writeToFile

      public void writeToFile(DCFieldContainer record) throws IOException
      This method will write the appropriately formatted data contained within the DCFieldContainer to the output file. When necessary, a file header line will also be written.
      Specified by:
      writeToFile in class OIFileFormatter
      Throws:
      IOException
    • fileOpening

      public void fileOpening(DCFieldContainer rec)
      This is a callback from the base-class. The call is made right after opening an output file. Here it is used to write out a header.
      Overrides:
      fileOpening in class OIFileFormatter
    • fileClosing

      public void fileClosing(DCFieldContainer rec)
      This is a callback from the base-class. The call is made just before closing an output file. Here it is used to write out a trailer.
      Overrides:
      fileClosing in class OIFileFormatter
    • getRecordString

      protected abstract String getRecordString(DCFieldContainer record)
    • getTimestamp

      protected final String getTimestamp()
    • saveState

      public void saveState(StateBuffer buffer)
      This function is used to store state (recovery) information into a buffer managed by the caller.

      Context information saved:

      • current record sequence number

      Specified by:
      saveState in interface StateBufferSaveable
      Parameters:
      buffer - Buffer used to store recovery information
    • restoreState

      public void restoreState(StateBuffer buffer) throws StateException
      This function is used to restore the writer's state based on information read from a StateBuffer.
      Specified by:
      restoreState in interface StateBufferSaveable
      Parameters:
      buffer - Buffer to read recovery information from
      Throws:
      StateException