Class Provider

java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
com.example.provider1.Provider
All Implemented Interfaces:
com.google.common.util.concurrent.Service

public class Provider extends com.google.common.util.concurrent.AbstractIdleService
This is an example provider using an mdib provided as XML as well as TLS secured communication.

It is the complement to Consumer in terms of used functionality and features.

  • 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    Provider(ProviderUtil providerUtil)
    Create an instance of an SDC Provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    changeAlertSignalAndConditionPresence(String signalHandle, String conditionHandle)
    Toggles an AlertSignalState and AlertConditionState between presence on and off.
    void
    Changes the content of an EnumStringMetricState, selecting the next allowed value.
    void
    Increments the value of a NumericMetricState.
    void
    Changes the content of a StringMetricState, toggling between "UPPERCASE" and "lowercase" as content.
    void
    Adds a sine wave to the data of a waveform.
    static void
    main(String[] args)
     
    void
     
    protected void
     
    protected void
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • startUp

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

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

      public void setLocation(LocationDetail location) throws PreprocessingException
      Throws:
      PreprocessingException
    • changeWaveform

      public void changeWaveform(String handle) throws PreprocessingException
      Adds a sine wave to the data of a waveform.
      Parameters:
      handle - descriptor handle of waveform state
      Throws:
      PreprocessingException - if changes could not be committed to mdib
    • changeNumericMetric

      public void changeNumericMetric(String handle) throws PreprocessingException
      Increments the value of a NumericMetricState.
      Parameters:
      handle - descriptor handle of metric state
      Throws:
      PreprocessingException - if changes could not be committed to mdib
    • changeStringMetric

      public void changeStringMetric(String handle) throws PreprocessingException
      Changes the content of a StringMetricState, toggling between "UPPERCASE" and "lowercase" as content.
      Parameters:
      handle - descriptor handle of metric state
      Throws:
      PreprocessingException - if changes could not be committed to mdib
    • changeEnumStringMetric

      public void changeEnumStringMetric(String handle) throws PreprocessingException
      Changes the content of an EnumStringMetricState, selecting the next allowed value.
      Parameters:
      handle - descriptor handle of metric state
      Throws:
      PreprocessingException - if changes could not be committed to mdib
    • changeAlertSignalAndConditionPresence

      public void changeAlertSignalAndConditionPresence(String signalHandle, String conditionHandle)
      Toggles an AlertSignalState and AlertConditionState between presence on and off.
      Parameters:
      signalHandle - signal handle to toggle
      conditionHandle - matching condition to toggle
    • main

      public static void main(String[] args) throws IOException, PreprocessingException
      Throws:
      IOException
      PreprocessingException