Class DefaultDirContextValidator
java.lang.Object
org.springframework.ldap.pool2.validation.DefaultDirContextValidator
- All Implemented Interfaces:
- DirContextValidator
Default 
 
Configuration:
 
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 DirContexts.
 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 SearchControlsparameter to the search method. | No | SearchControls.setCountLimit(long)= 1SearchControls.setReturningAttributes(String[])= new String[] { "objectclass"
 }SearchControls.setTimeLimit(int)= 500 | 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringprotected final org.slf4j.LoggerLogger for this class and sub-classes
- 
Constructor SummaryConstructorsConstructorDescriptionCreate the default validator, createsSearchControlswith search scopeOBJECT_SCOPE, a countLimit of 1, returningAttributes of objectclass and timeLimit of 500.DefaultDirContextValidator(int searchScope) Create a validator with all the defaults of the default constructor, but with the search scope set to the referred value.
- 
Method SummaryModifier and TypeMethodDescriptiongetBase()voidvoidvoidsetSearchControls(SearchControls searchControls) booleanvalidateDirContext(DirContextType contextType, DirContext dirContext) Validates theDirContext.
- 
Field Details- 
DEFAULT_FILTER- See Also:
 
- 
loggerprotected final org.slf4j.Logger loggerLogger for this class and sub-classes
 
- 
- 
Constructor Details- 
DefaultDirContextValidatorpublic DefaultDirContextValidator()Create the default validator, createsSearchControlswith search scopeOBJECT_SCOPE, a countLimit of 1, returningAttributes of objectclass and timeLimit of 500. The default base is an empty string and the default filter is objectclass=*
- 
DefaultDirContextValidatorpublic DefaultDirContextValidator(int searchScope) Create a validator with all the defaults of the default constructor, but with the search scope set to the referred value.- Parameters:
- searchScope- The searchScope to be set in the default- SearchControls
 
 
- 
- 
Method Details- 
getBase- Returns:
- the baseName
 
- 
setBase- Parameters:
- base- the baseName to set
 
- 
getFilter- Returns:
- the filter
 
- 
setFilter- Parameters:
- filter- the filter to set
 
- 
getSearchControls- Returns:
- the searchControls
 
- 
setSearchControls- Parameters:
- searchControls- the searchControls to set
 
- 
validateDirContextDescription copied from interface:DirContextValidatorValidates theDirContext. A validDirContextshould be able to answer queries and if applicable write to the directory.- Specified by:
- validateDirContextin 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- DirContextto validate.
- Returns:
- trueif the- DirContextoperated correctly during validation.
- See Also:
 
 
-