Package org.eclipse.ecf.provider.dnssd
Class DnsSdDiscoveryContainerAdapter
java.lang.Object
org.eclipse.ecf.core.AbstractContainer
org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryContainerAdapter
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,IContainer,IIdentifiable,IDiscoveryAdvertiser,IDiscoveryLocator
- Direct Known Subclasses:
DnsSdDiscoveryAdvertiser,DnsSdDiscoveryLocator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class -
Field Summary
FieldsFields inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
allServiceListeners, serviceListeners, servicesNamespaceName, serviceTypeListenersFields inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser
CONTAINER_NAMEFields inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocator
CONTAINER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDnsSdDiscoveryContainerAdapter(String aNamespaceName, DiscoveryContainerConfig aConfig) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidconnect(ID targetID, IConnectContext connectContext) Connect to a target remote process or process group.voidDisconnect.protected CollectiongetBrowsingOrRegistrationDomains(IServiceTypeID aServiceTypeId, String[] rrs) Get the target ID that this container instance has connected to.protected org.xbill.DNS.Record[]getRecords(DnsSdServiceTypeID serviceTypeId) String[]getServiceInfo(IServiceID aServiceId) Synchronously retrieve info about the serviceSynchronously get service info about all known servicesgetServices(IServiceTypeID aServiceTypeId) Synchronously get service info about all known services of given service typeSynchronously get service info about all known services of given service typeprotected SortedSetgetSRVRecord(org.xbill.DNS.Lookup query, Comparator aComparator) protected SortedSetgetSRVRecords(org.xbill.DNS.Lookup[] queries) protected SortedSetgetSRVRecords(org.xbill.DNS.Lookup[] queries, Comparator aComparator) voidregisterService(IServiceInfo serviceInfo) Register the given service.voidsetResolver(String aResolver) voidsetSearchPath(String[] searchPaths) voidsetTsigKey(String tsigKeyName, String tsigKey) voidunregisterService(IServiceInfo serviceInfo) Unregister a previously registered service defined by serviceInfo.Methods inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
addServiceListener, addServiceListener, addServiceTypeListener, clearListeners, dispose, fireServiceDiscovered, fireServiceTypeDiscovered, fireServiceUndiscovered, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getConfig, getConnectNamespace, getContainerName, getID, getListeners, getServiceEvent, getServicesNamespace, purgeCache, removeServiceListener, removeServiceListener, removeServiceTypeListener, unregisterAllServicesMethods inherited from class org.eclipse.ecf.core.AbstractContainer
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener
-
Field Details
-
resolver
protected org.xbill.DNS.Resolver resolver -
targetID
-
-
Constructor Details
-
DnsSdDiscoveryContainerAdapter
-
-
Method Details
-
getServiceInfo
Description copied from interface:IDiscoveryLocatorSynchronously retrieve info about the service- Parameters:
aServiceId- IServiceID of the service to get info about. Must not benull.- Returns:
- IServiceInfo the service info retrieved.
nullif no information retrievable.
-
getServiceTypes
Description copied from interface:IDiscoveryLocatorSynchronously 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.
-
getServices
Description copied from interface:IDiscoveryLocatorSynchronously 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.
-
getServices
Description copied from interface:IDiscoveryLocatorSynchronously 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 benull- Returns:
- IServiceInfo[] the resulting array of service info instances.
Will not be
null. May be of length 0.
-
registerService
Description copied from interface:IDiscoveryAdvertiserRegister the given service. This publishes the service defined by the serviceInfo to the underlying publishing mechanism- Parameters:
serviceInfo- IServiceInfo of the service to be published. Must not benull.
-
unregisterService
Description copied from interface:IDiscoveryAdvertiserUnregister a previously registered service defined by serviceInfo.- Parameters:
serviceInfo- IServiceInfo defining the service to unregister. Must not benull.
-
connect
public abstract void connect(ID targetID, IConnectContext connectContext) throws ContainerConnectException Description copied from interface:IContainerConnect to a target remote process or process group. The target identified by the first parameter (targetID) is connected the implementation class. If authentication information is required, the required information is given via via the second parameter (connectContext). Callers note that depending upon the provider implementation this method may block. It is suggested that callers use a separate thread to call this method. This method provides an implementation independent way for container implementations to connect, authenticate, and communicate with a remote service or group of services. Providers are responsible for implementing this operation in a way appropriate to the given remote service (or group) via expected protocol.- Parameters:
targetID- the ID of the remote server or group to connect to. SeeIContainer.getConnectNamespace()for a explanation of the constraints upon this parameter.connectContext- any required context to allow this container to authenticate. May benullif underlying provider does not have any authentication requirements for connection.- Throws:
ContainerConnectException- thrown if communication cannot be established with remote service. Causes can include network connection failure, authentication failure, server error, or if container is already connected.
-
getConnectedID
Description copied from interface:IContainerGet the target ID that this container instance has connected to. Returns null if not connected.- Returns:
- ID of the target we are connected to. Returns
nullif container not connected.
-
disconnect
public void disconnect()Description copied from interface:IContainerDisconnect. This operation will disconnect the local container instance from any previously joined target or group. Subsequent calls to getConnectedID() will returnnull. -
getBrowsingOrRegistrationDomains
-
getRecords
-
getSRVRecords
-
getSRVRecords
-
getSRVRecord
-
setSearchPath
- Parameters:
searchPaths- The default search path used for discovery
-
getSearchPath
- Returns:
- The default search path used by this discovery provider
-
setResolver
- Parameters:
aResolver- The resolver to use- Throws:
DnsSdDiscoveryException- if hostname cannot be resolved
-
setTsigKey
- Parameters:
tsigKeyName- A key name/user name for dns dynamic updatetsigKey- A string representation of the shared key
-