Package javax.jmdns.impl.tasks
Class DNSTask
- java.lang.Object
-
- java.util.TimerTask
-
- javax.jmdns.impl.tasks.DNSTask
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
DNSResolverTask,DNSStateTask,RecordReaper,Responder
public abstract class DNSTask extends java.util.TimerTaskThis is the root class for all task scheduled by the timer in JmDNS.
-
-
Field Summary
Fields Modifier and Type Field Description private JmDNSImpl_jmDNSImpl
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DNSOutgoingaddAdditionalAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec)Add an additional answer to the record.DNSOutgoingaddAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec)Add an answer if it is not suppressed.DNSOutgoingaddAnswer(DNSOutgoing out, DNSRecord rec, long now)Add an answer to the message.DNSOutgoingaddAuthoritativeAnswer(DNSOutgoing out, DNSRecord rec)Add an authoritative answer to the message.DNSOutgoingaddQuestion(DNSOutgoing out, DNSQuestion rec)Add a question to the message.JmDNSImplgetDns()Return the DNS associated with this task.abstract java.lang.StringgetName()Return this task name.abstract voidstart(java.util.Timer timer)Start this task.java.lang.StringtoString()
-
-
-
Field Detail
-
_jmDNSImpl
private final JmDNSImpl _jmDNSImpl
-
-
Constructor Detail
-
DNSTask
protected DNSTask(JmDNSImpl jmDNSImpl)
- Parameters:
jmDNSImpl-
-
-
Method Detail
-
getDns
public JmDNSImpl getDns()
Return the DNS associated with this task.- Returns:
- associated DNS
-
start
public abstract void start(java.util.Timer timer)
Start this task.- Parameters:
timer- task timer.
-
getName
public abstract java.lang.String getName()
Return this task name.- Returns:
- task name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
addQuestion
public DNSOutgoing addQuestion(DNSOutgoing out, DNSQuestion rec) throws java.io.IOException
Add a question to the message.- Parameters:
out- outgoing messagerec- DNS question- Returns:
- outgoing message for the next question
- Throws:
java.io.IOException
-
addAnswer
public DNSOutgoing addAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec) throws java.io.IOException
Add an answer if it is not suppressed.- Parameters:
out- outgoing messagein- incoming requestrec- DNS record answer- Returns:
- outgoing message for the next answer
- Throws:
java.io.IOException
-
addAnswer
public DNSOutgoing addAnswer(DNSOutgoing out, DNSRecord rec, long now) throws java.io.IOException
Add an answer to the message.- Parameters:
out- outgoing messagerec- DNS record answernow-- Returns:
- outgoing message for the next answer
- Throws:
java.io.IOException
-
addAuthoritativeAnswer
public DNSOutgoing addAuthoritativeAnswer(DNSOutgoing out, DNSRecord rec) throws java.io.IOException
Add an authoritative answer to the message.- Parameters:
out- outgoing messagerec- DNS record answer- Returns:
- outgoing message for the next answer
- Throws:
java.io.IOException
-
addAdditionalAnswer
public DNSOutgoing addAdditionalAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec) throws java.io.IOException
Add an additional answer to the record. Omit if there is no room.- Parameters:
out- outgoing messagein- incoming requestrec- DNS record answer- Returns:
- outgoing message for the next answer
- Throws:
java.io.IOException
-
-