Package javax.jmdns.impl.tasks.state
Class DNSStateTask
java.lang.Object
java.util.TimerTask
javax.jmdns.impl.tasks.DNSTask
javax.jmdns.impl.tasks.state.DNSStateTask
- All Implemented Interfaces:
Runnable
This is the root class for all state tasks. These tasks work with objects that implements the
DNSStatefulObject
interface and therefore participate in the state machine.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static int
private DNSState
The state of the task.private final int
By setting a 0 ttl we effectively expire the record.(package private) static org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected abstract void
protected void
Associate the DNS host and the service infos with this task if not already associated and in the same state.protected abstract DNSOutgoing
protected abstract DNSOutgoing
buildOutgoingForInfo
(ServiceInfoImpl info, DNSOutgoing out) protected abstract boolean
protected abstract DNSOutgoing
static int
abstract String
protected DNSState
int
getTTL()
protected abstract void
protected void
Remove the DNS host and service info association with this task.void
run()
static void
setDefaultTTL
(int value) For testing only do not use in production.protected void
setTaskState
(DNSState taskState) Methods inherited from class javax.jmdns.impl.tasks.DNSTask
addAdditionalAnswer, addAnswer, addAnswer, addAuthoritativeAnswer, addQuestion, getDns, getName, start, toString
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Field Details
-
logger
static org.slf4j.Logger logger -
_ttl
private final int _ttlBy setting a 0 ttl we effectively expire the record. -
_defaultTTL
private static int _defaultTTL -
_taskState
The state of the task.
-
-
Constructor Details
-
DNSStateTask
- Parameters:
jmDNSImpl
-ttl
-
-
-
Method Details
-
getTaskDescription
-
defaultTTL
public static int defaultTTL() -
setDefaultTTL
public static void setDefaultTTL(int value) For testing only do not use in production.- Parameters:
value
-
-
getTTL
public int getTTL()- Returns:
- the ttl
-
associate
Associate the DNS host and the service infos with this task if not already associated and in the same state.- Parameters:
state
- target state
-
removeAssociation
protected void removeAssociation()Remove the DNS host and service info association with this task. -
run
public void run() -
checkRunCondition
protected abstract boolean checkRunCondition() -
buildOutgoingForDNS
- Throws:
IOException
-
buildOutgoingForInfo
protected abstract DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException - Throws:
IOException
-
createOugoing
-
advanceObjectsState
-
recoverTask
-
advanceTask
protected abstract void advanceTask() -
getTaskState
- Returns:
- the taskState
-
setTaskState
- Parameters:
taskState
- the taskState to set
-