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 class
LDAPDirectory.TrustingSSLSocketFactory
SSLSocketFactory 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 String
baseFilter
protected Properties
contextProperties
static String
DN_SPECIAL_ATTRIBUTE_KEY
protected LDAPDirectoryFactory
factory
protected SearchControls
idSearchControls
protected SearchControls
searchControls
protected ContextProvider
testServer
-
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 String
addBaseFilter(String filter)
protected void
addReferences()
protected Properties
computeContextProperties()
protected SearchControls
computeIdSearchControls()
protected SearchControls
computeSearchControls()
Search controls that only fetch attributes defined by the schemaprotected DirContext
createContext()
String
getBaseFilter()
Properties
getContextProperties()
LDAPDirectoryDescriptor
getDescriptor()
Get descriptorSearchControls
getIdSearchControls()
Search controls that only fetch the id.List<Reference>
getReferences(String referenceFieldName)
Lookup the References by field name.SearchControls
getSearchControls()
SearchControls
getSearchControls(boolean fetchAllAttributes)
LDAPServerDescriptor
getServer()
LDAPSession
getSession()
Creates a session for accessing entries in this directory.protected ContextProvider
getTestServer()
void
initialize()
INTERNAL, DO NOT CALL.protected void
setSystemProperty(String key, String value)
Sets a System property, except if it's already set, to allow for external configuration.void
setTestServer(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:Directory
Get descriptor
-
addReferences
protected void addReferences()
- Overrides:
addReferences
in classAbstractDirectory
-
getReferences
public List<Reference> getReferences(String referenceFieldName)
Description copied from interface:Directory
Lookup the References by field name.- Specified by:
getReferences
in interfaceDirectory
- Overrides:
getReferences
in classAbstractDirectory
- Returns:
- the matching references implementation or null
-
initialize
public void initialize()
Description copied from interface:Directory
INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initialize
in interfaceDirectory
- Overrides:
initialize
in 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:Directory
Creates 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)
-
-