Nuxeo Enterprise Platform 5.3

org.nuxeo.ecm.directory.ldap
Class LDAPDirectory

java.lang.Object
  extended by org.nuxeo.ecm.directory.AbstractDirectory
      extended by 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

Field Summary
protected  String baseFilter
           
protected  LDAPDirectoryDescriptor config
           
protected  Properties contextProperties
           
static String DN_SPECIAL_ATTRIBUTE_KEY
           
protected  LDAPDirectoryFactory factory
           
protected  Map<String,Field> schemaFieldMap
           
protected  SearchControls searchControls
           
protected  List<Session> sessions
           
protected  ContextProvider testServer
           
 
Fields inherited from class org.nuxeo.ecm.directory.AbstractDirectory
cache, fieldMapper, references
 
Constructor Summary
LDAPDirectory(LDAPDirectoryDescriptor config)
           
 
Method Summary
 void addSession(Session session)
           
protected  void clearSessions()
           
protected  Properties computeContextProperties()
           
protected  SearchControls computeSearchControls()
          Search controls that only fetch attributes defined by the schema
protected  DirContext createContext()
           
 String getBaseFilter()
           
 LDAPDirectoryDescriptor getConfig()
           
 Properties getContextProperties()
           
 String getIdField()
          Gets the id field of the schema for this directory.
 IdGenerator getIdGenerator()
          Gets the ID generator used when creating new entries in this directory.
 String getName()
          Gets the unique name of the directory, used for registering.
 String getParentDirectory()
          Gets the name of the parent directory.
 String getPasswordField()
          Gets the password field of the schema for this directory.
 String getSchema()
          Gets the schema name used by this directory.
 Map<String,Field> getSchemaFieldMap()
           
 SearchControls getSearchControls()
           
 SearchControls getSearchControls(boolean fetchAllAttributes)
           
 Session getSession()
          Creates a session for accessing entries in this directory.
 void removeSession(Session session)
           
 void setTestServer(ContextProvider testServer)
           
 void shutdown()
          Shuts down the directory.
 
Methods inherited from class org.nuxeo.ecm.directory.AbstractDirectory
addReference, addReferences, getCache, getFieldMapper, getReference, getReferences, invalidateCaches, isReference, orderEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DN_SPECIAL_ATTRIBUTE_KEY

public static final String DN_SPECIAL_ATTRIBUTE_KEY
See Also:
Constant Field Values

config

protected final LDAPDirectoryDescriptor config

contextProperties

protected final Properties contextProperties

searchControls

protected final SearchControls searchControls

schemaFieldMap

protected final Map<String,Field> schemaFieldMap

factory

protected final LDAPDirectoryFactory factory

sessions

protected final List<Session> sessions

baseFilter

protected final String baseFilter

testServer

protected ContextProvider testServer
Constructor Detail

LDAPDirectory

public LDAPDirectory(LDAPDirectoryDescriptor config)
              throws ClientException
Throws:
ClientException
Method Detail

computeContextProperties

protected Properties computeContextProperties()
                                       throws DirectoryException
Returns:
connection parameters to use for all LDAP queries
Throws:
DirectoryException

getContextProperties

public Properties getContextProperties()

computeSearchControls

protected SearchControls computeSearchControls()
                                        throws DirectoryException
Search controls that only fetch attributes defined by the schema

Returns:
common search controls to use for all LDAP search queries
Throws:
DirectoryException

getSearchControls

public SearchControls getSearchControls()

getSearchControls

public SearchControls getSearchControls(boolean fetchAllAttributes)

createContext

protected DirContext createContext()
                            throws DirectoryException
Throws:
DirectoryException

getIdGenerator

public IdGenerator getIdGenerator()
Description copied from interface: Directory
Gets the ID generator used when creating new entries in this directory.

Returns:
an ID Generator object

getName

public String getName()
Description copied from interface: Directory
Gets the unique name of the directory, used for registering.

Returns:
the unique directory name

getSchema

public String getSchema()
Description copied from interface: Directory
Gets the schema name used by this directory.

Returns:
the schema name

getParentDirectory

public String getParentDirectory()
Description copied from interface: Directory
Gets the name of the parent directory. This is used for hierarchical vocabularies.

Returns:
the name of the parent directory, or null.

getIdField

public String getIdField()
Description copied from interface: Directory
Gets the id field of the schema for this directory.

Returns:
the id field.

getPasswordField

public String getPasswordField()
Description copied from interface: Directory
Gets the password field of the schema for this directory.

Returns:
the password field.

getSession

public Session getSession()
                   throws DirectoryException
Description copied from interface: Directory
Creates a session for accessing entries in this directory.

Returns:
a Session object
Throws:
DirectoryException - if a session cannot be created

removeSession

public void removeSession(Session session)

addSession

public void addSession(Session session)

clearSessions

protected void clearSessions()

shutdown

public void shutdown()
Description copied from interface: Directory
Shuts down the directory.


getBaseFilter

public String getBaseFilter()

getConfig

public LDAPDirectoryDescriptor getConfig()

getSchemaFieldMap

public Map<String,Field> getSchemaFieldMap()

setTestServer

public void setTestServer(ContextProvider testServer)

Nuxeo Enterprise Platform 5.3

Copyright © 2010 Nuxeo SAS. All Rights Reserved.