Class SMessage

java.lang.Object
org.xbill.DNS.dnssec.SMessage

final class SMessage extends Object
This class represents a DNS message with validator state and some utility methods.
Since:
3.5
  • Field Details

  • Constructor Details

    • SMessage

      public SMessage(Header h)
      Creates a instance of this class.
      Parameters:
      h - The header of the original message.
    • SMessage

      public SMessage(int id, Record question)
      Creates a new instance of this class.
      Parameters:
      id - The ID of the DNS query or response message.
      question - The question section of the query or response.
    • SMessage

      public SMessage(Message m)
      Creates a new instance of this class.
      Parameters:
      m - The DNS message to wrap.
  • Method Details

    • getHeader

      public Header getHeader()
      Gets the header of this message.
      Returns:
      The header of this message.
    • getQuestion

      public Record getQuestion()
      Gets the question section of this message.
      Returns:
      The question section of this message.
    • getSectionRRsets

      public List<SRRset> getSectionRRsets(int section)
      Gets signed RRsets for the queried section.
      Parameters:
      section - The section whose RRsets are demanded.
      Returns:
      Signed RRsets for the queried section.
    • addRRset

      private void addRRset(SRRset srrset, int section)
    • checkSectionValidity

      private void checkSectionValidity(int section)
    • getSectionRRsets

      public List<SRRset> getSectionRRsets(int section, int qtype)
      Gets signed RRsets for the queried section.
      Parameters:
      section - The section whose RRsets are demanded.
      qtype - Filter the results for these record types.
      Returns:
      Signed RRsets for the queried section.
    • getRcode

      public int getRcode()
      Gets the result code of the response message.
      Returns:
      The result code of the response message.
    • getStatus

      public SecurityStatus getStatus()
      Gets the security status of this message.
      Returns:
      The security status of this message.
    • setStatus

      public void setStatus(SecurityStatus status, int edeReason)
      Sets the security status for this message.
      Parameters:
      status - the new security status for this message.
    • setStatus

      public void setStatus(SecurityStatus status, int edeReason, String reason)
      Sets the security status for this message.
      Parameters:
      status - the new security status for this message.
      reason - Why this message's status is set as indicated.
    • setBogus

      public void setBogus(String reason)
      Sets the security status of this message to bogus and sets the reason.
      Parameters:
      reason - Why this message's status is bogus.
    • setBogus

      public void setBogus(String reason, int edeReason)
      Sets the security status of this message to bogus and sets the reason.
      Parameters:
      reason - Why this message's status is bogus.
    • getBogusReason

      public String getBogusReason()
      Gets the reason why this messages' status is bogus.
      Returns:
      The reason why this messages' status is bogus.
    • getEdeReason

      public int getEdeReason()
      Gets the ExtendedErrorCodeOption reason why this messages' status is bogus.
    • getMessage

      public Message getMessage()
      Gets this message as a standard DNSJAVA message.
      Returns:
      This message as a standard DNSJAVA message.
    • getCount

      public int getCount(int section)
      Gets the number of records.
      Parameters:
      section - The section for which the records are counted.
      Returns:
      The number of records for the queried section.
    • findRRset

      public SRRset findRRset(Name name, int type, int dclass, int section)
      Find a specific (S)RRset in a given section.
      Parameters:
      name - the name of the RRset.
      type - the type of the RRset.
      dclass - the class of the RRset.
      section - the section to look in (ANSWER to ADDITIONAL)
      Returns:
      The SRRset if found, null otherwise.
    • findAnswerRRset

      public SRRset findAnswerRRset(Name qname, int qtype, int qclass)
      Find an "answer" RRset. This will look for RRsets in the ANSWER section that match the <qname,qtype,qclass>, without considering CNAMEs.
      Parameters:
      qname - The starting search name.
      qtype - The search type.
      qclass - The search class.
      Returns:
      a SRRset matching the query.