Class SRV

  • All Implemented Interfaces:
    Data

    public class SRV
    extends java.lang.Object
    implements Data
    SRV record payload (service pointer).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String name
      The target server.
      protected int port
      The target port.
      protected int priority
      The priority of this service.
      protected int weight
      The weight of this service.
    • Constructor Summary

      Constructors 
      Constructor Description
      SRV()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      The name of the target server.
      int getPort()
      The target port of this service.
      int getPriority()
      The priority of this service.
      Record.TYPE getType()
      The payload type.
      int getWeight()
      The weight of this service.
      void parse​(java.io.DataInputStream dis, byte[] data, int length)
      Parse this payload.
      void setName​(java.lang.String name)
      Set the name of the target server.
      void setPort​(int port)
      Set the target port of this service.
      void setPriority​(int priority)
      Set the priority of this service entry.
      void setWeight​(int weight)
      Set the weight of this service.
      byte[] toByteArray()
      Binary representation of this payload.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • priority

        protected int priority
        The priority of this service.
      • weight

        protected int weight
        The weight of this service.
      • port

        protected int port
        The target port.
      • name

        protected java.lang.String name
        The target server.
    • Constructor Detail

      • SRV

        public SRV()
    • Method Detail

      • getPriority

        public int getPriority()
        The priority of this service. Lower values mean higher priority.
        Returns:
        The priority.
      • setPriority

        public void setPriority​(int priority)
        Set the priority of this service entry. Lower values have higher priority.
        Parameters:
        priority - The new priority.
      • getWeight

        public int getWeight()
        The weight of this service. Services with the same priority should be balanced based on weight.
        Returns:
        The weight of this service.
      • setWeight

        public void setWeight​(int weight)
        Set the weight of this service.
        Parameters:
        weight - The new weight of this service.
      • getPort

        public int getPort()
        The target port of this service.
        Returns:
        The target port of this service.
      • setPort

        public void setPort​(int port)
        Set the target port of this service.
        Parameters:
        port - The new target port.
      • getName

        public java.lang.String getName()
        The name of the target server.
        Returns:
        The target servers name.
      • setName

        public void setName​(java.lang.String name)
        Set the name of the target server.
        Parameters:
        name - The new target servers name.
      • toByteArray

        public byte[] toByteArray()
        Description copied from interface: Data
        Binary representation of this payload.
        Specified by:
        toByteArray in interface Data
        Returns:
        The binary representation of this payload.
      • parse

        public void parse​(java.io.DataInputStream dis,
                          byte[] data,
                          int length)
                   throws java.io.IOException
        Description copied from interface: Data
        Parse this payload.
        Specified by:
        parse in interface Data
        Parameters:
        dis - The input stream.
        data - The plain data (needed for name cross references).
        length - The payload length.
        Throws:
        java.io.IOException - on io error (read past paket boundary).
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getType

        public Record.TYPE getType()
        Description copied from interface: Data
        The payload type.
        Specified by:
        getType in interface Data
        Returns:
        The payload type.