JmDNS 3.4.1

javax.jmdns.impl
Class DNSOutgoing

java.lang.Object
  extended by javax.jmdns.impl.DNSMessage
      extended by javax.jmdns.impl.DNSOutgoing

public final class DNSOutgoing
extends DNSMessage

An outgoing DNS message.

Author:
Arthur van Hoff, Rick Blair, Werner Randelshofer

Nested Class Summary
static class DNSOutgoing.MessageOutputStream
           
 
Field Summary
static boolean USE_DOMAIN_NAME_COMPRESSION
          This can be used to turn off domain name compression.
 
Fields inherited from class javax.jmdns.impl.DNSMessage
_additionals, _answers, _authoritativeAnswers, _questions, MULTICAST, UNICAST
 
Constructor Summary
DNSOutgoing(int flags)
          Create an outgoing multicast query or response.
DNSOutgoing(int flags, boolean multicast)
          Create an outgoing query or response.
DNSOutgoing(int flags, boolean multicast, int senderUDPPayload)
          Create an outgoing query or response.
 
Method Summary
 void addAdditionalAnswer(DNSIncoming in, DNSRecord rec)
          Add an additional answer to the record.
 void addAnswer(DNSIncoming in, DNSRecord rec)
          Add an answer if it is not suppressed.
 void addAnswer(DNSRecord rec, long now)
          Add an answer to the message.
 void addAuthorativeAnswer(DNSRecord rec)
          Add an authoritative answer to the message.
 void addQuestion(DNSQuestion rec)
          Add a question to the message.
 int availableSpace()
          Return the number of byte available in the message.
 byte[] data()
          Builds the final message buffer to be send and returns it.
 int getMaxUDPPayload()
           
 boolean isQuery()
          Check if the message is a query.
 String toString()
           
 
Methods inherited from class javax.jmdns.impl.DNSMessage
getAdditionals, getAllAnswers, getAnswers, getAuthorities, getFlags, getId, getNumberOfAdditionals, getNumberOfAnswers, getNumberOfAuthorities, getNumberOfQuestions, getQuestions, isEmpty, isMulticast, isResponse, isTruncated, print, setFlags, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USE_DOMAIN_NAME_COMPRESSION

public static boolean USE_DOMAIN_NAME_COMPRESSION
This can be used to turn off domain name compression. This was helpful for tracking problems interacting with other mdns implementations.

Constructor Detail

DNSOutgoing

public DNSOutgoing(int flags)
Create an outgoing multicast query or response.

Parameters:
flags -

DNSOutgoing

public DNSOutgoing(int flags,
                   boolean multicast)
Create an outgoing query or response.

Parameters:
flags -
multicast -

DNSOutgoing

public DNSOutgoing(int flags,
                   boolean multicast,
                   int senderUDPPayload)
Create an outgoing query or response.

Parameters:
flags -
multicast -
senderUDPPayload - The sender's UDP payload size is the number of bytes of the largest UDP payload that can be reassembled and delivered in the sender's network stack.
Method Detail

availableSpace

public int availableSpace()
Return the number of byte available in the message.

Returns:
available space

addQuestion

public void addQuestion(DNSQuestion rec)
                 throws IOException
Add a question to the message.

Parameters:
rec -
Throws:
IOException

addAnswer

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

Parameters:
in -
rec -
Throws:
IOException

addAnswer

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

Parameters:
rec -
now -
Throws:
IOException

addAuthorativeAnswer

public void addAuthorativeAnswer(DNSRecord rec)
                          throws IOException
Add an authoritative answer to the message.

Parameters:
rec -
Throws:
IOException

addAdditionalAnswer

public void addAdditionalAnswer(DNSIncoming in,
                                DNSRecord rec)
                         throws IOException
Add an additional answer to the record. Omit if there is no room.

Parameters:
in -
rec -
Throws:
IOException

data

public byte[] data()
Builds the final message buffer to be send and returns it.

Returns:
bytes to send.

isQuery

public boolean isQuery()
Description copied from class: DNSMessage
Check if the message is a query.

Overrides:
isQuery in class DNSMessage
Returns:
true is the message is a query

toString

public String toString()
Overrides:
toString in class Object

getMaxUDPPayload

public int getMaxUDPPayload()
Returns:
the maxUDPPayload

Last updated 2011-08-25 12:40

Copyright © 2002-2011 JmDNS. All Rights Reserved.