Package org.eclipse.ecf.provider.dnssd
Class DnsSdDiscoveryAdvertiser
- java.lang.Object
-
- org.eclipse.ecf.core.AbstractContainer
-
- org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
-
- org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryContainerAdapter
-
- org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryAdvertiser
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,IContainer
,IIdentifiable
,IDiscoveryAdvertiser
,IDiscoveryLocator
public class DnsSdDiscoveryAdvertiser extends DnsSdDiscoveryContainerAdapter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryContainerAdapter
DnsSdDiscoveryContainerAdapter.SRVRecordComparator
-
-
Field Summary
-
Fields inherited from class org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryContainerAdapter
resolver, targetID
-
Fields inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
allServiceListeners, serviceListeners, servicesNamespaceName, serviceTypeListeners
-
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser
CONTAINER_NAME
-
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocator
CONTAINER_NAME
-
-
Constructor Summary
Constructors Constructor Description DnsSdDiscoveryAdvertiser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(ID aTargetID, IConnectContext connectContext)
Connect to a target remote process or process group.protected Collection
getAuthoritativeNameServer(org.xbill.DNS.Name zone)
String
getContainerName()
protected String[]
getRegistrationDomains(IServiceTypeID aServiceTypeId)
protected Collection
getUpdateDomain(org.xbill.DNS.Name zone)
IServiceInfo[]
purgeCache()
Purges the underlying IServiceInfo cache if available in the current providervoid
registerService(IServiceInfo serviceInfo)
Register the given service.protected void
sendToServer(IServiceInfo serviceInfo, boolean mode)
void
unregisterAllServices()
Unregister all previously registered service.void
unregisterService(IServiceInfo serviceInfo)
Unregister a previously registered service defined by serviceInfo.-
Methods inherited from class org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryContainerAdapter
disconnect, getBrowsingOrRegistrationDomains, getConnectedID, getRecords, getSearchPath, getServiceInfo, getServices, getServices, getServiceTypes, getSRVRecord, getSRVRecords, getSRVRecords, setResolver, setSearchPath, setTsigKey
-
Methods inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
addServiceListener, addServiceListener, addServiceTypeListener, clearListeners, dispose, fireServiceDiscovered, fireServiceTypeDiscovered, fireServiceUndiscovered, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getConfig, getConnectNamespace, getID, getListeners, getServiceEvent, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
-
Methods inherited from class org.eclipse.ecf.core.AbstractContainer
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener
-
-
-
-
Method Detail
-
registerService
public void registerService(IServiceInfo serviceInfo)
Description copied from interface:IDiscoveryAdvertiser
Register the given service. This publishes the service defined by the serviceInfo to the underlying publishing mechanism- Specified by:
registerService
in interfaceIDiscoveryAdvertiser
- Overrides:
registerService
in classDnsSdDiscoveryContainerAdapter
- Parameters:
serviceInfo
- IServiceInfo of the service to be published. Must not benull
.
-
unregisterService
public void unregisterService(IServiceInfo serviceInfo)
Description copied from interface:IDiscoveryAdvertiser
Unregister a previously registered service defined by serviceInfo.- Specified by:
unregisterService
in interfaceIDiscoveryAdvertiser
- Overrides:
unregisterService
in classDnsSdDiscoveryContainerAdapter
- Parameters:
serviceInfo
- IServiceInfo defining the service to unregister. Must not benull
.
-
unregisterAllServices
public void unregisterAllServices()
Description copied from interface:IDiscoveryAdvertiser
Unregister all previously registered service.- Specified by:
unregisterAllServices
in interfaceIDiscoveryAdvertiser
- Overrides:
unregisterAllServices
in classAbstractDiscoveryContainerAdapter
- See Also:
IDiscoveryAdvertiser.unregisterAllServices()
-
purgeCache
public IServiceInfo[] purgeCache()
Description copied from interface:IDiscoveryLocator
Purges the underlying IServiceInfo cache if available in the current provider- Specified by:
purgeCache
in interfaceIDiscoveryLocator
- Overrides:
purgeCache
in classAbstractDiscoveryContainerAdapter
- Returns:
- The previous cache content
- See Also:
IDiscoveryLocator.purgeCache()
-
connect
public void connect(ID aTargetID, IConnectContext connectContext) throws ContainerConnectException
Description copied from interface:IContainer
Connect 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.- Specified by:
connect
in interfaceIContainer
- Specified by:
connect
in classDnsSdDiscoveryContainerAdapter
- Parameters:
aTargetID
- 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 benull
if 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.
-
sendToServer
protected void sendToServer(IServiceInfo serviceInfo, boolean mode)
-
getUpdateDomain
protected Collection getUpdateDomain(org.xbill.DNS.Name zone) throws org.xbill.DNS.TextParseException
- Throws:
org.xbill.DNS.TextParseException
-
getAuthoritativeNameServer
protected Collection getAuthoritativeNameServer(org.xbill.DNS.Name zone) throws org.xbill.DNS.TextParseException
- Throws:
org.xbill.DNS.TextParseException
-
getRegistrationDomains
protected String[] getRegistrationDomains(IServiceTypeID aServiceTypeId)
-
getContainerName
public String getContainerName()
- Specified by:
getContainerName
in classAbstractDiscoveryContainerAdapter
- Returns:
- The name of this discovery container
-
-