Package com.example.provider1
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeAlertSignalAndConditionPresence(String signalHandle, String conditionHandle) Toggles an AlertSignalState and AlertConditionState between presence on and off.voidchangeEnumStringMetric(String handle) Changes the content of an EnumStringMetricState, selecting the next allowed value.voidchangeNumericMetric(String handle) Increments the value of a NumericMetricState.voidchangeStringMetric(String handle) Changes the content of a StringMetricState, toggling between "UPPERCASE" and "lowercase" as content.voidchangeWaveform(String handle) Adds a sine wave to the data of a waveform.static voidvoidsetLocation(LocationDetail location) protected voidshutDown()protected voidstartUp()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
-
Constructor Details
-
Provider
Create an instance of an SDC Provider.- Parameters:
providerUtil- options and configured injector- Throws:
SocketException- thrown if network adapter cannot be set upUnknownHostException- if provided address cannot be resolved to an adapter
-
-
Method Details
-
startUp
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
shutDown
protected void shutDown()- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-
setLocation
- Throws:
PreprocessingException
-
changeWaveform
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
Increments the value of a NumericMetricState.- Parameters:
handle- descriptor handle of metric state- Throws:
PreprocessingException- if changes could not be committed to mdib
-
changeStringMetric
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
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
Toggles an AlertSignalState and AlertConditionState between presence on and off.- Parameters:
signalHandle- signal handle to toggleconditionHandle- matching condition to toggle
-
main
- Throws:
IOExceptionPreprocessingException
-