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.
-
-
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 offvoidchangeEnumStringMetric(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 waveformstatic voidmain(String[] args)voidsetLocation(LocationDetail location)protected voidshutDown()protected voidstartUp()-
Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
-
-
-
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. eth1eprAddress- 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:
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
-
-