Interface Client

All Superinterfaces:
com.google.common.util.concurrent.Service
All Known Implementing Classes:
ClientImpl

public interface Client extends com.google.common.util.concurrent.Service
Core class to access DPWS client functionality.

Before access to client functions can be established, make sure to start the client service by using Service.startAsync(). Use Service.stopAsync() to stop the client service.

Important note: in case the client does not work, check if your code starts the DpwsFramework in advance.

  • 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 Type
    Method
    Description
    com.google.common.util.concurrent.ListenableFuture<HostingServiceProxy>
    connect(String eprAddress)
    Connects to a hosting service by using an EPR address.
    com.google.common.util.concurrent.ListenableFuture<HostingServiceProxy>
    connect(DiscoveredDevice discoveredDevice)
    Connects to a hosting service by using DiscoveredDevice.
    com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.dpws.soap.wsdiscovery.model.ProbeMatchesType>
    Sends a directed probe to a specific physical address.
    void
    probe(DiscoveryFilter discoveryFilter)
    Probes for devices.
    void
    Subscribes to discovery events.
    com.google.common.util.concurrent.ListenableFuture<DiscoveredDevice>
    resolve(String eprAddress)
    Resolves physical addresses (XAddrs) of a device.
    void
    Unsubscribes from discovery events.

    Methods inherited from interface com.google.common.util.concurrent.Service

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
  • Method Details

    • registerDiscoveryObserver

      void registerDiscoveryObserver(DiscoveryObserver observer)
      Subscribes to discovery events.
      Parameters:
      observer - the observer that is supposed to receive events.
    • unregisterDiscoveryObserver

      void unregisterDiscoveryObserver(DiscoveryObserver observer)
      Unsubscribes from discovery events.
      Parameters:
      observer - the observer that shall not receive events anymore.
    • probe

      void probe(DiscoveryFilter discoveryFilter) throws TransportException, InterceptorException
      Probes for devices.

      This method synchronously sends a WS-Discovery Probe. All parties that subscribed to event messages by using registerDiscoveryObserver(DiscoveryObserver) will be notified on found devices and probe ending.

      Parameters:
      discoveryFilter - types and scopes the discovery process shall filter against.
      Throws:
      TransportException - if probe cannot be sent.
      InterceptorException - if one of the interceptors pops up with an error.
    • directedProbe

      com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.dpws.soap.wsdiscovery.model.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

      com.google.common.util.concurrent.ListenableFuture<DiscoveredDevice> resolve(String eprAddress) throws InterceptorException
      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.
      Throws:
      InterceptorException - if one of the interceptors pops up with an error.
    • connect

      com.google.common.util.concurrent.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

      com.google.common.util.concurrent.ListenableFuture<HostingServiceProxy> connect(String eprAddress) throws InterceptorException
      Connects to a hosting service by using an EPR address.

      Shortcut for first doing a resolve(String) followed by a connect(DiscoveredDevice).

      Parameters:
      eprAddress - the EPR address of a device.
      Returns:
      a future that holds the result of the connect.
      Throws:
      InterceptorException - if one of the interceptors pops up with an error.