|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FindServiceInterface
Interface describing how to find service(s) via the Discovery service.
A service may be found by submitting a service template to the discovery service that describes the desired service interfaces. This service template may optionally include additional criteria to further filter the discovery results. When querying services using the service template one may specify the maximum number of results to be returned.
Alternatively, one may re-acquire a service by looking it up via its service discovery ID. A service's discovery ID is part of its discovery service configuration which is obtained as follows:
RemoteServiceInterface service; ... final ServiceConfigurationInterface serviceConfig = service.getServiceConfiguration(); if (serviceConfig != null) { final ServiceDiscoveryConfigurationInterface serviceDiscoveryConfig = serviceConfig.getServiceConfiguration( ServiceConfigurationInterface.CONFIGURATION_SERVICE_DISCOVERY); if ((serviceDiscoveryConfig != null) && (serviceDiscoveryConfig instanceof ServiceDiscoveryConfigurationInterface)) { final String serviceDiscoveryId = ((ServiceDiscoveryConfigurationInterface) serviceDiscoveryConfig).getDiscoveryId(); } }One first asks a service for its configuration and if one is available then you attempt to obtain the ancillary service discovery configuration from the service's configuration. If successful, you'll get a
ServiceDiscoveryConfigurationInterface
which provides method
getDiscoveryId() to obtain the discovery ID associated with a service.
Field Summary | |
---|---|
static int |
FIND_ALL_MATCHES
Constant used to indicate that all matches are desired. |
static int |
FIND_ONE_MATCH
Constant used to indicate that only one match is desired. |
Method Summary | |
---|---|
RemoteServiceInterface |
findService(ServiceTemplate serviceTemplate)
Finds a service using a discovery mechanism. |
Services |
findServices(ServiceTemplate serviceTemplate,
int maxNumMatches,
Services services)
Finds a collection of services via a discovery mechanism. |
RemoteServiceInterface |
findServiceUsingId(java.lang.String serviceId)
Re-acquires a previously discovered service via its service discovery ID. |
Field Detail |
---|
static final int FIND_ONE_MATCH
static final int FIND_ALL_MATCHES
Method Detail |
---|
RemoteServiceInterface findServiceUsingId(java.lang.String serviceId) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
serviceId
- Service's discovery ID.
RemoteServiceInterface
implementation
that satisfies the discovery parameters. Note that
RemoteServiceInterface
is the base interface
implemented by all services.
ServiceException
- if an unanticipated exception occurs while
processing the discovery. Note that
ServiceNotAvailableException
extends
ServiceException
.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceNotAvailableException
- if no service satisfies
the requested service template.RemoteServiceInterface findService(ServiceTemplate serviceTemplate) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
ServiceAttributeInterface
serviceTemplate
- Service capability template that specifies
the desired class(es) that define a service.
The template may also specify
criteria to provide additional filtering.
RemoteServiceInterface
implementation
that satisfies the requested service template. Note that
RemoteServiceInterface
is the base interface
implemented by all services.
ServiceException
- if an unanticipated exception occurs while
processing the discovery.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceNotAvailableException
- if no service satisfies
the requested service template. Note that
ServiceNotAvailableException
extends
ServiceException
.ServiceTemplate
Services findServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services services) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
com.sas.services.RemoteServiceInterface
which is implemented
by all services.
serviceTemplate
- Service capability template that specifies either
the desired class(es) that define a services.
The service template may also specify additional
criteria to provide additional filtering.maxNumMatches
- The maximum number of services that are desired.
Value should be greater than or equal to one.services
- Collection of services satisfying
the specified service capabilities or null
if there are no previously discovered services.
java.rmi.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. Note that
ServiceNotAvailableException
extends
ServiceException
.ServiceTemplate
,
Services
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |