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.- Author:
- Pierre Frisch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract voidprotected voidAssociate the DNS host and the service infos with this task if not already associated and in the same state.protected abstract DNSOutgoingprotected abstract DNSOutgoingbuildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) protected abstract booleanprotected abstract DNSOutgoingstatic intabstract Stringprotected DNSStateintgetTTL()protected abstract voidprotected voidRemove the DNS host and service info association with this task.voidrun()static voidsetDefaultTTL(int value) For testing only do not use in production.protected voidsetTaskState(DNSState taskState) Methods inherited from class javax.jmdns.impl.tasks.DNSTask
addAdditionalAnswer, addAnswer, addAnswer, addAuthoritativeAnswer, addQuestion, getDns, getName, start, toStringMethods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
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
-