Class SdcDevice
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Device,EventSourceAccess,SdcDeviceContext
The purpose of the SdcDevice class is to provide SDC data on the network.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionGets the encapsulated device of an SdcDevice.Gets the discovery access.Gets the hosting service access.Gets the LocalMdibAccess passed to the SdcDevice constructor.Gets a collection of OperationInvocationReceiver instances passed to the SdcDevice constructor.com.google.common.util.concurrent.Service.StateGets the enclosingSdcDeviceservice state.voidsendNotification(String action, Object payload) <T extends AbstractState>
voidsendPeriodicStateReport(List<T> states, MdibVersion mdibVersion) Sends a periodic state report.protected voidshutDown()protected voidstartUp()voidsubscriptionEndToAll(WsEventingStatus status) Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Method Details
-
getMdibAccess
-
getEprAddress
- Specified by:
getEprAddressin interfaceDevice
-
getActiveSubscriptions
- Specified by:
getActiveSubscriptionsin interfaceDevice
-
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
Description copied from interface:SdcDeviceContextGets the LocalMdibAccess passed to the SdcDevice constructor.- Specified by:
getLocalMdibAccessin interfaceSdcDeviceContext- Returns:
- the local MDIB access.
-
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
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
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
- 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
- Specified by:
subscriptionEndToAllin interfaceEventSourceAccess- Throws:
TransportException
-