public class HostInfo extends java.lang.Object implements DNSStatefulObject
DNSStatefulObject.DefaultImplementation, DNSStatefulObject.DNSStatefulObjectSemaphore| Modifier and Type | Field and Description |
|---|---|
protected java.net.InetAddress |
_address |
protected java.net.NetworkInterface |
_interfaze |
protected java.lang.String |
_name |
| Modifier and Type | Method and Description |
|---|---|
boolean |
advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.
|
java.util.Collection<DNSRecord> |
answers(boolean unique,
int ttl) |
void |
associateWithTask(DNSTask task,
DNSState state)
Sets the task associated with this Object.
|
boolean |
cancelState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
boolean |
closeState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
boolean |
conflictWithRecord(DNSRecord.Address record) |
JmDNSImpl |
getDns()
Returns the DNS associated with this object.
|
java.net.InetAddress |
getInetAddress() |
java.net.NetworkInterface |
getInterface() |
java.lang.String |
getName() |
boolean |
isAnnounced()
Returns true, if this is an announced state.
|
boolean |
isAnnouncing()
Returns true, if this is an announcing state.
|
boolean |
isAssociatedWithTask(DNSTask task,
DNSState state)
Checks if this object is associated with the task and in the same state.
|
boolean |
isCanceled()
Returns true, if this is a canceled state.
|
boolean |
isCanceling()
Returns true, if this is a canceling state.
|
boolean |
isClosed()
Returns true, if this is a closed state.
|
boolean |
isClosing()
Returns true, if this is a closing state.
|
boolean |
isProbing()
Returns true, if this is a probing state.
|
static HostInfo |
newHostInfo(java.net.InetAddress address,
JmDNSImpl dns,
java.lang.String jmdnsName) |
boolean |
recoverState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
void |
removeAssociationWithTask(DNSTask task)
Remove the association of the task with this Object.
|
boolean |
revertState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
java.lang.String |
toString() |
boolean |
waitForAnnounced(long timeout)
Waits for the object to be announced.
|
boolean |
waitForCanceled(long timeout)
Waits for the object to be canceled.
|
protected java.lang.String _name
protected java.net.InetAddress _address
protected java.net.NetworkInterface _interfaze
public static HostInfo newHostInfo(java.net.InetAddress address, JmDNSImpl dns, java.lang.String jmdnsName)
address - IP address to binddns - JmDNS instancejmdnsName - JmDNS namepublic java.lang.String getName()
public java.net.InetAddress getInetAddress()
public java.net.NetworkInterface getInterface()
public boolean conflictWithRecord(DNSRecord.Address record)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Collection<DNSRecord> answers(boolean unique, int ttl)
public JmDNSImpl getDns()
getDns in interface DNSStatefulObjectpublic boolean advanceState(DNSTask task)
advanceState in interface DNSStatefulObjecttask - associated tasktruefalse otherwise.DNSState.advance()public void removeAssociationWithTask(DNSTask task)
removeAssociationWithTask in interface DNSStatefulObjecttask - associated taskpublic boolean revertState()
revertState in interface DNSStatefulObjecttruefalse otherwise.DNSState.revert()public void associateWithTask(DNSTask task, DNSState state)
associateWithTask in interface DNSStatefulObjecttask - associated taskstate - state of the taskpublic boolean isAssociatedWithTask(DNSTask task, DNSState state)
isAssociatedWithTask in interface DNSStatefulObjecttask - associated taskstate - state of the tasktrue is the task is associated with this object, false otherwise.public boolean cancelState()
cancelState in interface DNSStatefulObjecttruefalse otherwise.public boolean closeState()
closeState in interface DNSStatefulObjecttruefalse otherwise.public boolean recoverState()
recoverState in interface DNSStatefulObjecttruefalse otherwise.public boolean isProbing()
isProbing in interface DNSStatefulObjecttrue if probing state, false otherwisepublic boolean isAnnouncing()
isAnnouncing in interface DNSStatefulObjecttrue if announcing state, false otherwisepublic boolean isAnnounced()
isAnnounced in interface DNSStatefulObjecttrue if announced state, false otherwisepublic boolean isCanceling()
isCanceling in interface DNSStatefulObjecttrue if canceling state, false otherwisepublic boolean isCanceled()
isCanceled in interface DNSStatefulObjecttrue if canceled state, false otherwisepublic boolean isClosing()
isClosing in interface DNSStatefulObjecttrue if closing state, false otherwisepublic boolean isClosed()
isClosed in interface DNSStatefulObjecttrue if closed state, false otherwisepublic boolean waitForAnnounced(long timeout)
waitForAnnounced in interface DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is announced, false otherwisepublic boolean waitForCanceled(long timeout)
waitForCanceled in interface DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is canceled, false otherwise