Class CdrProcessorAdapter
- java.lang.Object
-
- com.opencloud.slee.resources.cdr.process.CdrProcessorAdapter
-
- All Implemented Interfaces:
CdrProcessor
- Direct Known Subclasses:
AbstractTypedCdrProcessor,GenerateStatsCdrProcessor
public abstract class CdrProcessorAdapter extends Object implements CdrProcessor
Base class forCdrProcessorimplementations which provides implementations of all of its methods. Sub-classes may override the selected methods to capture just the events they are interested in.- Implementation details:
- The
init(Properties)method is final, override theinitialize(Properties)to customize initialization. - Implementation of
processBinaryCdrandprocessStringCdrreturn true. - Other methods implementations are empty / no-op.
-
-
Field Summary
-
Fields inherited from interface com.opencloud.slee.resources.cdr.process.CdrProcessor
CONTINUE_ON_ERROR_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description CdrProcessorAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Called to indicate to aCdrProcessorthat the processor is being taken out of service.booleangetContinueOnError()Getter for value ofCdrProcessor.CONTINUE_ON_ERROR_PROPERTYproperty.voidinit(Properties properties)Called to indicate to aCdrProcessorthat the processor is being placed into service.voidinitialize(Properties properties)This method is called frominit(Properties)and may be overridden to customize the initialization process.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 registry)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.
-
-
-
Method Detail
-
init
public final void init(Properties properties)
Description copied from interface:CdrProcessorCalled to indicate to aCdrProcessorthat the processor is being placed into service. This method is called exactly once after instantiating theCdrProcessor.- Specified by:
initin interfaceCdrProcessor- Parameters:
properties- properties provided using "processor-property" options when invokingCdrPipeline.
-
initialize
public void initialize(Properties properties)
This method is called frominit(Properties)and may be overridden to customize the initialization process.- Parameters:
properties- properties provided using "processor-property" options when invokingCdrPipeline.
-
destroy
public void destroy()
Description copied from interface:CdrProcessorCalled 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.- Specified by:
destroyin interfaceCdrProcessor
-
processingFile
public void processingFile(String path)
Description copied from interface:CdrProcessorCalled before processing any data contained in file denoted bypath.- Specified by:
processingFilein interfaceCdrProcessor- Parameters:
path- path denoting the CDR file to be processed.
-
processedFile
public void processedFile(String path)
Description copied from interface:CdrProcessorCalled after processing all data contained in file denoted bypath.- Specified by:
processedFilein interfaceCdrProcessor- Parameters:
path- path denoting the CDR file that was processed.
-
processHeader
public void processHeader(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Header header, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)Description copied from interface:CdrProcessorCalled when encountering aHeaderin binary CDR file.- Specified by:
processHeaderin interfaceCdrProcessor- Parameters:
header- header data contained in CDR file.timeStamp- timestamp when the header was written.
-
processFooter
public void processFooter(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.Footer footer, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)Description copied from interface:CdrProcessorCalled when encountering aFooterin binary CDR file.- Specified by:
processFooterin interfaceCdrProcessor- Parameters:
footer- footer data contained in CDR file.timeStamp- timestamp when the footer was written.
-
processBinaryCdr
public 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 registry)Description copied from interface:CdrProcessorCalled when encountering a binary CDR in CDR file.- Specified by:
processBinaryCdrin interfaceCdrProcessor- Parameters:
binaryCdr-BinaryCDRrecord encapsulating the bytes of CDRMessage.descriptor-Descriptorof the CDRMessage.timeStamp- timestamp when the record was written.registry-ExtensionRegistryto properly decode extension fields of the CDRMessage.- Returns:
- true if record should be processed by next
CdrProcessorin pipeline, false otherwise.
-
processStringCdr
public boolean processStringCdr(com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.StringCDR stringCdr, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)Description copied from interface:CdrProcessorCalled when encountering a string CDR in CDR file.- Specified by:
processStringCdrin interfaceCdrProcessor- 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.
-
getContinueOnError
public boolean getContinueOnError()
Getter for value ofCdrProcessor.CONTINUE_ON_ERROR_PROPERTYproperty.- Returns:
- value of
CdrProcessor.CONTINUE_ON_ERROR_PROPERTYproperty.
-
-