org.jafer.registry
Interface ServiceLocator

All Known Implementing Classes:
ServiceLocator

public interface ServiceLocator

The service locator is responsible for finding providers and services in the registry. Usernames and passwords are not required to search the registry.


Method Summary
 java.util.List findService(Category category)
          Finds the services that have the supplied category attached
 java.util.List findService(Protocol protocol)
          Finds the services that support the supplied protocol
 java.util.List findService(ServiceProviderInfo serviceProviderInfo)
          Finds the services that match the supplied service provider info.
 java.util.List findService(ServiceProviderInfo serviceProviderInfo, java.lang.String name, java.util.List categories, java.util.List protocols, boolean useLogicalOR)
          This method allows services to be located by using all the possible search combinations.
 java.util.List findService(java.lang.String name)
          Finds the service that match the supplied name.
 java.util.List findServiceProvider(Category category)
          Finds the service providers that have the supplied category attached
 java.util.List findServiceProvider(Protocol protocol)
          Finds the service providers that have services supporting the supplied protocol
 java.util.List findServiceProvider(java.lang.String name)
          Finds the service providers that match the supplied name.
 java.util.List findServiceProvider(java.lang.String name, java.util.List categories, java.util.List protocols, boolean useLogicalOR)
          This method allows service providers to be located by using all the possible search combinations.
 Service getService(ServiceInfo serviceInfo)
          Retrieves the full service object for the supplied service info.
 Service getService(java.lang.String id)
          Gets the service from its unique ID
 ServiceProvider getServiceProvider(Service service)
          Gets the service provider that owns the service
 ServiceProvider getServiceProvider(ServiceProviderInfo providerInfo)
          Retrieves the full service provider object for the supplied service provider info.
 ServiceProvider getServiceProvider(java.lang.String id)
          Gets the service provider from its unique ID
 Service refreshService(Service service)
          Returns the latest version of the service found.
 ServiceProvider refreshServiceProvider(ServiceProvider provider)
          Returns the latest version of the service provider found.
 void setMaxReturned(int maxReturned)
          Allows the caller to overload the default number of instances returned from a find call.
 

Method Detail

setMaxReturned

void setMaxReturned(int maxReturned)
Allows the caller to overload the default number of instances returned from a find call. Default value is set to 0 so no limits applied

Parameters:
maxReturned - The maximum number of instances to return

findServiceProvider

java.util.List findServiceProvider(java.lang.String name)
                                   throws RegistryException
Finds the service providers that match the supplied name. The name can contain one or more % wildcard characters.

Parameters:
name - The name of the provider to search for.
Returns:
A list of ServiceProviderInfo objects for each service provider found
Throws:
RegistryException

findServiceProvider

java.util.List findServiceProvider(Category category)
                                   throws RegistryException
Finds the service providers that have the supplied category attached

Parameters:
category - The category and value to search by
Returns:
A list of ServiceProviderInfo objects for each service provider found
Throws:
RegistryException

findServiceProvider

java.util.List findServiceProvider(Protocol protocol)
                                   throws RegistryException
Finds the service providers that have services supporting the supplied protocol

Parameters:
protocol - The protocol to search by
Returns:
A list of ServiceProviderInfo objects for each service provider found
Throws:
RegistryException

findServiceProvider

java.util.List findServiceProvider(java.lang.String name,
                                   java.util.List categories,
                                   java.util.List protocols,
                                   boolean useLogicalOR)
                                   throws RegistryException
This method allows service providers to be located by using all the possible search combinations. Name, categories and protocols are all optional to ignore pass:
The name can contain one or more % wildcard characters. If useLogicalOR is set to false then all the categories and protocols must be attached to the service provider for it to be returned rather than just one of the categories or protocols.

Parameters:
name - The name of the provider to search for.
categories - A list of categories and values to search by
protocols - A list of protocols s to search by
useLogicalOR - true to use OR operator, false to use AND operator
Returns:
A list of ServiceProviderInfo objects for each service provider found
Throws:
RegistryException

getServiceProvider

