Interface CdrProcessor
-
- All Known Implementing Classes:
AbstractTypedCdrProcessor,CdrProcessorAdapter,GenerateStatsCdrProcessor
public interface CdrProcessorThe 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
CdrProcessoris constructed, then initialized with theinitmethod. - For each CDR file processed:
- The
processingFilemethod is called. - If header is present in CDR file
processHeadermethod is called. - For each record present in CDR file
processBinaryCdrorprocessStringCdrmethod is called (depending on record type). - If footer is present in CDR file
processFootermethod is called - After all content of CDR file is processed the
processedFilemethod is called.
- The
- The
CdrProcessoris destroyed with the destroy method. Called only if previousinitmethod call did NOT throw an Exception. After that no further calls are invoked onCdrProcessorinstance.
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 StringCONTINUE_ON_ERROR_PROPERTYName 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 voiddestroy()Called to indicate to aCdrProcessorthat the processor is being taken out of service.voidinit(Properties properties)Called to indicate to aCdrProcessorthat the processor is being placed into service.booleanprocessBinaryCdr(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.voidprocessedFile(String path)Called after processing all data contained in file denoted bypath.voidprocessFooter(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Footer footer, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)Called when encountering aFooterin binary CDR file.voidprocessHeader(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Header header, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)Called when encountering aHeaderin binary CDR file.voidprocessingFile(String path)Called before processing any data contained in file denoted bypath.booleanprocessStringCdr(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 aCdrProcessorthat 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 aCdrProcessorthat the processor is being taken out of service. This method is called only once and only if previous invocation ofinitdid NOT throw an exception. After call to this method no further calls are invoked onCdrProcessorinstance.
-
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 aHeaderin 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 aFooterin 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-BinaryCDRrecord encapsulating the bytes of CDRMessage.descriptor-Descriptorof the CDRMessage.timeStamp- timestamp when the record was written.extensionRegistry-ExtensionRegistryto properly decode extension fields of the CDRMessage.- Returns:
- true if record should be processed by next
CdrProcessorin 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
CdrProcessorin pipeline, false otherwise.
-
-