Package org.eclipse.ecf.discovery
Interface IDiscoveryLocator
- 
- All Superinterfaces:
- org.eclipse.core.runtime.IAdaptable
 - All Known Subinterfaces:
- IDiscoveryContainerAdapter,- IDiscoveryService
 - All Known Implementing Classes:
- AbstractDiscoveryContainerAdapter,- DnsSdDiscoveryAdvertiser,- DnsSdDiscoveryContainerAdapter,- DnsSdDiscoveryLocator,- JSLPDiscoveryContainer,- ZooDiscoveryContainer
 
 public interface IDiscoveryLocator extends org.eclipse.core.runtime.IAdaptableEntry point discovery locator. This interface exposes the ability to add/remove listeners for newly discovered services and service types, and get (synch) and request (asynchronous) service info from a remote service provider.This interface can be used by container provider implementations as an adapter so that calls to IContainer.getAdapter(IDiscoveryLocator.class) will return a non-null instance of a class that implements this interface. Clients can then proceed to use this interface to interact with the given discovery implementation. - Since:
- 3.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCONTAINER_NAMEThe name of the discovery container under which it is registered with the OSGi runtime as a service property
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddServiceListener(IServiceTypeID type, IServiceListener listener)Add a service listener.voidaddServiceListener(IServiceListener listener)Add a service listener.voidaddServiceTypeListener(IServiceTypeListener listener)Add a service type listener.org.eclipse.equinox.concurrent.future.IFuturegetAsyncServiceInfo(IServiceID aServiceID)Asynchronously retrieve info about the serviceorg.eclipse.equinox.concurrent.future.IFuturegetAsyncServices()Asynchronously get service info about all known servicesorg.eclipse.equinox.concurrent.future.IFuturegetAsyncServices(IServiceTypeID aServiceTypeID)Asynchronously get service info about all known services of given service typeorg.eclipse.equinox.concurrent.future.IFuturegetAsyncServiceTypes()Asynchronously get service info about all known services of given service typeIServiceInfogetServiceInfo(IServiceID aServiceID)Synchronously retrieve info about the serviceIServiceInfo[]getServices()Synchronously get service info about all known servicesIServiceInfo[]getServices(IServiceTypeID aServiceTypeID)Synchronously get service info about all known services of given service typeNamespacegetServicesNamespace()Get a Namespace for services associated with this discovery container adapter.IServiceTypeID[]getServiceTypes()Synchronously get service info about all known services of given service typeIServiceInfo[]purgeCache()Purges the underlying IServiceInfo cache if available in the current providervoidremoveServiceListener(IServiceTypeID type, IServiceListener listener)Remove a service listener.voidremoveServiceListener(IServiceListener listener)Remove a service listener.voidremoveServiceTypeListener(IServiceTypeListener listener)Remove a service type listener.
 
- 
- 
- 
Field Detail- 
CONTAINER_NAMEstatic final String CONTAINER_NAME The name of the discovery container under which it is registered with the OSGi runtime as a service property- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getServiceInfoIServiceInfo getServiceInfo(IServiceID aServiceID) Synchronously retrieve info about the service- Parameters:
- aServiceID- IServiceID of the service to get info about. Must not be- null.
- Returns:
- IServiceInfo the service info retrieved. nullif no information retrievable.
 
 - 
getServicesIServiceInfo[] getServices() Synchronously get service info about all known services- Returns:
- IServiceInfo[] the resulting array of service info instances.
         Will not be null. May be of length 0.
 
 - 
getServicesIServiceInfo[] getServices(IServiceTypeID aServiceTypeID) Synchronously get service info about all known services of given service type- Parameters:
- aServiceTypeID- IServiceTypeID defining the type of service we are interested in getting service info about. Must not be- null
- Returns:
- IServiceInfo[] the resulting array of service info instances.
         Will not be null. May be of length 0.
 
 - 
getServiceTypesIServiceTypeID[] getServiceTypes() Synchronously get service info about all known services of given service type- Returns:
- IServiceTypeID[] the resulting array of service type IDs. Will
         not be null. May be of length 0.
 
 - 
getServicesNamespaceNamespace getServicesNamespace() Get a Namespace for services associated with this discovery container adapter. The given Namespace may be used via IServiceIDFactory to create IServiceIDs rather than simple IDs. For example:IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(), serviceType, serviceName);- Returns:
- Namespace for creating service IDs. Will not be null.
 
 - 
purgeCacheIServiceInfo[] purgeCache() Purges the underlying IServiceInfo cache if available in the current provider- Returns:
- The previous cache content
 
 - 
addServiceListenervoid addServiceListener(IServiceListener listener) Add a service listener. The given listener will have its method called when a service is discovered.- Parameters:
- listener- IServiceListener to be notified. Must not be- null.
 
 - 
addServiceListenervoid addServiceListener(IServiceTypeID type, IServiceListener listener) Add a service listener. The given listener will have its method called when a service with a type matching that specified by the first parameter is discovered.- Parameters:
- type- String type to listen for. Must not be- null. Must be formatted according to this specific IDiscoveryContainer
- listener- IServiceListener to be notified. Must not be- null.
 
 - 
addServiceTypeListenervoid addServiceTypeListener(IServiceTypeListener listener) Add a service type listener. The given listener will have its method called when a service type is discovered.- Parameters:
- listener- the listener to be notified. Must not be- null.
 
 - 
removeServiceListenervoid removeServiceListener(IServiceListener listener) Remove a service listener. Remove the listener from this container- Parameters:
- listener- IServiceListener listener to be removed. Must not be- null.
 
 - 
removeServiceListenervoid removeServiceListener(IServiceTypeID type, IServiceListener listener) Remove a service listener. Remove the listener associated with the type specified by the first parameter.- Parameters:
- type- String of the desired type to remove the listener. Must not be- null. Must be formatted according to this specific IDiscoveryContainer
- listener- IServiceListener listener to be removed. Must not be- null.
 
 - 
removeServiceTypeListenervoid removeServiceTypeListener(IServiceTypeListener listener) Remove a service type listener. Remove the type listener.- Parameters:
- listener- IServiceTypeListener to be removed. Must not be- null.
 
 - 
getAsyncServiceInfoorg.eclipse.equinox.concurrent.future.IFuture getAsyncServiceInfo(IServiceID aServiceID) Asynchronously retrieve info about the service- Parameters:
- aServiceID- IServiceID of the service to get info about. Must not be- null.
- Returns:
- IFuture a future status wrapping an IServiceInfo or
         nullif no information retrievable.
 
 - 
getAsyncServicesorg.eclipse.equinox.concurrent.future.IFuture getAsyncServices() Asynchronously get service info about all known services- Returns:
- IFuture wrapping an IServiceTypeID[]. The resulting array of
         service type IDs will not be null. May be of length 0.
 
 - 
getAsyncServicesorg.eclipse.equinox.concurrent.future.IFuture getAsyncServices(IServiceTypeID aServiceTypeID) Asynchronously get service info about all known services of given service type- Parameters:
- aServiceTypeID- IServiceTypeID defining the type of service we are interested in getting service info about. Must not be- null
- Returns:
- IFuture wrapping an IServiceTypeID[]. The resulting array of
         service type IDs will not be null. May be of length 0.
 
 - 
getAsyncServiceTypesorg.eclipse.equinox.concurrent.future.IFuture getAsyncServiceTypes() Asynchronously get service info about all known services of given service type- Returns:
- IFuture wrapping an IServiceTypeID[]. The resulting array of
         service type IDs will not be null. May be of length 0.
 
 
- 
 
-