Package org.xbill.DNS

Class SRVRecord

java.lang.Object
org.xbill.DNS.Record
org.xbill.DNS.SRVRecord
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Record>

public class SRVRecord extends Record
Server Selection Record - finds hosts running services in a domain. An SRV record will normally be named _<service>._<protocol>.domain - examples would be _sips._tcp.example.org (for the secure SIP protocol) and _http._tcp.example.com (if HTTP used SRV records)
Author:
Brian Wellington
See Also:
  • Constructor Details

    • SRVRecord

      public SRVRecord(Name name, int dclass, long ttl, int priority, int weight, int port, Name target)
      Creates an SRV Record from the given data
      Parameters:
      priority - The priority of this SRV. Records with lower priority are preferred.
      weight - The weight, used to select between records at the same priority.
      port - The TCP/UDP port that the service uses
      target - The host running the service
  • Method Details

    • rrFromWire

      protected void rrFromWire(DNSInput in) throws IOException
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden
      Specified by:
      rrFromWire in class Record
      Throws:
      IOException
    • rdataFromString

      protected void rdataFromString(Tokenizer st, Name origin) throws IOException
      Description copied from class: Record
      Converts the text format of an RR to the internal format - must be overriden
      Specified by:
      rdataFromString in class Record
      Throws:
      IOException
    • rrToString

      protected String rrToString()
      Converts rdata to a String
      Specified by:
      rrToString in class Record
    • getPriority

      public int getPriority()
      Returns the priority
    • getWeight

      public int getWeight()
      Returns the weight
    • getPort

      public int getPort()
      Returns the port that the service runs on
    • getTarget

      public Name getTarget()
      Returns the host running that the service
    • rrToWire

      protected void rrToWire(DNSOutput out, Compression c, boolean canonical)
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden.
      Specified by:
      rrToWire in class Record
    • getAdditionalName

      public Name getAdditionalName()
      Description copied from class: Record
      Returns the name for which additional data processing should be done for this record. This can be used both for building responses and parsing responses.
      Overrides:
      getAdditionalName in class Record
      Returns:
      The name to used for additional data processing, or null if this record type does not require additional data processing.