Top Inners Constructors Methods
com.mysql.cj.util

public Class DnsSrv

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Properties, .Random, java.util.stream.Collectors, javax.naming.Context, .NamingException, javax.naming.directory.Attribute, .Attributes, .DirContext, .InitialDirContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static List<DnsSrv.SrvRecord>
lookupSrvRecords(String serviceName)

public static List<DnsSrv.SrvRecord>

Returns:

a new list of sorted SrvRecords.
sortSrvRecords
(List<DnsSrv.SrvRecord>
the list of SrvRecords to sort.
srvRecords
)

Sort a list of DNS SRV records according to the sorting rules described in rfc2782.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DnsSrvback to summary
public DnsSrv()

Method Detail

lookupSrvRecordsback to summary
public static List<DnsSrv.SrvRecord> lookupSrvRecords(String serviceName) throws NamingException
sortSrvRecordsback to summary
public static List<DnsSrv.SrvRecord> sortSrvRecords(List<DnsSrv.SrvRecord> srvRecords)

Sort a list of DNS SRV records according to the sorting rules described in rfc2782.

Parameters
srvRecords:List<DnsSrv.SrvRecord>

the list of SrvRecords to sort.

Returns:List<DnsSrv.SrvRecord>

a new list of sorted SrvRecords.

com.mysql.cj.util back to summary

public Class DnsSrv.SrvRecord

extends Object
implements Comparable<DnsSrv.SrvRecord>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
SrvRecord(int priority, int weight, int port, String target)

Method Summary

Modifier and TypeMethod and Description
public static DnsSrv.SrvRecord
buildFrom(String srvLine)

public int
compareTo(DnsSrv.SrvRecord
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public int
public int
public String
public int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

portback to summary
private final int port
priorityback to summary
private final int priority
targetback to summary
private final String target
weightback to summary
private final int weight

Constructor Detail

SrvRecordback to summary
public SrvRecord(int priority, int weight, int port, String target)

Method Detail

buildFromback to summary
public static DnsSrv.SrvRecord buildFrom(String srvLine)
compareToback to summary
public int compareTo(DnsSrv.SrvRecord o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:DnsSrv.SrvRecord

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
getPortback to summary
public int getPort()
getPriorityback to summary
public int getPriority()
getTargetback to summary
public String getTarget()
getWeightback to summary
public int getWeight()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override