Class SrvRecord

java.lang.Object
org.jivesoftware.openfire.net.SrvRecord
All Implemented Interfaces:
Serializable

@Immutable public class SrvRecord extends Object implements Serializable
A (partial) representation of an SRV record, containing an (unresolved) hostname, port, priority and weight attributes. It is expected to be used primarily to represent the result of an SRV query. This representation does not include other attributes of an SRV record, such as the service name, transport protocol and time-to-live. An indicator is included that signals if the address is to be used with DirectTLS (as opposed to STARTTLS) encryption. This value can be thought of as being a derivative of the 'service' that was looked up, as for example, a lookup result for 'xmpp-server' would not be DirectTLS, as opposed to a lookup result for 'xmpps-server', that would be DirectTLS
Author:
Guus der Kinderen, guus@goodbytes.nl
See Also:
  • Constructor Details

    • SrvRecord

      public SrvRecord(@Nonnull String hostname, int port, boolean isDirectTLS)
    • SrvRecord

      public SrvRecord(@Nonnull String hostname, int port, boolean isDirectTLS, int priority, int weight)
  • Method Details

    • from

      public static SrvRecord from(@Nonnull String[] srvRecordEntries, boolean directTLS)
    • getHostname

      public String getHostname()
    • getPort

      public int getPort()
    • isDirectTLS

      public boolean isDirectTLS()
    • getPriority

      public int getPriority()
    • getWeight

      public int getWeight()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • prioritize

      public static List<Set<SrvRecord>> prioritize(SrvRecord[] records)
    • prioritize

      public static List<Set<SrvRecord>> prioritize(Collection<SrvRecord> records)