Class ReportProcessor

  • All Implemented Interfaces:
    com.google.common.util.concurrent.Service

    public class ReportProcessor
    extends com.google.common.util.concurrent.AbstractIdleService
    Class that is responsible for buffering and processing of incoming reports.

    As long as there is no MDIB (plus optional context states) available, the report processor buffers incoming reports and only applies them once an MDIB (plus optional context states) was set. In case every report type is received through one subscription, the ReportProcessor ensures data coherency.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

        com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends org.somda.sdc.biceps.model.message.AbstractReport>
      void
      processReport​(T report)
      Queues or processes a report.
      protected void shutDown()  
      void startApplyingReportsOnMdib​(RemoteMdibAccess mdibAccess, org.somda.sdc.biceps.model.message.GetContextStatesResponse contextStatesResponse)
      Accepts an MDIB and starts applying reports on it.
      protected void startUp()  
      • Methods inherited from class com.google.common.util.concurrent.AbstractIdleService

        addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
    • Method Detail

      • startApplyingReportsOnMdib

        public void startApplyingReportsOnMdib​(RemoteMdibAccess mdibAccess,
                                               @Nullable
                                               org.somda.sdc.biceps.model.message.GetContextStatesResponse contextStatesResponse)
                                        throws PreprocessingException,
                                               ReportProcessingException
        Accepts an MDIB and starts applying reports on it.
        Parameters:
        mdibAccess - the MDIB access to use for application of incoming reports.
        contextStatesResponse - optionally a get-context-states response message in case a get-mdib request did not returned some.
        Throws:
        PreprocessingException - is thrown in case writing to the MDIB fails.
        ReportProcessingException - is thrown in case there is any error during processing of a report or accessing data from the queue.
      • startUp

        protected void startUp()
        Specified by:
        startUp in class com.google.common.util.concurrent.AbstractIdleService
      • shutDown

        protected void shutDown()
        Specified by:
        shutDown in class com.google.common.util.concurrent.AbstractIdleService