ServiceProvider getServiceProvider(Service service)
                                   throws RegistryException
Gets the service provider that owns the service

Parameters:
service - The service to search by
Returns:
The service provider that owns the service or NULL if not found
Throws:
RegistryException

getServiceProvider

ServiceProvider getServiceProvider(java.lang.String id)
                                   throws RegistryException
Gets the service provider from its unique ID

Parameters:
id - The ID of the service provider
Returns:
The service provider for the ID or NULL if not found
Throws:
RegistryException

getServiceProvider

ServiceProvider getServiceProvider(ServiceProviderInfo providerInfo)
                                   throws RegistryException
Retrieves the full service provider object for the supplied service provider info.

Parameters:
providerInfo - The service provider info identifying the service provider to retrieve
Returns:
A ServiceProvider object for the supplied service provider info
Throws:
RegistryException

refreshServiceProvider

ServiceProvider refreshServiceProvider(ServiceProvider provider)
                                       throws RegistryException
Returns the latest version of the service provider found. Any changes to the supplied service provider will be ignored and a fresh copy will be retrieved from the registry.

Note: Any service objects retrieved of the orignal provider will contain out dates information after this call and should no longer be used. Updating the old provider or services will cause the old information to replace the current in the registry

Parameters:
provider - The provider to refresh
Returns:
The refreshed service provider object
Throws:
RegistryException

findService

java.util.List findService(ServiceProviderInfo serviceProviderInfo)
                           throws RegistryException
Finds the services that match the supplied service provider info.

Parameters:
serviceProviderInfo - perform the search over the services on this service provider
Returns:
A list of ServiceInfo objects for each service found
Throws:
RegistryException

findService

java.util.List findService(java.lang.String name)
                           throws RegistryException
Finds the service that match the supplied name. The name can contain one or more % wildcard characters.

Parameters:
name - The name of the service to search for.
Returns:
A list of ServiceInfo objects for each service found
Throws:
RegistryException

findService

java.util.List findService(Category category)
                           throws RegistryException
Finds the services that have the supplied category attached

Parameters:
category - The category and value to search by
Returns:
A list of ServiceInfo objects for each service found
Throws:
RegistryException

findService

java.util.List findService(Protocol protocol)
                           throws RegistryException
Finds the services that support the supplied protocol

Parameters:
protocol - The protocol to search by
Returns:
A list of ServiceInfo objects for each service found
Throws:
RegistryException

findService

java.util.List findService(ServiceProviderInfo serviceProviderInfo,
                           java.lang.String name,
                           java.util.List categories,
                           java.util.List protocols,
                           boolean useLogicalOR)
                           throws RegistryException
This method allows services to be located by using all the possible search combinations. ServiceProviderInfo, Name, categories and protocols are all optional to ignore pass:
The name can contain one or more % wildcard characters. If useLogicalOR is set to false then all the categories and protocols must be attached to the service for it to be returned rather than just one of the categories or protocols.

Parameters:
serviceProviderInfo - perform the search over the services on this provider
name - The name of the service to search for.
categories - A list of categories and values to search by
protocols - A list of protocols s to search by
useLogicalOR - true to use OR operator, false to use AND operator
Returns:
A list of ServiceInfo objects for each service found
Throws:
RegistryException

getService

Service getService(ServiceInfo serviceInfo)
                   throws RegistryException
Retrieves the full service object for the supplied service info.

Parameters:
serviceInfo - The service info identifying the service to retrieve
Returns:
A Service object for the supplied service info
Throws:
RegistryException

getService

Service getService(java.lang.String id)
                   throws RegistryException
Gets the service from its unique ID

Parameters:
id - The ID of the service
Returns:
The service for the ID or NULL if not found
Throws:
RegistryException

refreshService

Service refreshService(Service service)
                       throws RegistryException
Returns the latest version of the service found. Any changes to the supplied service will be ignored and a fresh copy will be retrieved from the registry.

Parameters:
service - The service to refresh
Returns:
The refreshed service object
Throws:
RegistryException