Package com.nt.udc.oi.node.ipdr
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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected int
protected String
protected int
protected String
protected String
protected TimestampUtil
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
Fields inherited from class com.nt.udc.ndk.node.OIFileFormatter
emptyFile, errMesg, logger, writer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This is a callback from the base-class.void
This is a callback from the base-class.protected abstract String
getRecordString
(DCFieldContainer record) protected final String
void
restoreState
(StateBuffer buffer) This function is used to restore the writer's state based on information read from a StateBuffer.void
saveState
(StateBuffer buffer) This function is used to store state (recovery) information into a buffer managed by the caller.void
setDocumentAttributes
(String attrs) Sets the additional attributes.void
setDocumentInfo
(String info) Sets the description infomation for the IPDRDoc element.void
setDocumentVersion
(String version) Sets the version number for the IPDRDoc element..void
setRecordID
(String id) Sets the unique identifier for the IPDRRec element.void
setRecordInfo
(String info) Sets the description infomation for the IPDRRec element.void
setTimestampFormatter
(int type) Sets the type of timestamp for the timestamp formatter.void
setUseIPDRDocAttributes
(boolean flag) Sets the usage of additional attributes for IPDRDoc element.void
setUseIPDRDocEnd
(boolean flag) Sets the usage of end marker (IPDRDoc.End) for the document.void
setUseIPDRDocEndCount
(boolean flag) Sets the usage of count for the end marker (IPDRDoc.End).void
setUseIPDRDocEndEndTime
(boolean flag) Sets the usage of end time for the end marker (IPDRDoc.End).void
setUseIPDRDocInfo
(boolean flag) Sets the usage of description infomation for IPDRDoc element.void
setUseIPDRDocSequenceNumber
(boolean flag) Sets the usage of sequence number for IPDRDoc element.void
setUseIPDRDocStartTime
(boolean flag) Sets the usage of start time for IPDRDoc element.void
setUseIPDRDocVersionNumber
(boolean flag) Sets the usage of version number for IPDRDoc element.void
setUseIPDRRecID
(boolean flag) Sets the usage of unique identifier for IPDRRec element.void
setUseIPDRRecInfo
(boolean flag) Sets the usage of description infomation for IPDRRec element.void
setUseIPDRRecStartTime
(boolean flag) Sets the usage of start time for IPDRRec element.void
writeToFile
(DCFieldContainer record) This method will write the appropriately formatted data contained within the DCFieldContainer to the output file.Methods inherited from class com.nt.udc.ndk.node.OIFileFormatter
getFileWriter, getFtpPusher, isHealthy, putToFile, readyToCycle, setFtpPusher, shutdown
-
Field Details
-
m_timestampFormatter
-
m_recCount
protected int m_recCount -
m_docAttributes
-
m_docInfo
-
m_recInfo
-
m_docVersion
-
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
Constructor- Parameters:
logr
- LoggerIfc() object providing access to the node's log fileoiFileWriter
- OIFileWriter() object responsible for file output and managing the output files.
-
-
Method Details
-
setDocumentAttributes
Sets the additional attributes.- Parameters:
attrs
- Contains the additional attributes (e.g. location of schema documents.
-
setDocumentInfo
Sets the description infomation for the IPDRDoc element.- Parameters:
info
- Contains the description information.
-
setDocumentVersion
Sets the version number for the IPDRDoc element..- Parameters:
version
- Indicates the version of the Master IPDRDoc Schema being used.
-
setRecordInfo
Sets the description infomation for the IPDRRec element.- Parameters:
info
- Contains the description information.
-
setRecordID
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
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 classOIFileFormatter
- Throws:
IOException
-
fileOpening
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 classOIFileFormatter
-
fileClosing
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 classOIFileFormatter
-
getRecordString
-
getTimestamp
-
saveState
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 interfaceStateBufferSaveable
- Parameters:
buffer
- Buffer used to store recovery information
-
restoreState
This function is used to restore the writer's state based on information read from a StateBuffer.- Specified by:
restoreState
in interfaceStateBufferSaveable
- Parameters:
buffer
- Buffer to read recovery information from- Throws:
StateException
-