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 forCdrProcessor
implementations 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
processBinaryCdr
andprocessStringCdr
return 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 void
destroy()
Called to indicate to aCdrProcessor
that the processor is being taken out of service.boolean
getContinueOnError()
Getter for value ofCdrProcessor.CONTINUE_ON_ERROR_PROPERTY
property.void
init(Properties properties)
Called to indicate to aCdrProcessor
that the processor is being placed into service.void
initialize(Properties properties)
This method is called frominit(Properties)
and may be overridden to customize the initialization process.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)
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.
-
-
-
Method Detail
-
init
public final void init(Properties properties)
Description copied from interface:CdrProcessor
Called to indicate to aCdrProcessor
that the processor is being placed into service. This method is called exactly once after instantiating theCdrProcessor
.- Specified by:
init
in 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:CdrProcessor
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.- Specified by:
destroy
in interfaceCdrProcessor
-
processingFile
public void processingFile(String path)
Description copied from interface:CdrProcessor
Called before processing any data contained in file denoted bypath
.- Specified by:
processingFile
in interfaceCdrProcessor
- Parameters:
path
- path denoting the CDR file to be processed.
-
processedFile
public void processedFile(String path)
Description copied from interface:CdrProcessor
Called after processing all data contained in file denoted bypath
.- Specified by:
processedFile
in 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:CdrProcessor
Called when encountering aHeader
in binary CDR file.- Specified by:
processHeader
in 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:CdrProcessor
Called when encountering aFooter
in binary CDR file.- Specified by:
processFooter
in 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:CdrProcessor
Called when encountering a binary CDR in CDR file.- Specified by:
processBinaryCdr
in interfaceCdrProcessor
- Parameters:
binaryCdr
-BinaryCDR
record encapsulating the bytes of CDRMessage
.descriptor
-Descriptor
of the CDRMessage
.timeStamp
- timestamp when the record was written.registry
-ExtensionRegistry
to properly decode extension fields of the CDRMessage
.- Returns:
- true if record should be processed by next
CdrProcessor
in 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:CdrProcessor
Called when encountering a string CDR in CDR file.- Specified by:
processStringCdr
in interfaceCdrProcessor
- 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.
-
getContinueOnError
public boolean getContinueOnError()
Getter for value ofCdrProcessor.CONTINUE_ON_ERROR_PROPERTY
property.- Returns:
- value of
CdrProcessor.CONTINUE_ON_ERROR_PROPERTY
property.
-
-