Package javax.jmdns.impl
Interface DNSStatefulObject
-
- All Known Implementing Classes:
DNSStatefulObject.DefaultImplementation
,HostInfo
,JmDNSImpl
,ServiceInfoImpl
public interface DNSStatefulObject
Sets of methods to manage the state machine.
Implementation note: This interface is accessed from multiple threads. The implementation must be thread safe.- Author:
- Pierre Frisch
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DNSStatefulObject.DefaultImplementation
static class
DNSStatefulObject.DNSStatefulObjectSemaphore
This class define a semaphore.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.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.JmDNSImpl
getDns()
Returns the DNS associated with this object.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.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.boolean
waitForAnnounced(long timeout)
Waits for the object to be announced.boolean
waitForCanceled(long timeout)
Waits for the object to be canceled.
-
-
-
Method Detail
-
getDns
JmDNSImpl getDns()
Returns the DNS associated with this object.- Returns:
- DNS resolver
-
associateWithTask
void associateWithTask(DNSTask task, DNSState state)
Sets the task associated with this Object.- Parameters:
task
- associated taskstate
- state of the task
-
removeAssociationWithTask
void removeAssociationWithTask(DNSTask task)
Remove the association of the task with this Object.- Parameters:
task
- associated task
-
isAssociatedWithTask
boolean isAssociatedWithTask(DNSTask task, DNSState state)
Checks if this object is associated with the task and in the same state.- Parameters:
task
- associated taskstate
- state of the task- Returns:
true
is the task is associated with this object,false
otherwise.
-
advanceState
boolean advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.- Parameters:
task
- associated task- Returns:
true
false otherwise.- See Also:
DNSState.advance()
-
revertState
boolean revertState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
true
false otherwise.- See Also:
DNSState.revert()
-
cancelState
boolean cancelState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
true
false otherwise.
-
closeState
boolean closeState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
true
false otherwise.
-
recoverState
boolean recoverState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
true
false otherwise.
-
isProbing
boolean isProbing()
Returns true, if this is a probing state.- Returns:
true
if probing state,false
otherwise
-
isAnnouncing
boolean isAnnouncing()
Returns true, if this is an announcing state.- Returns:
true
if announcing state,false
otherwise
-
isAnnounced
boolean isAnnounced()
Returns true, if this is an announced state.- Returns:
true
if announced state,false
otherwise
-
isCanceling
boolean isCanceling()
Returns true, if this is a canceling state.- Returns:
true
if canceling state,false
otherwise
-
isCanceled
boolean isCanceled()
Returns true, if this is a canceled state.- Returns:
true
if canceled state,false
otherwise
-
isClosing
boolean isClosing()
Returns true, if this is a closing state.- Returns:
true
if closing state,false
otherwise
-
isClosed
boolean isClosed()
Returns true, if this is a closed state.- Returns:
true
if closed state,false
otherwise
-
waitForAnnounced
boolean waitForAnnounced(long timeout)
Waits for the object to be announced.- Parameters:
timeout
- the maximum time to wait in milliseconds.- Returns:
true
if the object is announced,false
otherwise
-
waitForCanceled
boolean waitForCanceled(long timeout)
Waits for the object to be canceled.- Parameters:
timeout
- the maximum time to wait in milliseconds.- Returns:
true
if the object is canceled,false
otherwise
-
-