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.AbstractIdleServiceThis is an example provider using an mdib provided as XML as well as TLS secured communication.It is the complement to
Consumerin terms of used functionality and features.
-
-
Constructor Summary
Constructors Constructor Description Provider(ProviderUtil providerUtil)Create an instance of an SDC Provider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeAlertSignalAndConditionPresence(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 voidmain(String[] args)voidsetLocation(LocationDetail location)protected voidshutDown()protected voidstartUp()
-
-
-
Constructor Detail
-
Provider
public Provider(ProviderUtil providerUtil) throws SocketException, UnknownHostException
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 Detail
-
startUp
protected void startUp() throws Exception- 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
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 toggleconditionHandle- matching condition to toggle
-
main
public static void main(String[] args) throws IOException, PreprocessingException
- Throws:
IOExceptionPreprocessingException
-
-