All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Classes | Public Member Functions | Private Attributes | Static Private Attributes
javax.jmdns.impl.JmmDNSImpl Class Reference
Inheritance diagram for javax.jmdns.impl.JmmDNSImpl:
Inheritance graph
[legend]

List of all members.

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())

Detailed Description

This class enable multihomming mDNS. It will open a mDNS per IP address of the machine.

Author:
Cédrik Lime, Pierre Frisch

Definition at line 41 of file JmmDNSImpl.java.


Constructor & Destructor Documentation

Definition at line 67 of file JmmDNSImpl.java.


Member Function Documentation

Listen to network changes.

Parameters:
listenerlistener 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..

Parameters:
typefull qualified service type, such as _http._tcp.local..
listenerlistener for service updates
See also:
javax.jmdns.JmDNS::addServiceListener(java.lang.String, javax.jmdns.ServiceListener)

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.

Parameters:
listenerlistener for service types
Exceptions:
IOException
See also:
javax.jmdns.JmDNS::addServiceTypeListener(javax.jmdns.ServiceTypeListener)

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.

Returns:
list of host names
See also:
javax.jmdns.JmDNS::getHostName()

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.

Returns:
list of Internet Address
Exceptions:
IOException
See also:
javax.jmdns.JmDNS::getInetAddress()

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.

Returns:
list of Internet Address
Exceptions:
IOException
See also:
javax.jmdns.JmDNS::getInterface()
Deprecated:
do not use this implementation yields unpredictable results use getInetAddresses()

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.

Returns:
list of name of the JmDNS
See also:
javax.jmdns.JmDNS::getName()

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.

Parameters:
typefully qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
Returns:
list of service info. If no service info is found the list is empty.
See also:
javax.jmdns.JmDNS::getServiceInfo(java.lang.String, java.lang.String)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
timeouttimeout in milliseconds. Typical timeout should be 5s.
Returns:
list of service info. If no service info is found the list is empty.
See also:
javax.jmdns.JmDNS::getServiceInfo(java.lang.String, java.lang.String, long)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
Returns:
list of service info. If no service info is found the list is empty.
See also:
javax.jmdns.JmDNS::getServiceInfo(java.lang.String, java.lang.String, boolean)

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.

A network address has been added.

Parameters:
eventThe NetworkTopologyEvent providing the name and fully qualified type of the service.

A network address has been added.

Parameters:
eventThe NetworkTopologyEvent providing the name and fully qualified type of the service.

Implements javax.jmdns.NetworkTopologyListener.

Definition at line 538 of file JmmDNSImpl.java.

A network address has been removed.

Parameters:
eventThe NetworkTopologyEvent providing the name and fully qualified type of the service.

A network address has been removed.

Parameters:
eventThe 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.

Parameters:
typeService type name, such as _http._tcp.local..
Returns:
An array of service instance.
See also:
javax.jmdns.JmDNS::list(java.lang.String)

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.

Parameters:
typeService type name, such as _http._tcp.local..
Returns:
A dictionary of service info by subtypes.
See also:
javax.jmdns.JmDNS::listBySubtype(java.lang.String)

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.

Returns list of network change listeners

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.

Parameters:
infoservice info to register
Exceptions:
IOException
See also:
javax.jmdns.JmDNS::registerService(javax.jmdns.ServiceInfo)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local..
See also:
javax.jmdns.JmDNS::registerServiceType(java.lang.String)

Implements javax.jmdns.JmmDNS.

Definition at line 399 of file JmmDNSImpl.java.

Remove listener for network changes.

Parameters:
listenerlistener 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.

Parameters:
typefull qualified service type, such as _http._tcp.local..
listenerlistener for service updates
See also:
javax.jmdns.JmDNS::removeServiceListener(java.lang.String, javax.jmdns.ServiceListener)

Implements javax.jmdns.JmmDNS.

Definition at line 325 of file JmmDNSImpl.java.

Remove listener for service types.

Parameters:
listenerlistener for service types
See also:
javax.jmdns.JmDNS::removeServiceTypeListener(javax.jmdns.ServiceTypeListener)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
See also:
javax.jmdns.JmDNS::requestServiceInfo(java.lang.String, java.lang.String)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
See also:
javax.jmdns.JmDNS::requestServiceInfo(java.lang.String, java.lang.String, boolean)

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.

Parameters:
typefull qualified service type, such as _http._tcp.local. .
nameunqualified service name, such as foobar .
timeouttimeout in milliseconds
See also:
javax.jmdns.JmDNS::requestServiceInfo(java.lang.String, java.lang.String, long)

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.

Unregister all services.

See also:
javax.jmdns.JmDNS::unregisterAllServices()

Implements javax.jmdns.JmmDNS.

Definition at line 385 of file JmmDNSImpl.java.

Unregister a service. The service should have been registered.

Parameters:
infoservice info to remove
See also:
javax.jmdns.JmDNS::unregisterService(javax.jmdns.ServiceInfo)

Implements javax.jmdns.JmmDNS.

Definition at line 370 of file JmmDNSImpl.java.


Member Data Documentation

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.

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.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


zeroconf_jmdns
Author(s): Daniel Stonier
autogenerated on Tue Nov 6 2012 13:08:27