Class AbstractTypedCdrProcessor<M extends com.google.protobuf.Message>

  • All Implemented Interfaces:
    CdrProcessor

    public abstract class AbstractTypedCdrProcessor<M extends com.google.protobuf.Message>
    extends CdrProcessorAdapter
    Abstract implementation of CdrProcessor that parses and processes BinaryCDRs representing Messages of specified class.
    • Constructor Detail

      • AbstractTypedCdrProcessor

        public AbstractTypedCdrProcessor​(Class<M> clazz,
                                         boolean continueChainOnNonMatchingMessage)
        Construct an instance of this class to process Messages of class clazz.
        Parameters:
        clazz - Class representing Messages to be processed.
        continueChainOnNonMatchingMessage - return this value from processBinaryCdr method for Messages of other than instances of clazz.
    • Method Detail

      • processMessage

        protected abstract boolean processMessage​(M message,
                                                  com.opencloud.slee.resources.cdr.protobuf.CdrFileFormat.CdrFile.DateTime timeStamp)
        This method is called whenever a BinaryCDR record representing Message of selected class is encountered in CDR file.
        Parameters:
        message - decoded Message.
        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 of AbstractTypedCdrProcessor. 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 of CdrProcessor.processBinaryCdr that parses Message of provided class and invokes processMessage.
        Specified by:
        processBinaryCdr in interface CdrProcessor
        Overrides:
        processBinaryCdr in class CdrProcessorAdapter
        Parameters:
        binaryCdr - BinaryCDR record encapsulating the bytes of CDR Message.
        descriptor - Descriptor of the CDR Message.
        timeStamp - timestamp when the record was written.
        registry - ExtensionRegistry to properly decode extension fields of the CDR Message.
        Returns:
        value of continueChainOnNonMatchingMessage constructor parameter.