Class ClientImpl

java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.somda.sdc.dpws.client.ClientImpl
All Implemented Interfaces:
com.google.common.util.concurrent.Service, Client, HelloByeAndProbeMatchesObserver

public class ClientImpl extends com.google.common.util.concurrent.AbstractIdleService implements Client, com.google.common.util.concurrent.Service, HelloByeAndProbeMatchesObserver
Default implementation of Client.
  • 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<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.
    protected void
     
    protected void
     
    void
    Unsubscribes from discovery events.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

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

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

    • probe

      public void probe(DiscoveryFilter discoveryFilter) throws TransportException, InterceptorException
      Description copied from interface: Client
      Probes for devices.

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

      Specified by:
      probe in interface Client
      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

      public com.google.common.util.concurrent.ListenableFuture<ProbeMatchesType> directedProbe(String xAddr)
      Description copied from interface: Client
      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.

      Specified by:
      directedProbe in interface Client
      Parameters:
      xAddr - the device's physical address.
      Returns:
      a future that holds the result of the directed probe.
    • resolve

      public com.google.common.util.concurrent.ListenableFuture<DiscoveredDevice> resolve(String eprAddress) throws InterceptorException
      Description copied from interface: Client
      Resolves physical addresses (XAddrs) of a device.

      This method is an asynchronous unidirectional call; the result will not be notified to any subscribed parties.

      Specified by:
      resolve in interface Client
      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

      public com.google.common.util.concurrent.ListenableFuture<HostingServiceProxy> connect(DiscoveredDevice discoveredDevice)
      Description copied from interface: Client
      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.

      Specified by:
      connect in interface Client
      Parameters:
      discoveredDevice - a fully populated DiscoveredDevice.
      Returns:
      a future that holds the result of the connect.
    • connect

      public com.google.common.util.concurrent.ListenableFuture<HostingServiceProxy> connect(String eprAddress) throws InterceptorException
      Description copied from interface: Client
      Connects to a hosting service by using an EPR address.

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

      Specified by:
      connect in interface Client
      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.
    • startUp

      protected void startUp()
      Specified by:
      startUp in class com.google.common.util.concurrent.AbstractIdleService
    • shutDown

      protected void shutDown()
      Specified by:
      shutDown in class com.google.common.util.concurrent.AbstractIdleService
    • registerDiscoveryObserver

      public void registerDiscoveryObserver(DiscoveryObserver observer)
      Description copied from interface: Client
      Subscribes to discovery events.
      Specified by:
      registerDiscoveryObserver in interface Client
      Parameters:
      observer - the observer that is supposed to receive events.
    • unregisterDiscoveryObserver

      public void unregisterDiscoveryObserver(DiscoveryObserver observer)
      Description copied from interface: Client
      Unsubscribes from discovery events.
      Specified by:
      unregisterDiscoveryObserver in interface Client
      Parameters:
      observer - the observer that shall not receive events anymore.