*** This class provides Binary Compatibility only, not Source Compatibility ***

Class RemoteDiscoveryServiceProxy

java.lang.Object
com.sas.services.ServiceProxy
com.sas.services.discovery.RemoteDiscoveryServiceProxy
All Implemented Interfaces:
com.sas.entities.EntityKeyInterface, DiscoveryAdminInterface, DiscoveryServiceInterface, FindServiceInterface, RemoteDiscoveryServiceInterface, ServiceNotificationBroadcasterInterface, RemoteServiceInterface, Serializable, Remote

@SASScope("ALL") @BinaryCompatibilityOnly public class RemoteDiscoveryServiceProxy extends ServiceProxy implements RemoteDiscoveryServiceInterface, Serializable
Proxy to a discovery service that is capable of servicing remote clients.

If this proxy is serialized to a remote process then the proxy will optimize calls to ensure that a local object reference is used where appropriate and that static data is cached locally to minimize remote calls.

Since:
1.1
See Also:
  • Constructor Details

    • RemoteDiscoveryServiceProxy

      public RemoteDiscoveryServiceProxy(DiscoveryServiceInterface discoveryService) throws InitializationException
      Constructs a proxy to the specified discovery service.
      Parameters:
      discoveryService - Remote discovery service to be proxied.
      Throws:
      InitializationException - if unable to create a proxy for the discovery service.
  • Method Details

    • getServiceProxy

      public final RemoteServiceInterface getServiceProxy()
      Gets the service proxy.
      Specified by:
      getServiceProxy in interface RemoteServiceInterface
      Overrides:
      getServiceProxy in class ServiceProxy
      Returns:
      A proxy to this service or null if a proxy is not available.
    • findServiceUsingId

      public RemoteServiceInterface findServiceUsingId(String serviceId) throws ServiceException, ServiceNotAvailableException, RemoteException
      Re-acquires a previously discovered service via its service discovery ID. The service discovery ID is runtime ID that is unique across JVMs and only used in the context of discovering a service.
      Specified by:
      findServiceUsingId in interface FindServiceInterface
      Parameters:
      serviceId - Service's discovery ID.
      Returns:
      RemoteServiceInterface implementation that satisfies the discovery parameters. Note that RemoteServiceInterface is the base interface implemented by all services.
      Throws:
      ServiceException - if an unanticipated exception occurs while processing the discovery. Note that ServiceNotAvailableException extends ServiceException.
      ServiceNotAvailableException - if no service satisfies the requested service template.
      RemoteException - if a network anomaly is encountered.
    • findService

      public final RemoteServiceInterface findService(ServiceTemplate serviceTemplate) throws ServiceException, ServiceNotAvailableException, RemoteException
      Finds a service using a discovery mechanism.

      To be considered a successful match, the service must satisfy the requested service template which may be used to specify:

      • class(es) the service is, extends, or implements
      • additional filtering criteria expressed in terms of ServiceAttributeInterface
      Specified by:
      findService in interface FindServiceInterface
      Parameters:
      serviceTemplate - Service capability template that specifies the desired class(es) that define a service. The template may also specify criteria to provide additional filtering.
      Returns:
      RemoteServiceInterface implementation that satisfies the requested service template. Note that RemoteServiceInterface is the base interface implemented by all services.
      Throws:
      ServiceException - if an unanticipated exception occurs while processing the discovery.
      ServiceNotAvailableException - if no service satisfies the requested service template. Note that ServiceNotAvailableException extends ServiceException.
      RemoteException - if a network anomaly is encountered.
      See Also:
    • findServices

      public final Services findServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services discoveredServices) throws ServiceException, ServiceNotAvailableException, RemoteException
      Finds a collection of objects via a discovery mechanism.

      To be considered a successful match, the service must satisfy the requested service template which may be used to specify:

      • a service ID
      • classes the service is, extends, or implements
      • additional filtering criteria
      Specified by:
      findServices in interface FindServiceInterface
      Parameters:
      serviceTemplate - Service capability template that specifies either
      1. a service ID to retrieve a particular service
      2. the desired classes that define a service. One may also specify additional criteria to provide additional filtering.
      maxNumMatches - Maximum number of services.
      discoveredServices - A collection containing services that have already been found. Set this parameter to null if no services have been found yet.
      Returns:
      A collection containing search results. Each collection element will either be, implement, or extend the requested classes.
      Throws:
      RemoteException - if a network anomaly is encountered.
      ServiceException - if an unanticipated exception occurs while processing the discovery.
      ServiceNotAvailableException - if no service satisfies the requested service template.
      See Also:
    • addDiscoveryDelegate

      public void addDiscoveryDelegate(FindServiceInterface serviceFinder) throws RemoteException
      Adds an delegate that is capable of discovering implementations.
      Specified by:
      addDiscoveryDelegate in interface DiscoveryAdminInterface
      Parameters:
      serviceFinder - Discovery service implementation.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • removeDiscoveryDelegate

      public void removeDiscoveryDelegate(FindServiceInterface serviceFinder) throws RemoteException
      Removes an agent previously added as a discovery agent.
      Specified by:
      removeDiscoveryDelegate in interface DiscoveryAdminInterface
      Parameters:
      serviceFinder - Discovery service implementation to remove.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • getRemoteServices

      public Iterator<RemoteServiceInterface> getRemoteServices() throws RemoteException
      Gets an iterator of registered services.
      Specified by:
      getRemoteServices in interface DiscoveryAdminInterface
      Returns:
      Iterator of remotely available services that implement the RemoteServiceInterface interface.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • getLocalServices

      public final Iterator<RemoteServiceInterface> getLocalServices() throws RemoteException
      Gets an iterator of local objects that implement the RemoteServiceInterface interface.
      Specified by:
      getLocalServices in interface DiscoveryAdminInterface
      Returns:
      Iterator of locally available services that implement the RemoteServiceInterface interface.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • removeService

      public void removeService(RemoteServiceInterface serviceIf) throws RemoteException
      Removes a service from the registry.
      Specified by:
      removeService in interface DiscoveryAdminInterface
      Parameters:
      serviceIf - Service that is to be removed.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • getDiscoverers

      public final Iterator<FindServiceInterface> getDiscoverers() throws RemoteException
      Gets an iterator of the discovery services.
      Specified by:
      getDiscoverers in interface DiscoveryAdminInterface
      Returns:
      Iterator of discovery delegates.
      Throws:
      RemoteException - if a network anomaly is encountered.
    • addService

      public void addService(RemoteServiceInterface serviceIf) throws ServiceException, RemoteException
      Adds a service to the registry.
      Specified by:
      addService in interface DiscoveryAdminInterface
      Parameters:
      serviceIf - Service that is discoverable via its service capabilities.
      Throws:
      ServiceException - if unable to cache the service.
      RemoteException - if a network anomaly is encountered.