Class SdcDevice
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.glue.provider.SdcDevice
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Device,EventSourceAccess,SdcDeviceContext
public class SdcDevice extends com.google.common.util.concurrent.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.
-
-
Method Summary
-
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
-
-
-
-
Method Detail
-
getMdibAccess
public LocalMdibAccess getMdibAccess()
-
getEprAddress
public String getEprAddress()
- Specified by:
getEprAddressin interfaceDevice
-
getActiveSubscriptions
public Map<String,SubscriptionManager> getActiveSubscriptions()
- Specified by:
getActiveSubscriptionsin interfaceDevice
-
getDevice
public Device getDevice()
Description copied from interface:SdcDeviceContextGets 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
SdcDeviceinstance that provides this context.- Specified by:
getDevicein interfaceSdcDeviceContext- Returns:
- the DPWS device.
-
getLocalMdibAccess
public LocalMdibAccess getLocalMdibAccess()
Description copied from interface:SdcDeviceContextGets the LocalMdibAccess passed to the SdcDevice constructor.- Specified by:
getLocalMdibAccessin interfaceSdcDeviceContext- Returns:
- the local MDIB access.
-
getOperationInvocationReceivers
public Collection<OperationInvocationReceiver> getOperationInvocationReceivers()
Description copied from interface:SdcDeviceContextGets a collection of OperationInvocationReceiver instances passed to the SdcDevice constructor.- Specified by:
getOperationInvocationReceiversin interfaceSdcDeviceContext- Returns:
- an unmodifiable
OperationInvocationReceivercollection.
-
getServiceState
public com.google.common.util.concurrent.Service.State getServiceState()
Description copied from interface:SdcDeviceContextGets the enclosingSdcDeviceservice state.- Specified by:
getServiceStatein interfaceSdcDeviceContext- Returns:
AbstractIdleService.state()of the enclosing SDC device.
-
sendPeriodicStateReport
public <T extends AbstractState> void sendPeriodicStateReport(List<T> states, MdibVersion mdibVersion)
Description copied from interface:SdcDeviceContextSends 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
AbstractMetricState) - Alert states (every subclass of
AbstractAlertState) - Context states (every subclass of
AbstractContextState) - Operational states (every subclass of
AbstractOperationState) - Component states (every subclass of
AbstractDeviceComponentState)
- Specified by:
sendPeriodicStateReportin interfaceSdcDeviceContext- Type Parameters:
T- the state type that.- Parameters:
states- the states that are supposed to be notified.mdibVersion- the MDIB version the report belongs to.
- Metric states (every subclass of
-
getDiscoveryAccess
public 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 theSdcRequiredTypesAndScopesplugin to manage discovery.- Specified by:
getDiscoveryAccessin interfaceDevice- Returns:
- the discovery access.
-
getHostingServiceAccess
public 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
Device.getHostingServiceAccess()fromSdcDeviceContext.getDevice().- Specified by:
getHostingServiceAccessin interfaceDevice- Returns:
- the hosting service access.
-
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
-
sendNotification
public void sendNotification(String action, Object payload) throws MarshallingException, TransportException
- Specified by:
sendNotificationin interfaceEventSourceAccess- Throws:
MarshallingExceptionTransportException
-
subscriptionEndToAll
public void subscriptionEndToAll(WsEventingStatus status) throws TransportException
- Specified by:
subscriptionEndToAllin interfaceEventSourceAccess- Throws:
TransportException
-
-