public interface CdrProcessor
The processing of binary CDR files is done in a sequence of steps. Some steps are repeated per each cdr file or cdr records.
CdrProcessor
is constructed, then initialized with the init
method.processingFile
method is called.processHeader
method is called.processBinaryCdr
or processStringCdr
method is called (depending on record type).processFooter
method is calledprocessedFile
method is called.CdrProcessor
is destroyed with the destroy method.
Called only if previous init
method call did NOT throw an Exception.
After that no further calls are invoked on CdrProcessor
instance.Note that any class implementing this interface must provide a public no argument constructor to be used as part of CDR processing pipeline.
Modifier and Type | Field and Description |
---|---|
static String |
CONTINUE_ON_ERROR_PROPERTY
Name of boolean property denoting if processing of other records should continue after an error.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called to indicate to a
CdrProcessor that the processor is being taken out of service. |
void |
init(Properties properties)
Called to indicate to a
CdrProcessor that the processor is being placed into service. |
boolean |
processBinaryCdr(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.BinaryCDR binaryCdr,
com.google.protobuf.Descriptors.Descriptor descriptor,
com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp,
com.google.protobuf.ExtensionRegistry extensionRegistry)
Called when encountering a binary CDR in CDR file.
|
void |
processedFile(String path)
Called after processing all data contained in file denoted by
path . |
void |
processFooter(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Footer footer,
com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
Called when encountering a
Footer in binary CDR file. |
void |
processHeader(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Header header,
com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
Called when encountering a
Header in binary CDR file. |
void |
processingFile(String path)
Called before processing any data contained in file denoted by
path . |
boolean |
processStringCdr(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.StringCDR stringCdr,
com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
Called when encountering a string CDR in CDR file.
|
static final String CONTINUE_ON_ERROR_PROPERTY
CdrPipeline
.void init(Properties properties)
CdrProcessor
that the processor is being placed into service.
This method is called exactly once after instantiating the CdrProcessor
.properties
- properties provided using "processor-property" options when invoking CdrPipeline
.void destroy()
CdrProcessor
that the processor is being taken out of service.
This method is called only once and only if previous invocation of init
did NOT throw an exception.
After call to this method no further calls are invoked on CdrProcessor
instance.void processingFile(String path)
path
.path
- path denoting the CDR file to be processed.void processedFile(String path)
path
.path
- path denoting the CDR file that was processed.void processHeader(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Header header, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
Header
in binary CDR file.header
- header data contained in CDR file.timeStamp
- timestamp when the header was written.void processFooter(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Footer footer, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
Footer
in binary CDR file.footer
- footer data contained in CDR file.timeStamp
- timestamp when the footer was written.boolean processBinaryCdr(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.BinaryCDR binaryCdr, com.google.protobuf.Descriptors.Descriptor descriptor, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp, com.google.protobuf.ExtensionRegistry extensionRegistry)
binaryCdr
- BinaryCDR
record encapsulating the bytes of CDR Message
.descriptor
- Descriptor
of the CDR Message
.timeStamp
- timestamp when the record was written.extensionRegistry
- ExtensionRegistry
to properly decode extension fields of the CDR Message
.CdrProcessor
in pipeline, false otherwise.boolean processStringCdr(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.StringCDR stringCdr, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
stringCdr
- string representing the CDR.timeStamp
- timestamp when the record was written.CdrProcessor
in pipeline, false otherwise.