APIdia Launch Partner
Top Description Constructors Methods
javax.naming.ldap.spi

public abstract Class LdapDnsProvider

extends Object
Class Inheritance
Imports
javax.naming.Context, .NamingException, java.util.Map, .Optional

Service-provider class for DNS lookups when performing LDAP operations.

An LDAP DNS provider is a concrete subclass of this class that has a zero-argument constructor. LDAP DNS providers are located using the ServiceLoader facility, as specified by InitialDirectContext. The ServiceLoader is used to create and register implementations of LdapDnsProvider.

An LDAP DNS provider can be used in environments where the default DNS resolution mechanism is not sufficient to accurately pinpoint the correct LDAP servers needed to perform LDAP operations. For example, in an environment containing a mix of ldap and ldaps servers you may want the LdapContext to query ldaps servers only.

Since
12

Constructor Summary

AccessConstructor and Description
protected
LdapDnsProvider()

Creates a new instance of LdapDnsProvider.

Method Summary

Modifier and TypeMethod and Description
public abstract Optional<LdapDnsProviderResult>

Returns:

an LdapDnsProviderResult or empty Optional if the lookup fails.
lookupEndpoints
(String url, Map<?, ?>
The Context environment.
env
)

Lookup the endpoints and domain name for the given Context provider URL and environment.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LdapDnsProviderback to summary
protected LdapDnsProvider()

Creates a new instance of LdapDnsProvider.

Method Detail

lookupEndpointsback to summary
public abstract Optional<LdapDnsProviderResult> lookupEndpoints(String url, Map<?, ?> env) throws NamingException

Lookup the endpoints and domain name for the given Context provider URL and environment. The resolved endpoints and domain name are returned as an LdapDnsProviderResult.

An endpoint is a String representation of an LDAP URL which points to an LDAP server to be used for LDAP operations. The syntax of an LDAP URL is defined by RFC 2255: The LDAP URL Format.

Parameters
url:String

The Context provider URL

env:Map<?, ?>

The Context environment.

Returns:Optional<LdapDnsProviderResult>

an LdapDnsProviderResult or empty Optional if the lookup fails.

Exceptions
NamingException:
if the url is not valid or an error occurred while performing the lookup.
NullPointerException:
if either url or env are null.