Package org.nuxeo.ecm.directory.ldap
Class LDAPServerDescriptor
- java.lang.Object
-
- org.nuxeo.ecm.directory.ldap.LDAPServerDescriptor
-
public class LDAPServerDescriptor extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceLDAPServerDescriptor.LdapEntryCommon internal interface for Ldap entriesprotected classLDAPServerDescriptor.LdapEntryDescriptorServer URL implementation ofLDAPServerDescriptor.LdapEntryprotected classLDAPServerDescriptor.LdapEntryDomainDomain implementation ofLDAPServerDescriptor.LdapEntryusing DNS SRV record
-
Field Summary
Fields Modifier and Type Field Description StringbindDnStringbindPasswordintconnectionTimeoutprotected booleanisDynamicServerListprotected static StringLDAP_SCHEMEprotected LinkedHashSet<LDAPServerDescriptor.LdapEntry>ldapEntriesprotected static StringLDAPS_SCHEMEStringldapUrlsstatic LoglogStringnamebooleanpoolingEnabledprotected intpoolingTimeoutintretriesprotected DNSServiceResolversrvResolverprotected booleanuseSslbooleanverifyServerCert
-
Constructor Summary
Constructors Constructor Description LDAPServerDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringconvertDNtoFQDN(String dn)Convert domain from the ldap form dc=nuxeo,dc=org to the DNS domain name form nuxeo.orgprotected List<String>discoverLdapServers(String domain, boolean useSsl, String srvPrefix)Retrieve server URLs from DNS SRV recordStringgetBindDn()StringgetBindPassword()intgetConnectionTimeout()StringgetLdapUrls()StringgetName()intgetPoolingTimeout()intgetRetries()protected DNSServiceResolvergetSRVResolver()booleanisDynamicServerList()booleanisPoolingEnabled()booleanisVerifyServerCert()voidsetBindDn(String bindDn)voidsetBindPassword(String bindPassword)voidsetConnectionTimeout(int connectionTimeout)voidsetLdapUrls(LDAPUrlDescriptor[] ldapUrls)booleanuseSsl()Whether this server descriptor defines a secure ldap connection
-
-
-
Field Detail
-
log
public static final Log log
-
LDAPS_SCHEME
protected static final String LDAPS_SCHEME
- See Also:
- Constant Field Values
-
LDAP_SCHEME
protected static final String LDAP_SCHEME
- See Also:
- Constant Field Values
-
name
public String name
-
ldapUrls
public String ldapUrls
-
bindDn
public String bindDn
-
connectionTimeout
public int connectionTimeout
-
poolingEnabled
public boolean poolingEnabled
-
verifyServerCert
public boolean verifyServerCert
-
retries
public int retries
- Since:
- 5.7
-
poolingTimeout
protected int poolingTimeout
- Since:
- 10.2
-
ldapEntries
protected LinkedHashSet<LDAPServerDescriptor.LdapEntry> ldapEntries
-
isDynamicServerList
protected boolean isDynamicServerList
-
useSsl
protected boolean useSsl
-
srvResolver
protected final DNSServiceResolver srvResolver
-
bindPassword
public String bindPassword
-
-
Method Detail
-
isDynamicServerList
public boolean isDynamicServerList()
-
getName
public String getName()
-
setBindDn
public void setBindDn(String bindDn)
-
getBindDn
public String getBindDn()
-
setBindPassword
public void setBindPassword(String bindPassword)
-
getBindPassword
public String getBindPassword()
-
getLdapUrls
public String getLdapUrls()
-
setLdapUrls
public void setLdapUrls(LDAPUrlDescriptor[] ldapUrls)
-
useSsl
public boolean useSsl()
Whether this server descriptor defines a secure ldap connection
-
discoverLdapServers
protected List<String> discoverLdapServers(String domain, boolean useSsl, String srvPrefix) throws NamingException
Retrieve server URLs from DNS SRV record- Parameters:
domain- The domain to queryuseSsl- Whether the connection to this domain should be secure- Returns:
- List of servers or empty list
- Throws:
NamingException- if DNS lookup fails
-
convertDNtoFQDN
protected String convertDNtoFQDN(String dn)
Convert domain from the ldap form dc=nuxeo,dc=org to the DNS domain name form nuxeo.org- Parameters:
dn- base DN of the domain- Returns:
- the FQDN or null is DN is not matching the expected structure
-
isPoolingEnabled
public boolean isPoolingEnabled()
-
isVerifyServerCert
public boolean isVerifyServerCert()
-
getConnectionTimeout
public int getConnectionTimeout()
-
getPoolingTimeout
public int getPoolingTimeout()
- Since:
- 10.2
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
-
getSRVResolver
protected DNSServiceResolver getSRVResolver()
-
getRetries
public int getRetries()
- Since:
- 5.7
-
-