Interface CdrProcessor
-
- All Known Implementing Classes:
AbstractTypedCdrProcessor
,CdrProcessorAdapter
,GenerateStatsCdrProcessor
public interface CdrProcessor
The interface for binary CDR files processing.The processing of binary CDR files is done in a sequence of steps. Some steps are repeated per each cdr file or cdr records.
- The
CdrProcessor
is constructed, then initialized with theinit
method. - For each CDR file processed:
- The
processingFile
method is called. - If header is present in CDR file
processHeader
method is called. - For each record present in CDR file
processBinaryCdr
orprocessStringCdr
method is called (depending on record type). - If footer is present in CDR file
processFooter
method is called - After all content of CDR file is processed the
processedFile
method is called.
- The
- The
CdrProcessor
is destroyed with the destroy method. Called only if previousinit
method call did NOT throw an Exception. After that no further calls are invoked onCdrProcessor
instance.
Note that any class implementing this interface must provide a public no argument constructor to be used as part of CDR processing pipeline.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTINUE_ON_ERROR_PROPERTY
Name of boolean property denoting if processing of other records should continue after an error.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
Called to indicate to aCdrProcessor
that the processor is being taken out of service.void
init(Properties properties)
Called to indicate to aCdrProcessor
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 bypath
.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 aFooter
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 aHeader
in binary CDR file.void
processingFile(String path)
Called before processing any data contained in file denoted bypath
.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.
-
-
-
Field Detail
-
CONTINUE_ON_ERROR_PROPERTY
static final String CONTINUE_ON_ERROR_PROPERTY
Name of boolean property denoting if processing of other records should continue after an error. Set to true when "ignore-error" option was used when invokingCdrPipeline
.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(Properties properties)
Called to indicate to aCdrProcessor
that the processor is being placed into service. This method is called exactly once after instantiating theCdrProcessor
.- Parameters:
properties
- properties provided using "processor-property" options when invokingCdrPipeline
.
-
destroy
void destroy()
Called to indicate to aCdrProcessor
that the processor is being taken out of service. This method is called only once and only if previous invocation ofinit
did NOT throw an exception. After call to this method no further calls are invoked onCdrProcessor
instance.
-
processingFile
void processingFile(String path)
Called before processing any data contained in file denoted bypath
.- Parameters:
path
- path denoting the CDR file to be processed.
-
processedFile
void processedFile(String path)
Called after processing all data contained in file denoted bypath
.- Parameters:
path
- path denoting the CDR file that was processed.
-
processHeader
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 aHeader
in binary CDR file.- Parameters:
header
- header data contained in CDR file.timeStamp
- timestamp when the header was written.
-
processFooter
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 aFooter
in binary CDR file.- Parameters:
footer
- footer data contained in CDR file.timeStamp
- timestamp when the footer was written.
-
processBinaryCdr
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.- Parameters:
binaryCdr
-BinaryCDR
record encapsulating the bytes of CDRMessage
.descriptor
-Descriptor
of the CDRMessage
.timeStamp
- timestamp when the record was written.extensionRegistry
-ExtensionRegistry
to properly decode extension fields of the CDRMessage
.- Returns:
- true if record should be processed by next
CdrProcessor
in pipeline, false otherwise.
-
processStringCdr
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.- Parameters:
stringCdr
- string representing the CDR.timeStamp
- timestamp when the record was written.- Returns:
- true if record should be processed by next
CdrProcessor
in pipeline, false otherwise.
-
-