Class 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​(String networkAdapterName, String eprAddress)
      Create an instance of an SDC Provider
    • Constructor Detail

      • Provider

        public Provider​(String networkAdapterName,
                        String eprAddress)
                 throws SocketException
        Create an instance of an SDC Provider
        Parameters:
        networkAdapterName - name of the adapter the provider bindes to, e.g. eth1
        eprAddress - WS-Addressing EndpointReference Address element
        Throws:
        SocketException - thrown if network adapter cannot be set up
    • Method Detail

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