Class SrvUtil


  • public class SrvUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SrvUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<SRV> sortSrvRecords​(java.util.Collection<SRV> srvRecords)
      Sort the given collection of SRV resource records by their priority and weight.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • sortSrvRecords

        public static java.util.List<SRVsortSrvRecords​(java.util.Collection<SRV> srvRecords)
        Sort the given collection of SRV resource records by their priority and weight.

        Sorting by priority is easy. Sorting the buckets of SRV records with the same priority by weight requires to choose those records randomly but taking the weight into account.

        Parameters:
        srvRecords - a collection of SRV records.
        Returns:
        a sorted list of the given records.