Interface Client
-
- All Implemented Interfaces:
-
com.google.common.util.concurrent.Service
public interface Client implements ServiceCore class to access DPWS client functionality.
Before access to client functions can be established, make sure to start the client service by using startAsync. Use stopAsync to stop the client service.
Important note: in case the client does not work, check if your code starts the org.somda.sdc.dpws.DpwsFramework in advance.
-
-
Method Summary
Modifier and Type Method Description abstract voidregisterDiscoveryObserver(DiscoveryObserver observer)Subscribes to discovery events. abstract voidunregisterDiscoveryObserver(DiscoveryObserver observer)Unsubscribes from discovery events. abstract voidregisterEventObserver(EventObserver eventObserver)Subscribes to client events. abstract voidunregisterEventObserver(EventObserver eventObserver)Unsubscribes from client events. abstract voidprobe(DiscoveryFilter discoveryFilter)Probes for devices. abstract ListenableFuture<ProbeMatchesType>directedProbe(String xAddr)Sends a directed probe to a specific physical address. abstract ListenableFuture<DiscoveredDevice>resolve(String eprAddress)Resolves physical addresses (XAddrs) of a device. abstract ListenableFuture<HostingServiceProxy>connect(DiscoveredDevice discoveredDevice)Connects to a hosting service by using DiscoveredDevice. abstract ListenableFuture<HostingServiceProxy>connect(String eprAddress)Connects to a hosting service by using an EPR address. -
Methods inherited from class com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
registerDiscoveryObserver
abstract void registerDiscoveryObserver(DiscoveryObserver observer)
Subscribes to discovery events.
- Parameters:
observer- the observer that is supposed to receive events.
-
unregisterDiscoveryObserver
abstract void unregisterDiscoveryObserver(DiscoveryObserver observer)
Unsubscribes from discovery events.
- Parameters:
observer- the observer that shall not receive events anymore.
-
registerEventObserver
abstract void registerEventObserver(EventObserver eventObserver)
Subscribes to client events.
- Parameters:
eventObserver- that receives events
-
unregisterEventObserver
abstract void unregisterEventObserver(EventObserver eventObserver)
Unsubscribes from client events.
- Parameters:
eventObserver- that no longer receives events
-
probe
abstract void probe(DiscoveryFilter discoveryFilter)
Probes for devices.
This method synchronously sends a WS-Discovery Probe. All parties that subscribed to event messages by using registerDiscoveryObserver will be notified on found devices and probe ending.
- Parameters:
discoveryFilter- types and scopes the discovery process shall filter against.
-
directedProbe
abstract ListenableFuture<ProbeMatchesType> directedProbe(String xAddr)
Sends a directed probe to a specific physical address.
This method is an asynchronous unidirectional call; the result will not be notified to any subscribed parties.
- Parameters:
xAddr- the device's physical address.- Returns:
a future that holds the result of the directed probe.
-
resolve
abstract ListenableFuture<DiscoveredDevice> resolve(String eprAddress)
Resolves physical addresses (XAddrs) of a device.
This method is an asynchronous unidirectional call; the result will not be notified to any subscribed parties.
- Parameters:
eprAddress- the endpoint reference address of the device to resolve.- Returns:
a future that holds the result of the resolve.
-
connect
abstract ListenableFuture<HostingServiceProxy> connect(DiscoveredDevice discoveredDevice)
Connects to a hosting service by using DiscoveredDevice.
This function requires a fully populated DiscoveredDevice including XAddrs.
By saying connect this method resolves a hosting service by using WS-TransferGet and hosted service information by using WS-MetadataExchange.
- Parameters:
discoveredDevice- a fully populated DiscoveredDevice.- Returns:
a future that holds the result of the connect.
-
connect
abstract ListenableFuture<HostingServiceProxy> connect(String eprAddress)
Connects to a hosting service by using an EPR address.
- Parameters:
eprAddress- the EPR address of a device.- Returns:
a future that holds the result of the connect.
-
-
-
-