Package javax.jmdns.impl.tasks
Class DNSTask
java.lang.Object
java.util.TimerTask
javax.jmdns.impl.tasks.DNSTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
DNSResolverTask
,DNSStateTask
,RecordReaper
,Responder
This is the root class for all task scheduled by the timer in JmDNS.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalAnswer
(DNSOutgoing out, DNSIncoming in, DNSRecord rec) Add an additional answer to the record.addAnswer
(DNSOutgoing out, DNSIncoming in, DNSRecord rec) Add an answer if it is not suppressed.addAnswer
(DNSOutgoing out, DNSRecord rec, long now) Add an answer to the message.addAuthoritativeAnswer
(DNSOutgoing out, DNSRecord rec) Add an authoritative answer to the message.addQuestion
(DNSOutgoing out, DNSQuestion rec) Add a question to the message.getDns()
Return the DNS associated with this task.abstract String
getName()
Return this task name.abstract void
Start this task.toString()
Methods inherited from class java.util.TimerTask
cancel, run, scheduledExecutionTime
-
Field Details
-
_jmDNSImpl
-
-
Constructor Details
-
DNSTask
- Parameters:
jmDNSImpl
-
-
-
Method Details
-
getDns
Return the DNS associated with this task.- Returns:
- associated DNS
-
start
Start this task.- Parameters:
timer
- task timer.
-
getName
Return this task name.- Returns:
- task name
-
toString
-
addQuestion
Add a question to the message.- Parameters:
out
- outgoing messagerec
- DNS question- Returns:
- outgoing message for the next question
- Throws:
IOException
-
addAnswer
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:
IOException
-
addAnswer
Add an answer to the message.- Parameters:
out
- outgoing messagerec
- DNS record answernow
-- Returns:
- outgoing message for the next answer
- Throws:
IOException
-
addAuthoritativeAnswer
Add an authoritative answer to the message.- Parameters:
out
- outgoing messagerec
- DNS record answer- Returns:
- outgoing message for the next answer
- Throws:
IOException
-
addAdditionalAnswer
public DNSOutgoing addAdditionalAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec) throws 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:
IOException
-