org.springframework.ldap.pool.validation
Class DefaultDirContextValidator
java.lang.Object
org.springframework.ldap.pool.validation.DefaultDirContextValidator
- All Implemented Interfaces:
- DirContextValidator
public class DefaultDirContextValidator
- extends java.lang.Object
- implements DirContextValidator
Default DirContext
validator that executes DirContext.search(String, String, SearchControls)
. The
name, filter and SearchControls
are all configurable. There is no special handling for read only versus
read write DirContext
s.
Configuration:
Property |
Description |
Required |
Default |
base |
The name parameter to the search method.
|
No |
"" |
filter |
The filter parameter to the search method.
|
No |
"objectclass=*" |
searchControls |
The SearchControls parameter to the search method.
|
No |
SearchControls.setCountLimit(long) = 1
SearchControls.setReturningAttributes(String[]) = new String[] { "objectclass" }
SearchControls.setTimeLimit(int) = 500
|
- Author:
- Eric Dalquist
Field Summary |
protected org.apache.commons.logging.Log |
logger
Logger for this class and sub-classes |
Constructor Summary |
DefaultDirContextValidator()
Create the default validator, creates SearchControls with a countLimit of 1, returningAttributes of
objectclass and timeLimit of 500. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
- Logger for this class and sub-classes
DefaultDirContextValidator
public DefaultDirContextValidator()
- Create the default validator, creates
SearchControls
with a countLimit of 1, returningAttributes of
objectclass and timeLimit of 500. The default base is an empty string and the default filter is objectclass=*
getBase
public java.lang.String getBase()
- Returns:
- the baseName
setBase
public void setBase(java.lang.String base)
- Parameters:
base
- the baseName to set
getFilter
public java.lang.String getFilter()
- Returns:
- the filter
setFilter
public void setFilter(java.lang.String filter)
- Parameters:
filter
- the filter to set
getSearchControls
public javax.naming.directory.SearchControls getSearchControls()
- Returns:
- the searchControls
setSearchControls
public void setSearchControls(javax.naming.directory.SearchControls searchControls)
- Parameters:
searchControls
- the searchControls to set
validateDirContext
public boolean validateDirContext(DirContextType contextType,
javax.naming.directory.DirContext dirContext)
- Description copied from interface:
DirContextValidator
- Validates the
DirContext
. A valid DirContext
should be able
to answer queries and if applicable write to the directory.
- Specified by:
validateDirContext
in interface DirContextValidator
- Parameters:
contextType
- The type of the DirContext
, refers to if ContextSource.getReadOnlyContext()
or ContextSource.getReadWriteContext()
was called to create the DirContext
dirContext
- The DirContext
to validate.
- Returns:
true
if the DirContext
operated correctly during validation.- See Also:
DirContextValidator.validateDirContext(DirContextType, javax.naming.directory.DirContext)
Copyright (c) 2005-2007. All Rights Reserved.