JmDNS 3.4.1

javax.jmdns.impl.tasks
Class DNSTask

java.lang.Object
  extended by java.util.TimerTask
      extended by javax.jmdns.impl.tasks.DNSTask
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DNSResolverTask, DNSStateTask, RecordReaper, Responder

public abstract class DNSTask
extends TimerTask

This is the root class for all task scheduled by the timer in JmDNS.

Author:
Pierre Frisch

Constructor Summary
protected DNSTask(JmDNSImpl jmDNSImpl)
           
 
Method Summary
 DNSOutgoing addAdditionalAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec)
          Add an additional answer to the record.
 DNSOutgoing addAnswer(DNSOutgoing out, DNSIncoming in, DNSRecord rec)
          Add an answer if it is not suppressed.
 DNSOutgoing addAnswer(DNSOutgoing out, DNSRecord rec, long now)
          Add an answer to the message.
 DNSOutgoing addAuthoritativeAnswer(DNSOutgoing out, DNSRecord rec)
          Add an authoritative answer to the message.
 DNSOutgoing addQuestion(DNSOutgoing out, DNSQuestion rec)
          Add a question to the message.
 JmDNSImpl getDns()
          Return the DNS associated with this task.
abstract  String getName()
          Return this task name.
abstract  void start(Timer timer)
          Start this task.
 String toString()
           
 
Methods inherited from class java.util.TimerTask
cancel, run, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(Timer timer)
Start this task.

Parameters:
timer - task timer.

getName

public abstract String getName()
Return this task name.

Returns:
task name

toString

public String toString()
Overrides:
toString in class Object

addQuestion

public DNSOutgoing addQuestion(DNSOutgoing out,
                               DNSQuestion rec)
                        throws IOException
Add a question to the message.

Parameters:
out - outgoing message
rec - DNS question
Returns:
outgoing message for the next question
Throws:
IOException

addAnswer

public DNSOutgoing addAnswer(DNSOutgoing out,
                             DNSIncoming in,
                             DNSRecord rec)
                      throws IOException
Add an answer if it is not suppressed.

Parameters:
out - outgoing message
in - incoming request
rec - DNS record answer
Returns:
outgoing message for the next answer
Throws:
IOException

addAnswer

public DNSOutgoing addAnswer(DNSOutgoing out,
                             DNSRecord rec,
                             long now)
                      throws IOException
Add an answer to the message.

Parameters:
out - outgoing message
rec - DNS record answer
now -
Returns:
outgoing message for the next answer
Throws:
IOException

addAuthoritativeAnswer

public DNSOutgoing addAuthoritativeAnswer(DNSOutgoing out,
                                          DNSRecord rec)
                                   throws IOException
Add an authoritative answer to the message.

Parameters:
out - outgoing message
rec - 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 message
in - incoming request
rec - DNS record answer
Returns:
outgoing message for the next answer
Throws:
IOException

Last updated 2011-08-25 12:40

Copyright © 2002-2011 JmDNS. All Rights Reserved.