Package org.bluezoo.gumdrop.ldap.client
Class SearchRequest
java.lang.Object
org.bluezoo.gumdrop.ldap.client.SearchRequest
Represents an LDAP SearchRequest (RFC 4511 section 4.5.1).
Usage Example
SearchRequest search = new SearchRequest();
search.setBaseDN("dc=example,dc=com");
search.setScope(SearchScope.SUBTREE);
search.setFilter("(&(objectClass=person)(uid=jdoe))");
search.setAttributes("cn", "mail", "memberOf");
search.setSizeLimit(100);
search.setTimeLimit(30);
- Author:
- Chris Burdess
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of attributes to return.Returns the base DN for the search.Returns the alias dereferencing policy.Returns the search filter.getScope()Returns the search scope.intReturns the maximum number of entries to return.intReturns the time limit in seconds.booleanReturns whether to return only attribute types (not values).voidsetAttributes(String... attributes) Sets the attributes to return.voidsetAttributes(List<String> attributes) Sets the attributes to return.voidSets the base DN for the search.voidsetDerefAliases(DerefAliases derefAliases) Sets the alias dereferencing policy.voidSets the search filter.voidsetScope(SearchScope scope) Sets the search scope.voidsetSizeLimit(int sizeLimit) Sets the maximum number of entries to return.voidsetTimeLimit(int timeLimit) Sets the time limit in seconds.voidsetTypesOnly(boolean typesOnly) Sets whether to return only attribute types (not values).toString()
-
Constructor Details
-
SearchRequest
public SearchRequest()Creates a new search request with default values.
-
-
Method Details
-
getBaseDN
Returns the base DN for the search.- Returns:
- the base DN
-
setBaseDN
Sets the base DN for the search.- Parameters:
baseDN- the base DN
-
getScope
Returns the search scope.- Returns:
- the scope
-
setScope
Sets the search scope.- Parameters:
scope- the scope
-
getDerefAliases
Returns the alias dereferencing policy.- Returns:
- the deref policy
-
setDerefAliases
Sets the alias dereferencing policy.- Parameters:
derefAliases- the deref policy
-
getSizeLimit
public int getSizeLimit()Returns the maximum number of entries to return.- Returns:
- the size limit (0 = no limit)
-
setSizeLimit
public void setSizeLimit(int sizeLimit) Sets the maximum number of entries to return.- Parameters:
sizeLimit- the size limit (0 = no limit)
-
getTimeLimit
public int getTimeLimit()Returns the time limit in seconds.- Returns:
- the time limit (0 = no limit)
-
setTimeLimit
public void setTimeLimit(int timeLimit) Sets the time limit in seconds.- Parameters:
timeLimit- the time limit (0 = no limit)
-
isTypesOnly
public boolean isTypesOnly()Returns whether to return only attribute types (not values).- Returns:
- true if types only
-
setTypesOnly
public void setTypesOnly(boolean typesOnly) Sets whether to return only attribute types (not values).- Parameters:
typesOnly- true for types only
-
getFilter
Returns the search filter.- Returns:
- the filter string
-
setFilter
Sets the search filter.The filter should use standard LDAP filter syntax (RFC 4515). Examples:
(uid=jdoe)- equality(cn=John*)- substring(&(objectClass=person)(uid=jdoe))- AND(|(uid=jdoe)(uid=jsmith))- OR(!(objectClass=computer))- NOT
- Parameters:
filter- the filter string
-
getAttributes
Returns the list of attributes to return.- Returns:
- unmodifiable list of attribute names
-
setAttributes
Sets the attributes to return.An empty list returns all user attributes. The special value "*" returns all user attributes, "+" returns all operational attributes.
- Parameters:
attributes- the attribute names
-
setAttributes
Sets the attributes to return.- Parameters:
attributes- the attribute names
-
toString
-