|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.jmdns.JmDNS
javax.jmdns.impl.JmDNSImpl
public class JmDNSImpl
mDNS implementation in Java.
Nested Class Summary | |
---|---|
protected class |
JmDNSImpl.Shutdown
Shutdown operations. |
Field Summary | |
---|---|
protected java.lang.Thread |
_shutdown
This is the shutdown hook, we registered with the java runtime. |
Fields inherited from class javax.jmdns.JmDNS |
---|
VERSION |
Constructor Summary | |
---|---|
JmDNSImpl()
Create an instance of JmDNS. |
|
JmDNSImpl(java.net.InetAddress address)
Create an instance of JmDNS and bind it to a specific network interface given its IP-address. |
Method Summary | |
---|---|
DNSOutgoing |
addAnswer(DNSIncoming in,
java.net.InetAddress addr,
int port,
DNSOutgoing out,
DNSRecord rec)
Add an answer to a question. |
void |
addListener(javax.jmdns.impl.DNSListener listener,
DNSQuestion question)
Add a listener for a question. |
void |
addServiceListener(java.lang.String type,
ServiceListener listener)
Listen for services of a given type. |
void |
addServiceTypeListener(ServiceTypeListener listener)
Listen for service types. |
void |
advanceState()
Sets the state and notifies all objects that wait on JmDNS. |
void |
close()
Close down jmdns. |
DNSCache |
getCache()
Return the DNSCache associated with the cache variable |
java.net.InetAddress |
getGroup()
|
java.lang.String |
getHostName()
Return the HostName associated with this JmDNS instance. |
java.net.InetAddress |
getInterface()
Return the address of the interface to which this instance of JmDNS is bound. |
java.lang.Object |
getIoLock()
|
long |
getLastThrottleIncrement()
|
HostInfo |
getLocalHost()
Returns the local host info |
DNSIncoming |
getPlannedAnswer()
|
static java.util.Random |
getRandom()
|
ServiceInfo |
getServiceInfo(java.lang.String type,
java.lang.String name)
Get service information. |
ServiceInfo |
getServiceInfo(java.lang.String type,
java.lang.String name,
int timeout)
Get service information. |
java.util.Map<java.lang.String,ServiceInfo> |
getServices()
|
java.util.Map<java.lang.String,java.lang.String> |
getServiceTypes()
|
java.net.MulticastSocket |
getSocket()
|
javax.jmdns.impl.constants.DNSState |
getState()
Returns the current state of this info. |
java.util.TimerTask |
getTask()
|
int |
getThrottle()
|
boolean |
isClosed()
|
ServiceInfo[] |
list(java.lang.String type)
Returns a list of service infos of the specified type. |
void |
printServices()
List Services and serviceTypes. |
void |
recover()
Recover jmdns when there is an error. |
void |
registerService(ServiceInfo infoAbstract)
Register a service. |
void |
registerServiceType(java.lang.String type)
Register a service type. |
void |
removeListener(javax.jmdns.impl.DNSListener listener)
Remove a listener from all outstanding questions. |
void |
removeServiceListener(java.lang.String type,
ServiceListener listener)
Remove listener for services of a given type. |
void |
removeServiceTypeListener(ServiceTypeListener listener)
Remove listener for service types. |
void |
requestServiceInfo(java.lang.String type,
java.lang.String name)
Request service information. |
void |
requestServiceInfo(java.lang.String type,
java.lang.String name,
int timeout)
Request service information. |
void |
schedule(java.util.TimerTask task,
int delay)
|
void |
send(DNSOutgoing out)
Send an outgoing multicast DNS message. |
void |
setClosed(boolean closed)
|
void |
setIoLock(java.lang.Object ioLock)
|
void |
setLastThrottleIncrement(long lastThrottleIncrement)
|
void |
setPlannedAnswer(DNSIncoming plannedAnswer)
|
void |
setState(javax.jmdns.impl.constants.DNSState state)
|
void |
setTask(java.util.TimerTask task)
|
void |
setThrottle(int throttle)
|
void |
startAnnouncer()
|
void |
startRenewer()
|
java.lang.String |
toString()
|
void |
unregisterAllServices()
Unregister all services. |
void |
unregisterService(ServiceInfo infoAbstract)
Unregister a service. |
void |
updateRecord(long now,
DNSRecord rec)
Notify all listeners that a record was updated. |
Methods inherited from class javax.jmdns.JmDNS |
---|
create, create |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Thread _shutdown
Constructor Detail |
---|
public JmDNSImpl() throws java.io.IOException
java.io.IOException
public JmDNSImpl(java.net.InetAddress address) throws java.io.IOException
address
-
java.io.IOException
Method Detail |
---|
public void advanceState()
public javax.jmdns.impl.constants.DNSState getState()
public DNSCache getCache()
public java.lang.String getHostName()
JmDNS
getHostName
in class JmDNS
public HostInfo getLocalHost()
public java.net.InetAddress getInterface() throws java.io.IOException
JmDNS
getInterface
in class JmDNS
java.io.IOException
public ServiceInfo getServiceInfo(java.lang.String type, java.lang.String name)
JmDNS
getServiceInfo
in class JmDNS
type
- fully qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.
public ServiceInfo getServiceInfo(java.lang.String type, java.lang.String name, int timeout)
JmDNS
getServiceInfo
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.timeout
- timeout in milliseconds
public void requestServiceInfo(java.lang.String type, java.lang.String name)
JmDNS
requestServiceInfo
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.public void requestServiceInfo(java.lang.String type, java.lang.String name, int timeout)
JmDNS
requestServiceInfo
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.timeout
- timeout in millisecondspublic void addServiceTypeListener(ServiceTypeListener listener) throws java.io.IOException
JmDNS
addServiceTypeListener
in class JmDNS
listener
- listener for service types
java.io.IOException
JmDNS.addServiceTypeListener(javax.jmdns.ServiceTypeListener )
public void removeServiceTypeListener(ServiceTypeListener listener)
JmDNS
removeServiceTypeListener
in class JmDNS
listener
- listener for service typespublic void addServiceListener(java.lang.String type, ServiceListener listener)
JmDNS
_http._tcp.local.
.
addServiceListener
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.listener
- listener for service updatespublic void removeServiceListener(java.lang.String type, ServiceListener listener)
JmDNS
removeServiceListener
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.listener
- listener for service updatespublic void registerService(ServiceInfo infoAbstract) throws java.io.IOException
JmDNS
registerService
in class JmDNS
infoAbstract
- service info to register
java.io.IOException
public void unregisterService(ServiceInfo infoAbstract)
JmDNS
unregisterService
in class JmDNS
infoAbstract
- service info to removepublic void unregisterAllServices()
JmDNS
unregisterAllServices
in class JmDNS
public void registerServiceType(java.lang.String type)
JmDNS
registerServiceType
in class JmDNS
type
- full qualified service type, such as _http._tcp.local.
.public void addListener(javax.jmdns.impl.DNSListener listener, DNSQuestion question)
listener
- DSN listenerquestion
- DNS querypublic void removeListener(javax.jmdns.impl.DNSListener listener)
listener
- DSN listenerpublic void updateRecord(long now, DNSRecord rec)
now
- update daterec
- DNS recordpublic DNSOutgoing addAnswer(DNSIncoming in, java.net.InetAddress addr, int port, DNSOutgoing out, DNSRecord rec) throws java.io.IOException
in
- addr
- port
- out
- rec
-
java.io.IOException
public void send(DNSOutgoing out) throws java.io.IOException
out
-
java.io.IOException
public void startAnnouncer()
public void startRenewer()
public void schedule(java.util.TimerTask task, int delay)
public void recover()
public void close()
JmDNS
close
in class JmDNS
JmDNS.close()
public void printServices()
JmDNS
printServices
in class JmDNS
JmDNS.printServices()
public java.lang.String toString()
toString
in class java.lang.Object
public ServiceInfo[] list(java.lang.String type)
JmDNS
list
in class JmDNS
type
- Service type name, such as _http._tcp.local.
.
public void setState(javax.jmdns.impl.constants.DNSState state)
public void setTask(java.util.TimerTask task)
public java.util.TimerTask getTask()
public java.util.Map<java.lang.String,ServiceInfo> getServices()
public void setLastThrottleIncrement(long lastThrottleIncrement)
public long getLastThrottleIncrement()
public void setThrottle(int throttle)
public int getThrottle()
public static java.util.Random getRandom()
public void setIoLock(java.lang.Object ioLock)
public java.lang.Object getIoLock()
public void setPlannedAnswer(DNSIncoming plannedAnswer)
public DNSIncoming getPlannedAnswer()
public java.util.Map<java.lang.String,java.lang.String> getServiceTypes()
public void setClosed(boolean closed)
public boolean isClosed()
public java.net.MulticastSocket getSocket()
public java.net.InetAddress getGroup()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |