Class AbstractTypedCdrProcessor<M extends com.google.protobuf.Message>
- java.lang.Object
-
- com.opencloud.slee.resources.cdr.process.CdrProcessorAdapter
-
- com.opencloud.slee.resources.cdr.process.AbstractTypedCdrProcessor<M>
-
- All Implemented Interfaces:
CdrProcessor
public abstract class AbstractTypedCdrProcessor<M extends com.google.protobuf.Message> extends CdrProcessorAdapter
Abstract implementation ofCdrProcessor
that parses and processesBinaryCDR
s representingMessage
s of specified class.
-
-
Field Summary
-
Fields inherited from interface com.opencloud.slee.resources.cdr.process.CdrProcessor
CONTINUE_ON_ERROR_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AbstractTypedCdrProcessor(Class<M> messageClass)
Equivalent to callingAbstractTypedCdrProcessor(messageClass, true)
AbstractTypedCdrProcessor(Class<M> clazz, boolean continueChainOnNonMatchingMessage)
Construct an instance of this class to processMessage
s of classclazz
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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)
Implementation ofCdrProcessor.processBinaryCdr
that parsesMessage
of provided class and invokesprocessMessage
.protected abstract boolean
processMessage(M message, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
This method is called whenever aBinaryCDR
record representingMessage
of selected class is encountered in CDR file.protected void
registerExtensions(com.google.protobuf.ExtensionRegistry registry)
Method called during construction ofAbstractTypedCdrProcessor
.-
Methods inherited from class com.opencloud.slee.resources.cdr.process.CdrProcessorAdapter
destroy, getContinueOnError, init, initialize, processedFile, processFooter, processHeader, processingFile, processStringCdr
-
-
-
-
Constructor Detail
-
AbstractTypedCdrProcessor
public AbstractTypedCdrProcessor(Class<M> messageClass)
Equivalent to callingAbstractTypedCdrProcessor(messageClass, true)
- Parameters:
messageClass
- Class representingMessage
s to be processed.
-
AbstractTypedCdrProcessor
public AbstractTypedCdrProcessor(Class<M> clazz, boolean continueChainOnNonMatchingMessage)
Construct an instance of this class to processMessage
s of classclazz
.- Parameters:
clazz
- Class representingMessage
s to be processed.continueChainOnNonMatchingMessage
- return this value fromprocessBinaryCdr
method forMessage
s of other than instances ofclazz
.
-
-
Method Detail
-
processMessage
protected abstract boolean processMessage(M message, com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
This method is called whenever aBinaryCDR
record representingMessage
of selected class is encountered in CDR file.- Parameters:
message
- decodedMessage
.timeStamp
- timestamp when the record was written.- Returns:
- true if record should be processed by next
CdrProcessor
in pipeline, false otherwise.
-
registerExtensions
protected void registerExtensions(com.google.protobuf.ExtensionRegistry registry)
Method called during construction ofAbstractTypedCdrProcessor
. Subclass should override this method and register extensions that it wants to have automatically parsed.- Parameters:
registry
- the ExtensionRegistry where subclass may register extensions to be automatically parsed.
-
processBinaryCdr
public final 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)
Implementation ofCdrProcessor.processBinaryCdr
that parsesMessage
of provided class and invokesprocessMessage
.- Specified by:
processBinaryCdr
in interfaceCdrProcessor
- Overrides:
processBinaryCdr
in classCdrProcessorAdapter
- 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:
- value of
continueChainOnNonMatchingMessage
constructor parameter.
-
-