|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.zeroconf.jmdns.JmDNS
public class JmDNS
mDNS implementation in Java.
| Nested Class Summary | |
|---|---|
class |
JmDNS.Canceler
The Canceler sends two announces with TTL=0 for the specified services. |
(package private) class |
JmDNS.SocketListener
Listen for multicast packets. |
| Field Summary | |
|---|---|
protected boolean |
closed
Used to fix live lock problem on unregester. |
(package private) HostInfo |
localHost
Handle on the local host |
(package private) Map<String,ServiceInfo> |
services
This hashtable holds the services that have been registered. |
(package private) Map<String,String> |
serviceTypes
This hashtable holds the service types that have been registered or that have been received in an incoming datagram. |
(package private) TimerTask |
task
Timer task associated to the host name. |
static String |
VERSION
The version of JmDNS. |
| Constructor Summary | |
|---|---|
JmDNS()
Create an instance of JmDNS. |
|
JmDNS(InetAddress addr)
Create an instance of JmDNS and bind it to a specific network interface given its IP-address. |
|
| Method Summary | |
|---|---|
(package private) DNSOutgoing |
addAnswer(DNSIncoming in,
InetAddress addr,
int port,
DNSOutgoing out,
DNSRecord rec)
Add an answer to a question. |
void |
addListener(DNSListener listener,
DNSQuestion question)
Add a listener for a question. |
void |
addServiceListener(String type,
ServiceListener listener)
Listen for services of a given type. |
void |
addServiceTypeListener(ServiceTypeListener listener)
Listen for service types. |
(package private) void |
advanceState()
Sets the state and notifies all objects that wait on JmDNS. |
(package private) void |
cancel()
Sets the state and notifies all objects that wait on JmDNS. |
void |
close()
Close down jmdns. |
(package private) DNSCache |
getCache()
Return the DNSCache associated with the cache variable |
String |
getHostName()
Return the HostName associated with this JmDNS instance. |
InetAddress |
getInterface()
Return the address of the interface to which this instance of JmDNS is bound. |
HostInfo |
getLocalHost()
|
ServiceInfo |
getLocalService(String FQN)
SC-Bonjour Implementation: Method to retrieve the DNS Entry corresponding to a service that has been declared and return it as a ServiceInfo structure. |
ServiceInfo |
getServiceInfo(String type,
String name)
Get service information. |
ServiceInfo |
getServiceInfo(String type,
String name,
int timeout)
Get service information. |
(package private) DNSState |
getState()
Returns the current state of this info. |
(package private) void |
handleServiceResolved(ServiceInfo info)
|
(package private) String |
incrementName(String name)
|
ServiceInfo[] |
list(String type)
Returns a list of service infos of the specified type. |
(package private) void |
print()
List cache entries, for debugging only. |
void |
printServices()
List Services and serviceTypes. |
protected void |
recover()
Recover jmdns when there is an error. |
void |
registerService(ServiceInfo info)
Register a service. |
void |
registerServiceType(String type)
Register a service type. |
(package private) void |
removeListener(DNSListener listener)
Remove a listener from all outstanding questions. |
void |
removeServiceListener(String type,
ServiceListener listener)
Remove listener for services of a given type. |
void |
removeServiceTypeListener(ServiceTypeListener listener)
Remove listener for service types. |
void |
requestServiceInfo(String type,
String name)
Request service information. |
void |
requestServiceInfo(String type,
String name,
int timeout)
Request service information. |
(package private) void |
revertState()
Sets the state and notifies all objects that wait on JmDNS. |
String |
toString()
|
void |
unregisterAllServices()
Unregister all services. |
void |
unregisterService(ServiceInfo info)
Unregister a service. |
void |
updateInfos(ServiceInfo info,
byte[] old)
SC-Bonjour Implementation : Method used to update the corresponding DNS entry in the cache of JmDNS with the new information in this ServiceInfo. |
(package private) void |
updateRecord(long now,
DNSRecord rec)
Notify all listeners that a record was updated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static String VERSION
protected boolean closed
Map<String,ServiceInfo> services
Map<String,String> serviceTypes
HostInfo localHost
TimerTask task
| Constructor Detail |
|---|
public JmDNS()
throws IOException
IOException
public JmDNS(InetAddress addr)
throws IOException
addr -
IOException| Method Detail |
|---|
void advanceState()
void revertState()
void cancel()
DNSState getState()
DNSCache getCache()
public String getHostName()
public HostInfo getLocalHost()
public InetAddress getInterface()
throws IOException
IOException
public ServiceInfo getServiceInfo(String type,
String name)
type - fully qualified service type,
such as _http._tcp.local. .name - unqualified service name, such as foobar .
public ServiceInfo getServiceInfo(String type,
String name,
int timeout)
type - full qualified service type,
such as _http._tcp.local. .name - unqualified service name, such as foobar .timeout - timeout in milliseconds
public void requestServiceInfo(String type,
String name)
type - full qualified service type,
such as _http._tcp.local. .name - unqualified service name, such as foobar .
public void requestServiceInfo(String type,
String name,
int timeout)
type - full qualified service type,
such as _http._tcp.local. .name - unqualified service name, such as foobar .timeout - timeout in millisecondsvoid handleServiceResolved(ServiceInfo info)
public void addServiceTypeListener(ServiceTypeListener listener)
throws IOException
listener - listener for service types
IOExceptionpublic void removeServiceTypeListener(ServiceTypeListener listener)
listener - listener for service types
public void addServiceListener(String type,
ServiceListener listener)
_http._tcp.local..
type - full qualified service type,
such as _http._tcp.local..listener - listener for service updates
public void removeServiceListener(String type,
ServiceListener listener)
type - of listener to be removedlistener - listener for service updates
public void registerService(ServiceInfo info)
throws IOException
info - of service
IOExceptionpublic void unregisterService(ServiceInfo info)
info - of servicepublic void unregisterAllServices()
public void registerServiceType(String type)
type - of serviceString incrementName(String name)
public void addListener(DNSListener listener,
DNSQuestion question)
listener - to be addedquestion - - which the listener is responsible for.void removeListener(DNSListener listener)
void updateRecord(long now,
DNSRecord rec)
DNSOutgoing addAnswer(DNSIncoming in,
InetAddress addr,
int port,
DNSOutgoing out,
DNSRecord rec)
throws IOException
IOExceptionprotected void recover()
public void close()
void print()
public void printServices()
public String toString()
toString in class Objectpublic ServiceInfo[] list(String type)
type - Service type name, such as _http._tcp.local..
public void updateInfos(ServiceInfo info,
byte[] old)
info - Updated service data to be used to replace the old
stuff contained in JmDNS' cacheold - info bytespublic ServiceInfo getLocalService(String FQN)
FQN - String representing the Fully Qualified name of the service we want info about
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||