JmDNS 3.4.1

javax.jmdns.impl
Class DNSMessage

java.lang.Object
  extended by javax.jmdns.impl.DNSMessage
Direct Known Subclasses:
DNSIncoming, DNSOutgoing

public abstract class DNSMessage
extends Object

DNSMessage define a DNS message either incoming or outgoing.

Author:
Werner Randelshofer, Rick Blair, Pierre Frisch

Field Summary
protected  List<DNSRecord> _additionals
           
protected  List<DNSRecord> _answers
           
protected  List<DNSRecord> _authoritativeAnswers
           
protected  List<DNSQuestion> _questions
           
static boolean MULTICAST
           
static boolean UNICAST
           
 
Constructor Summary
protected DNSMessage(int flags, int id, boolean multicast)
           
 
Method Summary
 Collection<? extends DNSRecord> getAdditionals()
           
 Collection<? extends DNSRecord> getAllAnswers()
           
 Collection<? extends DNSRecord> getAnswers()
           
 Collection<? extends DNSRecord> getAuthorities()
           
 int getFlags()
           
 int getId()
           
 int getNumberOfAdditionals()
           
 int getNumberOfAnswers()
           
 int getNumberOfAuthorities()
           
 int getNumberOfQuestions()
           
 Collection<? extends DNSQuestion> getQuestions()
           
 boolean isEmpty()
          Check if the message is empty
 boolean isMulticast()
           
 boolean isQuery()
          Check if the message is a query.
 boolean isResponse()
          Check if the message is a response.
 boolean isTruncated()
          Check if the message is truncated.
protected  String print(byte[] data)
          Debugging.
 void setFlags(int flags)
           
 void setId(int id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MULTICAST

public static final boolean MULTICAST
See Also:
Constant Field Values

UNICAST

public static final boolean UNICAST
See Also:
Constant Field Values

_questions

protected final List<DNSQuestion> _questions

_answers

protected final List<DNSRecord> _answers

_authoritativeAnswers

protected final List<DNSRecord> _authoritativeAnswers

_additionals

protected final List<DNSRecord> _additionals
Constructor Detail

DNSMessage

protected DNSMessage(int flags,
                     int id,
                     boolean multicast)
Parameters:
flags -
id -
multicast -
Method Detail

getId

public int getId()
Returns:
message id

setId

public void setId(int id)
Parameters:
id - the id to set

getFlags

public int getFlags()
Returns:
message flags

setFlags

public void setFlags(int flags)
Parameters:
flags - the flags to set

isMulticast

public boolean isMulticast()
Returns:
true if multicast

getQuestions

public Collection<? extends DNSQuestion> getQuestions()
Returns:
list of questions

getNumberOfQuestions

public int getNumberOfQuestions()
Returns:
number of questions in the message

getAllAnswers

public Collection<? extends DNSRecord> getAllAnswers()

getAnswers

public Collection<? extends DNSRecord> getAnswers()
Returns:
list of answers

getNumberOfAnswers

public int getNumberOfAnswers()
Returns:
number of answers in the message

getAuthorities

public Collection<? extends DNSRecord> getAuthorities()
Returns:
list of authorities

getNumberOfAuthorities

public int getNumberOfAuthorities()
Returns:
number of authorities in the message

getAdditionals

public Collection<? extends DNSRecord> getAdditionals()
Returns:
list of additional answers

getNumberOfAdditionals

public int getNumberOfAdditionals()
Returns:
number of additional in the message

isTruncated

public boolean isTruncated()
Check if the message is truncated.

Returns:
true if the message was truncated

isQuery

public boolean isQuery()
Check if the message is a query.

Returns:
true is the message is a query

isResponse

public boolean isResponse()
Check if the message is a response.

Returns:
true is the message is a response

isEmpty

public boolean isEmpty()
Check if the message is empty

Returns:
true is the message is empty

print

protected String print(byte[] data)
Debugging.

Parameters:
data -
Returns:
data dump

Last updated 2011-08-25 12:40

Copyright © 2002-2011 JmDNS. All Rights Reserved.