Package org.somda.sdc.glue.consumer
Class SdcRemoteDeviceImpl
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.glue.consumer.SdcRemoteDeviceImpl
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SdcRemoteDevice
public class SdcRemoteDeviceImpl extends com.google.common.util.concurrent.AbstractIdleService implements SdcRemoteDevice
Default implementation of SdcRemoteDevice.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HostingServiceProxygetHostingServiceProxy()Gets the hosting service proxy.RemoteMdibAccessgetMdibAccess()Read access to the remote MDIB.MdibAccessObservablegetMdibAccessObservable()Gets an interface to subscribe for MDIB updates.SetServiceAccessgetSetServiceAccess()Gets a set service invoker access.voidregisterWatchdogObserver(WatchdogObserver watchdogObserver)In order to get notified on disconnect events, this function attaches a watchdog observer.protected voidshutDown()protected voidstartUp()voidunregisterWatchdogObserver(WatchdogObserver watchdogObserver)Removes a watchdog observer.-
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
-
getHostingServiceProxy
public HostingServiceProxy getHostingServiceProxy()
Description copied from interface:SdcRemoteDeviceGets the hosting service proxy.The hosting service proxy can be used to access the device including metadata and services.
- Specified by:
getHostingServiceProxyin interfaceSdcRemoteDevice- Returns:
- the hosting service proxy bundled with the SDC remote device instance.
-
getMdibAccess
public RemoteMdibAccess getMdibAccess()
Description copied from interface:SdcRemoteDeviceRead access to the remote MDIB.The remote MDIB is updated by a background process that processes incoming reports. In order to manually access Web Services, one can use
SdcRemoteDevice.getHostingServiceProxy().- Specified by:
getMdibAccessin interfaceSdcRemoteDevice- Returns:
- MDIB access to read the remote MDIB.
-
getMdibAccessObservable
public MdibAccessObservable getMdibAccessObservable()
Description copied from interface:SdcRemoteDeviceGets an interface to subscribe for MDIB updates.- Specified by:
getMdibAccessObservablein interfaceSdcRemoteDevice- Returns:
- the MDIB observable interface.
-
getSetServiceAccess
public SetServiceAccess getSetServiceAccess()
Description copied from interface:SdcRemoteDeviceGets a set service invoker access.Please note that the set service access only works if the context and/or set service are available from the remote device. If not set service exists, any call to the
SetServiceAccessinterface results in an immediately cancelled future.- Specified by:
getSetServiceAccessin interfaceSdcRemoteDevice- Returns:
- a set service invoker access interface.
- See Also:
SetServiceAccess.invoke(AbstractSet, Class),SetServiceAccess.invoke(AbstractSet, Consumer, Class)
-
registerWatchdogObserver
public void registerWatchdogObserver(WatchdogObserver watchdogObserver)
Description copied from interface:SdcRemoteDeviceIn order to get notified on disconnect events, this function attaches a watchdog observer.- Specified by:
registerWatchdogObserverin interfaceSdcRemoteDevice- Parameters:
watchdogObserver- the watchdog callback interface.
-
unregisterWatchdogObserver
public void unregisterWatchdogObserver(WatchdogObserver watchdogObserver)
Description copied from interface:SdcRemoteDeviceRemoves a watchdog observer.- Specified by:
unregisterWatchdogObserverin interfaceSdcRemoteDevice- Parameters:
watchdogObserver- the watchdog observer to remove.
-
startUp
protected void startUp() throws TimeoutException- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
TimeoutException
-
shutDown
protected void shutDown()
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-
-