Classes | |
class | NetworkChecker |
Public Member Functions | |
void | addNetworkTopologyListener (NetworkTopologyListener listener) |
void | addServiceListener (String type, ServiceListener listener) |
void | addServiceTypeListener (ServiceTypeListener listener) throws IOException |
void | close () throws IOException |
String[] | getHostNames () |
InetAddress[] | getInetAddresses () throws IOException |
InetAddress[] | getInterfaces () throws IOException |
String[] | getNames () |
ServiceInfo[] | getServiceInfos (String type, String name) |
ServiceInfo[] | getServiceInfos (String type, String name, long timeout) |
ServiceInfo[] | getServiceInfos (String type, String name, boolean persistent) |
ServiceInfo[] | getServiceInfos (final String type, final String name, final boolean persistent, final long timeout) |
void | inetAddressAdded (NetworkTopologyEvent event) |
void | inetAddressRemoved (NetworkTopologyEvent event) |
boolean | isClosed () |
JmmDNSImpl () | |
ServiceInfo[] | list (String type) |
ServiceInfo[] | list (final String type, final long timeout) |
Map< String, ServiceInfo[]> | listBySubtype (String type) |
Map< String, ServiceInfo[]> | listBySubtype (final String type, final long timeout) |
NetworkTopologyListener[] | networkListeners () |
void | registerService (ServiceInfo info) throws IOException |
void | registerServiceType (String type) |
void | removeNetworkTopologyListener (NetworkTopologyListener listener) |
void | removeServiceListener (String type, ServiceListener listener) |
void | removeServiceTypeListener (ServiceTypeListener listener) |
void | requestServiceInfo (String type, String name) |
void | requestServiceInfo (String type, String name, boolean persistent) |
void | requestServiceInfo (String type, String name, long timeout) |
void | requestServiceInfo (final String type, final String name, final boolean persistent, final long timeout) |
void | textValueUpdated (ServiceInfo target, byte[] value) |
void | unregisterAllServices () |
void | unregisterService (ServiceInfo info) |
Private Attributes | |
final ExecutorService | _jmDNSExecutor |
final ConcurrentMap < InetAddress, JmDNS > | _knownMDNS |
final ExecutorService | _ListenerExecutor |
final Set < NetworkTopologyListener > | _networkListeners |
final ConcurrentMap< String, ServiceInfo > | _services |
final Timer | _timer |
boolean | is_closed |
Static Private Attributes | |
static Logger | logger = Logger.getLogger(JmmDNSImpl.class.getName()) |
This class enable multihomming mDNS. It will open a mDNS per IP address of the machine.
Definition at line 41 of file JmmDNSImpl.java.
javax.jmdns.impl.JmmDNSImpl.JmmDNSImpl | ( | ) | [inline] |
Definition at line 67 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.addNetworkTopologyListener | ( | NetworkTopologyListener | listener | ) | [inline, virtual] |
Listen to network changes.
listener | listener for network changes |
Implements javax.jmdns.JmmDNS.
Definition at line 511 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.addServiceListener | ( | String | type, |
ServiceListener | listener | ||
) | [inline, 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 |
Implements javax.jmdns.JmmDNS.
Definition at line 305 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.addServiceTypeListener | ( | ServiceTypeListener | listener | ) | throws IOException [inline, virtual] |
Listen for service types.
listener | listener for service types |
IOException |
Implements javax.jmdns.JmmDNS.
Definition at line 283 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.close | ( | ) | throws IOException [inline] |
Definition at line 88 of file JmmDNSImpl.java.
String [] javax.jmdns.impl.JmmDNSImpl.getHostNames | ( | ) | [inline, virtual] |
Return the list HostName associated with this JmmDNS instance.
Implements javax.jmdns.JmmDNS.
Definition at line 140 of file JmmDNSImpl.java.
InetAddress [] javax.jmdns.impl.JmmDNSImpl.getInetAddresses | ( | ) | throws IOException [inline, virtual] |
Return the list of addresses of the interface to which this instance of JmmDNS is bound.
IOException |
Implements javax.jmdns.JmmDNS.
Definition at line 153 of file JmmDNSImpl.java.
InetAddress [] javax.jmdns.impl.JmmDNSImpl.getInterfaces | ( | ) | throws IOException [inline, virtual] |
Return the list of addresses of the interface to which this instance of JmmDNS is bound.
IOException |
Implements javax.jmdns.JmmDNS.
Definition at line 167 of file JmmDNSImpl.java.
String [] javax.jmdns.impl.JmmDNSImpl.getNames | ( | ) | [inline, virtual] |
Return the names of the JmDNS instances.
Implements javax.jmdns.JmmDNS.
Definition at line 127 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.getServiceInfos | ( | String | type, |
String | name | ||
) | [inline, 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 . |
Implements javax.jmdns.JmmDNS.
Definition at line 180 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.getServiceInfos | ( | String | type, |
String | name, | ||
long | timeout | ||
) | [inline, 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. |
Implements javax.jmdns.JmmDNS.
Definition at line 189 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.getServiceInfos | ( | String | type, |
String | name, | ||
boolean | persistent | ||
) | [inline, 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. |
Implements javax.jmdns.JmmDNS.
Definition at line 198 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.getServiceInfos | ( | final String | type, |
final String | name, | ||
final boolean | persistent, | ||
final long | timeout | ||
) | [inline] |
Definition at line 207 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.inetAddressAdded | ( | NetworkTopologyEvent | event | ) | [inline] |
A network address has been added.
event | The NetworkTopologyEvent providing the name and fully qualified type of the service. |
A network address has been added.
event | The NetworkTopologyEvent providing the name and fully qualified type of the service. |
Implements javax.jmdns.NetworkTopologyListener.
Definition at line 538 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.inetAddressRemoved | ( | NetworkTopologyEvent | event | ) | [inline] |
A network address has been removed.
event | The NetworkTopologyEvent providing the name and fully qualified type of the service. |
A network address has been removed.
event | The NetworkTopologyEvent providing the name and fully qualified type of the service. |
Implements javax.jmdns.NetworkTopologyListener.
Definition at line 568 of file JmmDNSImpl.java.
boolean javax.jmdns.impl.JmmDNSImpl.isClosed | ( | ) | [inline, virtual] |
Flag indicating if this object has been closed or not.
Implements javax.jmdns.JmmDNS.
Definition at line 79 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.list | ( | String | type | ) | [inline, virtual] |
Returns a list of service infos of the specified type.
type | Service type name, such as _http._tcp.local. . |
Implements javax.jmdns.JmmDNS.
Definition at line 410 of file JmmDNSImpl.java.
ServiceInfo [] javax.jmdns.impl.JmmDNSImpl.list | ( | final String | type, |
final long | timeout | ||
) | [inline] |
Definition at line 419 of file JmmDNSImpl.java.
Map<String, ServiceInfo[]> javax.jmdns.impl.JmmDNSImpl.listBySubtype | ( | String | type | ) | [inline, 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. . |
Implements javax.jmdns.JmmDNS.
Definition at line 478 of file JmmDNSImpl.java.
Map<String, ServiceInfo[]> javax.jmdns.impl.JmmDNSImpl.listBySubtype | ( | final String | type, |
final long | timeout | ||
) | [inline] |
Definition at line 487 of file JmmDNSImpl.java.
NetworkTopologyListener [] javax.jmdns.impl.JmmDNSImpl.networkListeners | ( | ) | [inline, virtual] |
Returns list of network change listeners
Implements javax.jmdns.JmmDNS.
Definition at line 529 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.registerService | ( | ServiceInfo | info | ) | throws IOException [inline, 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 |
Implements javax.jmdns.JmmDNS.
Definition at line 354 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.registerServiceType | ( | String | type | ) | [inline, 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. . |
Implements javax.jmdns.JmmDNS.
Definition at line 399 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.removeNetworkTopologyListener | ( | NetworkTopologyListener | listener | ) | [inline, virtual] |
Remove listener for network changes.
listener | listener for network changes |
Implements javax.jmdns.JmmDNS.
Definition at line 520 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.removeServiceListener | ( | String | type, |
ServiceListener | listener | ||
) | [inline, virtual] |
Remove listener for services of a given type.
type | full qualified service type, such as _http._tcp.local. . |
listener | listener for service updates |
Implements javax.jmdns.JmmDNS.
Definition at line 325 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.removeServiceTypeListener | ( | ServiceTypeListener | listener | ) | [inline, virtual] |
Remove listener for service types.
listener | listener for service types |
Implements javax.jmdns.JmmDNS.
Definition at line 294 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.requestServiceInfo | ( | String | type, |
String | name | ||
) | [inline, 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 . |
Implements javax.jmdns.JmmDNS.
Definition at line 236 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.requestServiceInfo | ( | String | type, |
String | name, | ||
boolean | persistent | ||
) | [inline, 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. |
Implements javax.jmdns.JmmDNS.
Definition at line 245 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.requestServiceInfo | ( | String | type, |
String | name, | ||
long | timeout | ||
) | [inline, 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 |
Implements javax.jmdns.JmmDNS.
Definition at line 254 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.requestServiceInfo | ( | final String | type, |
final String | name, | ||
final boolean | persistent, | ||
final long | timeout | ||
) | [inline] |
Definition at line 263 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.textValueUpdated | ( | ServiceInfo | target, |
byte[] | value | ||
) | [inline] |
Implements javax.jmdns.impl.ServiceInfoImpl.Delegate.
Definition at line 336 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.unregisterAllServices | ( | ) | [inline, virtual] |
Unregister all services.
Implements javax.jmdns.JmmDNS.
Definition at line 385 of file JmmDNSImpl.java.
void javax.jmdns.impl.JmmDNSImpl.unregisterService | ( | ServiceInfo | info | ) | [inline, virtual] |
Unregister a service. The service should have been registered.
info | service info to remove |
Implements javax.jmdns.JmmDNS.
Definition at line 370 of file JmmDNSImpl.java.
final ExecutorService javax.jmdns.impl.JmmDNSImpl._jmDNSExecutor [private] |
Definition at line 58 of file JmmDNSImpl.java.
final ConcurrentMap<InetAddress, JmDNS> javax.jmdns.impl.JmmDNSImpl._knownMDNS [private] |
Every JmDNS created.
Definition at line 49 of file JmmDNSImpl.java.
final ExecutorService javax.jmdns.impl.JmmDNSImpl._ListenerExecutor [private] |
Definition at line 56 of file JmmDNSImpl.java.
final Set<NetworkTopologyListener> javax.jmdns.impl.JmmDNSImpl._networkListeners [private] |
Definition at line 44 of file JmmDNSImpl.java.
final ConcurrentMap<String, ServiceInfo> javax.jmdns.impl.JmmDNSImpl._services [private] |
This enable the service info text update.
Definition at line 54 of file JmmDNSImpl.java.
final Timer javax.jmdns.impl.JmmDNSImpl._timer [private] |
Definition at line 60 of file JmmDNSImpl.java.
boolean javax.jmdns.impl.JmmDNSImpl.is_closed [private] |
Definition at line 62 of file JmmDNSImpl.java.
Logger javax.jmdns.impl.JmmDNSImpl.logger = Logger.getLogger(JmmDNSImpl.class.getName()) [static, private] |
Definition at line 42 of file JmmDNSImpl.java.