Interface CdrProcessor

  • All Known Implementing Classes:
    AbstractTypedCdrProcessor, CdrProcessorAdapter, GenerateStatsCdrProcessor

    public interface CdrProcessor
    The 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.

    1. The CdrProcessor is constructed, then initialized with the init method.
    2. For each CDR file processed:
      1. The processingFile method is called.
      2. If header is present in CDR file processHeader method is called.
      3. For each record present in CDR file processBinaryCdr or processStringCdr method is called (depending on record type).
      4. If footer is present in CDR file processFooter method is called
      5. After all content of CDR file is processed the processedFile method is called.
    3. The CdrProcessor is destroyed with the destroy method. Called only if previous init method call did NOT throw an Exception. After that no further calls are invoked on CdrProcessor instance.

    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 String CONTINUE_ON_ERROR_PROPERTY
      Name 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
      void destroy()
      Called to indicate to a CdrProcessor that the processor is being taken out of service.
      void init​(Properties properties)
      Called to indicate to a CdrProcessor that the processor is being placed into service.
      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.
      void processedFile​(String path)
      Called after processing all data contained in file denoted by path.
      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 a Footer 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 a Header in binary CDR file.
      void processingFile​(String path)
      Called before processing any data contained in file denoted by path.
      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.
    • 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 invoking CdrPipeline.
        See Also:
        Constant Field Values
    • Method Detail

      • init

        void init​(Properties properties)
        Called to indicate to a CdrProcessor that the processor is being placed into service. This method is called exactly once after instantiating the CdrProcessor.
        Parameters:
        properties - properties provided using "processor-property" options when invoking CdrPipeline.
      • destroy

        void destroy()
        Called to indicate to a CdrProcessor that the processor is being taken out of service. This method is called only once and only if previous invocation of init did NOT throw an exception. After call to this method no further calls are invoked on CdrProcessor instance.
      • processingFile

        void processingFile​(String path)
        Called before processing any data contained in file denoted by path.
        Parameters:
        path - path denoting the CDR file to be processed.
      • processedFile

        void processedFile​(String path)
        Called after processing all data contained in file denoted by path.
        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 a Header in 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 a Footer in 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 - BinaryCDR record encapsulating the bytes of CDR Message.
        descriptor - Descriptor of the CDR Message.
        timeStamp - timestamp when the record was written.
        extensionRegistry - ExtensionRegistry to properly decode extension fields of the CDR Message.
        Returns:
        true if record should be processed by next CdrProcessor in 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 CdrProcessor in pipeline, false otherwise.