Package org.nuxeo.ecm.directory.ldap
Class LDAPDirectory
- java.lang.Object
-
- org.nuxeo.ecm.directory.AbstractDirectory
-
- org.nuxeo.ecm.directory.ldap.LDAPDirectory
-
- All Implemented Interfaces:
Directory
public class LDAPDirectory extends AbstractDirectory
Implementation of the Directory interface for servers implementing the Lightweight Directory Access Protocol.- Author:
- ogrisel, Robert Browning
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLDAPDirectory.TrustingSSLSocketFactorySSLSocketFactory implementation that verifies all certificates.-
Nested classes/interfaces inherited from class org.nuxeo.ecm.directory.AbstractDirectory
AbstractDirectory.CSVLoaderConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbaseFilterprotected PropertiescontextPropertiesstatic StringDN_SPECIAL_ATTRIBUTE_KEYprotected LDAPDirectoryFactoryfactoryprotected SearchControlsidSearchControlsprotected SearchControlssearchControlsprotected ContextProvidertestServer-
Fields inherited from class org.nuxeo.ecm.directory.AbstractDirectory
cache, descriptor, fieldMapper, referenceClass, references, registry, schemaFieldMap, sessionCount, sessionMaxCount, TENANT_ID_FIELD, types
-
-
Constructor Summary
Constructors Constructor Description LDAPDirectory(LDAPDirectoryDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddBaseFilter(String filter)protected voidaddReferences()protected PropertiescomputeContextProperties()protected SearchControlscomputeIdSearchControls()protected SearchControlscomputeSearchControls()Search controls that only fetch attributes defined by the schemaprotected DirContextcreateContext()StringgetBaseFilter()PropertiesgetContextProperties()LDAPDirectoryDescriptorgetDescriptor()Get descriptorSearchControlsgetIdSearchControls()Search controls that only fetch the id.List<Reference>getReferences(String referenceFieldName)Lookup the References by field name.SearchControlsgetSearchControls()SearchControlsgetSearchControls(boolean fetchAllAttributes)LDAPServerDescriptorgetServer()LDAPSessiongetSession()Creates a session for accessing entries in this directory.protected ContextProvidergetTestServer()voidinitialize()INTERNAL, DO NOT CALL.protected voidsetSystemProperty(String key, String value)Sets a System property, except if it's already set, to allow for external configuration.voidsetTestServer(ContextProvider testServer)-
Methods inherited from class org.nuxeo.ecm.directory.AbstractDirectory
addInverseReferences, addReference, addSession, doSanityChecks, fallbackOnDefaultCache, getCache, getDirectoryDeleteConstraints, getFieldMapper, getIdField, getName, getParentDirectory, getPasswordField, getReference, getReferences, getSchema, getSchemaFieldMap, getTypes, initializeInverseReferences, initializeReferences, initSchemaFieldMap, invalidateCaches, invalidateDirectoryCache, isMultiTenant, isReadOnly, isReference, loadData, loadDataOnInit, loadFromCSV, makeOrderBy, newReference, orderEntries, removeSession, setReadOnly, shutdown
-
-
-
-
Field Detail
-
DN_SPECIAL_ATTRIBUTE_KEY
public static final String DN_SPECIAL_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
-
contextProperties
protected Properties contextProperties
-
idSearchControls
protected volatile SearchControls idSearchControls
-
searchControls
protected volatile SearchControls searchControls
-
factory
protected final LDAPDirectoryFactory factory
-
baseFilter
protected String baseFilter
-
testServer
protected ContextProvider testServer
-
-
Constructor Detail
-
LDAPDirectory
public LDAPDirectory(LDAPDirectoryDescriptor descriptor)
-
-
Method Detail
-
getDescriptor
public LDAPDirectoryDescriptor getDescriptor()
Description copied from interface:DirectoryGet descriptor
-
addReferences
protected void addReferences()
- Overrides:
addReferencesin classAbstractDirectory
-
getReferences
public List<Reference> getReferences(String referenceFieldName)
Description copied from interface:DirectoryLookup the References by field name.- Specified by:
getReferencesin interfaceDirectory- Overrides:
getReferencesin classAbstractDirectory- Returns:
- the matching references implementation or null
-
initialize
public void initialize()
Description copied from interface:DirectoryINTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initializein interfaceDirectory- Overrides:
initializein classAbstractDirectory
-
computeContextProperties
protected Properties computeContextProperties()
- Returns:
- connection parameters to use for all LDAP queries
-
setSystemProperty
protected void setSystemProperty(String key, String value)
Sets a System property, except if it's already set, to allow for external configuration.
-
getContextProperties
public Properties getContextProperties()
-
computeIdSearchControls
protected SearchControls computeIdSearchControls()
-
computeSearchControls
protected SearchControls computeSearchControls()
Search controls that only fetch attributes defined by the schema- Returns:
- common search controls to use for all LDAP search queries
-
getIdSearchControls
public SearchControls getIdSearchControls()
Search controls that only fetch the id.- Since:
- 10.3
-
getSearchControls
public SearchControls getSearchControls()
-
getSearchControls
public SearchControls getSearchControls(boolean fetchAllAttributes)
-
createContext
protected DirContext createContext()
-
getServer
public LDAPServerDescriptor getServer()
- Returns:
- ldap server descriptor bound to this directory
- Since:
- 5.7
-
getSession
public LDAPSession getSession()
Description copied from interface:DirectoryCreates a session for accessing entries in this directory.- Returns:
- a Session object
-
getBaseFilter
public String getBaseFilter()
-
getTestServer
protected ContextProvider getTestServer()
-
setTestServer
public void setTestServer(ContextProvider testServer)
-
-