Class SdcDevice
-
- All Implemented Interfaces:
-
com.google.common.util.concurrent.Service,org.somda.sdc.dpws.device.Device,org.somda.sdc.dpws.device.EventSourceAccess,org.somda.sdc.glue.provider.SdcDeviceContext
public class SdcDevice extends AbstractIdleService implements Device, EventSourceAccess, SdcDeviceContext
Adds SDC services to a DPWS device and manages incoming set service requests.
The purpose of the SdcDevice class is to provide SDC data on the network.
-
-
Field Summary
Fields Modifier and Type Field Description public final OperationInvocationReceiveroperationInvocationReceiverpublic final LocalMdibAccessmdibAccess
-
Method Summary
Modifier and Type Method Description OperationInvocationReceivergetOperationInvocationReceiver()Gets the OperationInvocationReceiver instance passed to the SdcDevice constructor. LocalMdibAccessgetMdibAccess()StringgetEprAddress()Map<String, SubscriptionManager>getActiveSubscriptions()DevicegetDevice()Gets the encapsulated device of an SdcDevice. LocalMdibAccessgetLocalMdibAccess()Gets the LocalMdibAccess passed to the SdcDevice constructor. Service.StategetServiceState()Gets the enclosing SdcDevice service state. <T extends AbstractState> voidsendPeriodicStateReport(Map<String, List<T>> states, MdibVersion mdibVersion)Sends a periodic state report. DiscoveryAccessgetDiscoveryAccess()Gets the discovery access. HostingServiceAccessgetHostingServiceAccess()Gets the hosting service access. voidsendNotification(String action, Object payload)voidsubscriptionEndToAll(WsEventingStatus status)-
Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getOperationInvocationReceiver
OperationInvocationReceiver getOperationInvocationReceiver()
Gets the OperationInvocationReceiver instance passed to the SdcDevice constructor.
- Returns:
-
getMdibAccess
LocalMdibAccess getMdibAccess()
-
getEprAddress
String getEprAddress()
-
getActiveSubscriptions
Map<String, SubscriptionManager> getActiveSubscriptions()
-
getDevice
Device getDevice()
Gets the encapsulated device of an SdcDevice.
Do not call any startup or shutdown functions from that device reference as it is still managed by the enclosing SdcDevice instance that provides this context.
- Returns:
the DPWS device.
-
getLocalMdibAccess
LocalMdibAccess getLocalMdibAccess()
Gets the LocalMdibAccess passed to the SdcDevice constructor.
- Returns:
the local MDIB access.
-
getServiceState
Service.State getServiceState()
Gets the enclosing SdcDevice service state.
- Returns:
state of the enclosing SDC device.
-
sendPeriodicStateReport
<T extends AbstractState> void sendPeriodicStateReport(Map<String, List<T>> states, MdibVersion mdibVersion)
Sends a periodic state report.
This function does not control periodicity. Periodicity has to be controlled by the calling function.
Note that only one report type is supported per call, e.g. it is not possible to mix metric and context states. In accordance with the SDC, the following state types have to be sent in separate reports:
- Metric states (every subclass of org.somda.sdc.biceps.model.participant.AbstractMetricState)
- Alert states (every subclass of org.somda.sdc.biceps.model.participant.AbstractAlertState)
- Context states (every subclass of org.somda.sdc.biceps.model.participant.AbstractContextState)
- Operational states (every subclass of org.somda.sdc.biceps.model.participant.AbstractOperationState)
- Component states (every subclass of org.somda.sdc.biceps.model.participant.AbstractDeviceComponentState)
- Parameters:
states- map with mds as key and lists of the states that are supposed to be notified as value.mdibVersion- the MDIB version the report belongs to.
-
getDiscoveryAccess
DiscoveryAccess getDiscoveryAccess()
Gets the discovery access. Please note that the discovery access is managed by this class. Overwriting types and/or scopes can cause negative side-effects.Prefer using the SdcRequiredTypesAndScopes plugin to manage discovery.
- Returns:
the discovery access.
-
getHostingServiceAccess
HostingServiceAccess getHostingServiceAccess()
Gets the hosting service access.
As the BICEPS services are managed by this class, there should not be any need to access the hosting services. In case access is required though, consider creating a plugin that accesses the hosting services. Prefer implementing a plugin and use getHostingServiceAccess from getDevice.
- Returns:
the hosting service access.
-
sendNotification
void sendNotification(String action, Object payload)
-
subscriptionEndToAll
void subscriptionEndToAll(WsEventingStatus status)
-
-
-
-