Classes | |
class | Factory |
Public Member Functions | |
abstract void | addNetworkTopologyListener (NetworkTopologyListener listener) |
abstract void | addServiceListener (String type, ServiceListener listener) |
abstract void | addServiceTypeListener (ServiceTypeListener listener) throws IOException |
abstract String[] | getHostNames () |
abstract InetAddress[] | getInetAddresses () throws IOException |
abstract InetAddress[] | getInterfaces () throws IOException |
abstract String[] | getNames () |
abstract ServiceInfo[] | getServiceInfos (String type, String name) |
abstract ServiceInfo[] | getServiceInfos (String type, String name, long timeout) |
abstract ServiceInfo[] | getServiceInfos (String type, String name, boolean persistent) |
abstract ServiceInfo[] | getServiceInfos (String type, String name, boolean persistent, long timeout) |
abstract boolean | isClosed () |
abstract ServiceInfo[] | list (String type) |
abstract ServiceInfo[] | list (String type, long timeout) |
abstract Map< String, ServiceInfo[]> | listBySubtype (String type) |
abstract Map< String, ServiceInfo[]> | listBySubtype (String type, long timeout) |
abstract NetworkTopologyListener[] | networkListeners () |
abstract void | registerService (ServiceInfo info) throws IOException |
abstract void | registerServiceType (String type) |
abstract void | removeNetworkTopologyListener (NetworkTopologyListener listener) |
abstract void | removeServiceListener (String type, ServiceListener listener) |
abstract void | removeServiceTypeListener (ServiceTypeListener listener) |
abstract void | requestServiceInfo (String type, String name) |
abstract void | requestServiceInfo (String type, String name, boolean persistent) |
abstract void | requestServiceInfo (String type, String name, long timeout) |
abstract void | requestServiceInfo (String type, String name, boolean persistent, long timeout) |
abstract void | unregisterAllServices () |
abstract void | unregisterService (ServiceInfo info) |
Java Multihomed Multicast DNS Uses an underlying JmDNS instance for each InetAddress found on this computer.
This class will monitor network topology changes, and will create or destroy JmDNS instances as required. It is your responsibility to maintain services registration (hint: use a NetworkTopologyListener).
Most of this class methods have no notion of transaction: if an Exception is raised in the middle of execution, you may be in an incoherent state.
Note: This API is experimental and may change in the future please let us know what work and what does not work in you application.
Definition at line 27 of file JmmDNS.java.
abstract void javax.jmdns.JmmDNS.addNetworkTopologyListener | ( | NetworkTopologyListener | listener | ) | [pure virtual] |
Listen to network changes.
listener | listener for network changes |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.addServiceListener | ( | String | type, |
ServiceListener | listener | ||
) | [pure virtual] |
Listen for services of a given type. The type has to be a fully qualified type name such as _http._tcp.local.
.
type | full qualified service type, such as _http._tcp.local. . |
listener | listener for service updates |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.addServiceTypeListener | ( | ServiceTypeListener | listener | ) | throws IOException [pure virtual] |
Listen for service types.
listener | listener for service types |
IOException |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract String [] javax.jmdns.JmmDNS.getHostNames | ( | ) | [pure virtual] |
Return the list HostName associated with this JmmDNS instance.
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract InetAddress [] javax.jmdns.JmmDNS.getInetAddresses | ( | ) | throws IOException [pure virtual] |
Return the list of addresses of the interface to which this instance of JmmDNS is bound.
IOException |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract InetAddress [] javax.jmdns.JmmDNS.getInterfaces | ( | ) | throws IOException [pure virtual] |
Return the list of addresses of the interface to which this instance of JmmDNS is bound.
IOException |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract String [] javax.jmdns.JmmDNS.getNames | ( | ) | [pure virtual] |
Return the names of the JmDNS instances.
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.getServiceInfos | ( | String | type, |
String | name | ||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received on all DNS.
Usage note: Do not call this method from the AWT event dispatcher thread. You will make the user interface unresponsive.
type | fully qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.getServiceInfos | ( | String | type, |
String | name, | ||
long | timeout | ||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received on all DNS.
Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
timeout | timeout in milliseconds. Typical timeout should be 5s. |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.getServiceInfos | ( | String | type, |
String | name, | ||
boolean | persistent | ||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received on all DNS.
Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.getServiceInfos | ( | String | type, |
String | name, | ||
boolean | persistent, | ||
long | timeout | ||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received on all DNS.
Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
timeout | timeout in milliseconds. Typical timeout should be 5s. |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
abstract boolean javax.jmdns.JmmDNS.isClosed | ( | ) | [pure virtual] |
Flag indicating if this object has been closed or not.
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.list | ( | String | type | ) | [pure virtual] |
Returns a list of service infos of the specified type.
type | Service type name, such as _http._tcp.local. . |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract ServiceInfo [] javax.jmdns.JmmDNS.list | ( | String | type, |
long | timeout | ||
) | [pure virtual] |
Returns a list of service infos of the specified type.
type | Service type name, such as _http._tcp.local. . |
timeout | timeout in milliseconds. Typical timeout should be 6s. |
abstract Map<String, ServiceInfo[]> javax.jmdns.JmmDNS.listBySubtype | ( | String | type | ) | [pure virtual] |
Returns a list of service infos of the specified type sorted by subtype. Any service that do not register a subtype is listed in the empty subtype section.
type | Service type name, such as _http._tcp.local. . |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract Map<String, ServiceInfo[]> javax.jmdns.JmmDNS.listBySubtype | ( | String | type, |
long | timeout | ||
) | [pure virtual] |
Returns a list of service infos of the specified type sorted by subtype. Any service that do not register a subtype is listed in the empty subtype section.
type | Service type name, such as _http._tcp.local. . |
timeout | timeout in milliseconds. Typical timeout should be 6s. |
abstract NetworkTopologyListener [] javax.jmdns.JmmDNS.networkListeners | ( | ) | [pure virtual] |
Returns list of network change listeners
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.registerService | ( | ServiceInfo | info | ) | throws IOException [pure virtual] |
Register a service. The service is registered for access by other jmdns clients. The name of the service may be changed to make it unique.
Note the Service info is cloned for each network interface.
info | service info to register |
IOException |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.registerServiceType | ( | String | type | ) | [pure virtual] |
Register a service type. If this service type was not already known, all service listeners will be notified of the new service type. Service types are automatically registered as they are discovered.
type | full qualified service type, such as _http._tcp.local. . |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.removeNetworkTopologyListener | ( | NetworkTopologyListener | listener | ) | [pure virtual] |
Remove listener for network changes.
listener | listener for network changes |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.removeServiceListener | ( | String | type, |
ServiceListener | listener | ||
) | [pure virtual] |
Remove listener for services of a given type.
type | full qualified service type, such as _http._tcp.local. . |
listener | listener for service updates |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.removeServiceTypeListener | ( | ServiceTypeListener | listener | ) | [pure virtual] |
Remove listener for service types.
listener | listener for service types |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.requestServiceInfo | ( | String | type, |
String | name | ||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.requestServiceInfo | ( | String | type, |
String | name, | ||
boolean | persistent | ||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.requestServiceInfo | ( | String | type, |
String | name, | ||
long | timeout | ||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
timeout | timeout in milliseconds |
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.requestServiceInfo | ( | String | type, |
String | name, | ||
boolean | persistent, | ||
long | timeout | ||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . |
name | unqualified service name, such as foobar . |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
timeout | timeout in milliseconds |
abstract void javax.jmdns.JmmDNS.unregisterAllServices | ( | ) | [pure virtual] |
Unregister all services.
Implemented in javax.jmdns.impl.JmmDNSImpl.
abstract void javax.jmdns.JmmDNS.unregisterService | ( | ServiceInfo | info | ) | [pure virtual] |
Unregister a service. The service should have been registered.
info | service info to remove |
Implemented in javax.jmdns.impl.JmmDNSImpl.