Class SearchParams
- java.lang.Object
-
- org.apache.directory.api.ldap.model.message.SearchParams
-
public class SearchParams extends Object
A container for Search parameters. It replaces the SearchControls.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description private AliasDerefModealiasDerefModeThe aliasDerefMode.private Set<Control>controlsThe set of controls for this search.private static org.slf4j.LoggerLOGThe LoggerFactory used by this classprivate Set<AttributeTypeOptions>returningAttributesThe list of attributes to return, once it has been normalized.private Set<String>returningAttributesStrThe list of attributes to return, as Strings.private SearchScopescopeThe search scope.private longsizeLimitThe size limit.private inttimeLimitThe time limit.private booleantypesOnlyIf we should return only types.
-
Constructor Summary
Constructors Constructor Description SearchParams()Creates a new instance of SearchContext, with all the values set to default.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddControl(Control control)voidaddReturningAttributes(String returningAttribute)AliasDerefModegetAliasDerefMode()Set<Control>getControls()Set<AttributeTypeOptions>getReturningAttributes()Set<String>getReturningAttributesStr()SearchScopegetScope()longgetSizeLimit()intgetTimeLimit()booleanisTypesOnly()voidnormalize(SchemaManager schemaManager)Normalize the ReturningAttributes.voidsetAliasDerefMode(AliasDerefMode aliasDerefMode)voidsetControls(Set<Control> controls)voidsetReturningAttributes(String... returningAttributes)voidsetScope(SearchScope scope)voidsetSizeLimit(long sizeLimit)voidsetTimeLimit(int timeLimit)voidsetTypesOnly(boolean typesOnly)static SearchParamstoSearchParams(SearchControls searchControls, AliasDerefMode aliasDerefMode)Creates aSearchParamsfrom JNDI search controls.StringtoString()
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
The LoggerFactory used by this class
-
scope
private SearchScope scope
The search scope. Default to OBJECT
-
timeLimit
private int timeLimit
The time limit. Default to 0 (infinite)
-
sizeLimit
private long sizeLimit
The size limit. Default to 0 (infinite)
-
typesOnly
private boolean typesOnly
If we should return only types. Default to false
-
aliasDerefMode
private AliasDerefMode aliasDerefMode
The aliasDerefMode. Default to DEREF_ALWAYS
-
returningAttributesStr
private Set<String> returningAttributesStr
The list of attributes to return, as Strings. Default to an empty set
-
returningAttributes
private Set<AttributeTypeOptions> returningAttributes
The list of attributes to return, once it has been normalized. Default to an empty set
-
-
Method Detail
-
getScope
public SearchScope getScope()
- Returns:
- the scope
-
setScope
public void setScope(SearchScope scope)
- Parameters:
scope- the scope to set
-
getTimeLimit
public int getTimeLimit()
- Returns:
- the timeLimit
-
setTimeLimit
public void setTimeLimit(int timeLimit)
- Parameters:
timeLimit- the timeLimit to set
-
getSizeLimit
public long getSizeLimit()
- Returns:
- the sizeLimit
-
setSizeLimit
public void setSizeLimit(long sizeLimit)
- Parameters:
sizeLimit- the sizeLimit to set
-
isTypesOnly
public boolean isTypesOnly()
- Returns:
- the typesOnly
-
setTypesOnly
public void setTypesOnly(boolean typesOnly)
- Parameters:
typesOnly- the typesOnly to set
-
getAliasDerefMode
public AliasDerefMode getAliasDerefMode()
- Returns:
- the aliasDerefMode
-
setAliasDerefMode
public void setAliasDerefMode(AliasDerefMode aliasDerefMode)
- Parameters:
aliasDerefMode- the aliasDerefMode to set
-
getReturningAttributes
public Set<AttributeTypeOptions> getReturningAttributes()
- Returns:
- the returningAttributes
-
getReturningAttributesStr
public Set<String> getReturningAttributesStr()
- Returns:
- the returningAttributes
-
normalize
public void normalize(SchemaManager schemaManager)
Normalize the ReturningAttributes. It reads all the String from the returningAttributesString, and grab the associated AttributeType from the schema to store it into the returningAttributes Set.- Parameters:
schemaManager- The schema manager
-
setReturningAttributes
public void setReturningAttributes(String... returningAttributes)
- Parameters:
returningAttributes- the returningAttributes to set
-
addReturningAttributes
public void addReturningAttributes(String returningAttribute)
- Parameters:
returningAttribute- the returningAttributes to add
-
setControls
public void setControls(Set<Control> controls)
- Parameters:
controls- the controls to set
-
addControl
public void addControl(Control control)
- Parameters:
control- the controls to set
-
toSearchParams
public static SearchParams toSearchParams(SearchControls searchControls, AliasDerefMode aliasDerefMode)
Creates aSearchParamsfrom JNDI search controls.- Parameters:
searchControls- the search controlsaliasDerefMode- the alias deref mode- Returns:
- the search params
-
-