Class SRVDNSResolver

    • Constructor Detail

      • SRVDNSResolver

        public SRVDNSResolver()
        Default constructor.
      • SRVDNSResolver

        public SRVDNSResolver​(DNSContextFactory factory)
        Creates a new DNS address resolver.
        Parameters:
        factory - JNDI dir context factory
      • SRVDNSResolver

        public SRVDNSResolver​(DNSContextFactory factory,
                              boolean ssl)
        Creates a new DNS address resolver.
        Parameters:
        factory - JNDI dir context factory
        ssl - whether SRV records should produce LDAPS URLs
    • Method Detail

      • resolve

        public java.util.Set<SRVRecord> resolve​(java.lang.String name)
        Description copied from interface: DNSResolver
        Resolve a set of DNS records of some type for the given name.
        Specified by:
        resolve in interface DNSResolver<SRVRecord>
        Overrides:
        resolve in class AbstractDNSResolver<SRVRecord>
        Parameters:
        name - Name for which to resolve DNS records.
        Returns:
        Set of records of type T bound to the given name.
      • processRecords

        protected java.util.Set<SRVRecord> processRecords​(java.util.Set<java.lang.String> records)
        Description copied from class: AbstractDNSResolver
        Process a set of DNS records.
        Specified by:
        processRecords in class AbstractDNSResolver<SRVRecord>
        Parameters:
        records - Set of raw DNS records returned from a name query.
        Returns:
        Set of converted/processed records.
      • sortSrvRecords

        protected java.util.Set<SRVRecord> sortSrvRecords​(java.util.Set<SRVRecord> records)
        Sorts the supplied SRV records according to RFC 2782. Records with the lowest priority are first. Records with the same priority are arranged by weight with higher weights having a greater chance to be ordered first.
        Parameters:
        records - to sort
        Returns:
        sorted records