public class SearchRequest extends AbstractRequest
Modifier and Type | Field and Description |
---|---|
private String |
baseDn
DN to search.
|
private String[] |
binaryAttrs
Binary attribute names.
|
private DerefAliases |
derefAliases
How to handle aliases.
|
private SearchEntryHandler[] |
entryHandlers
Ldap entry handlers.
|
private static int |
HASH_CODE_SEED
hash code seed.
|
private SearchReferenceHandler[] |
referenceHandlers
Search reference handlers.
|
private String[] |
retAttrs
Attributes to return.
|
private SearchFilter |
searchFilter
Search filter to execute.
|
private SearchScope |
searchScope
Search scope.
|
private long |
sizeLimit
Number of entries to return.
|
private SortBehavior |
sortBehavior
Sort behavior of results.
|
private Duration |
timeLimit
Time search operation will block.
|
private boolean |
typesOnly
Whether to return only attribute types.
|
Constructor and Description |
---|
SearchRequest()
Default constructor.
|
SearchRequest(String dn,
SearchFilter filter)
Creates a new search request.
|
SearchRequest(String dn,
SearchFilter filter,
String... attrs)
Creates a new search request.
|
SearchRequest(String dn,
String filter)
Creates a new search request.
|
SearchRequest(String dn,
String filter,
String... attrs)
Creates a new search request.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getBaseDn()
Returns the base DN.
|
String[] |
getBinaryAttributes()
Returns names of binary attributes.
|
DerefAliases |
getDerefAliases()
Returns how to dereference aliases.
|
String[] |
getReturnAttributes()
Returns the search return attributes.
|
SearchEntryHandler[] |
getSearchEntryHandlers()
Returns the search entry handlers.
|
SearchFilter |
getSearchFilter()
Returns the search filter.
|
SearchReferenceHandler[] |
getSearchReferenceHandlers()
Returns the search reference handlers.
|
SearchScope |
getSearchScope()
Gets the search scope.
|
long |
getSizeLimit()
Returns the size limit.
|
SortBehavior |
getSortBehavior()
Returns the sort behavior.
|
Duration |
getTimeLimit()
Returns the time limit.
|
boolean |
getTypesOnly()
Returns whether to return only attribute types.
|
int |
hashCode() |
static SearchRequest |
newObjectScopeSearchRequest(String dn)
Returns a search request initialized for use with an object level search scope.
|
static SearchRequest |
newObjectScopeSearchRequest(String dn,
String[] attrs)
Returns a search request initialized for use with an object level search scope.
|
static SearchRequest |
newObjectScopeSearchRequest(String dn,
String[] attrs,
SearchFilter filter)
Returns a search request initialized for use with an object level search scope.
|
protected static SearchRequest |
newSearchRequest(SearchRequest request)
Returns a search request initialized with the supplied request.
|
void |
setBaseDn(String dn)
Sets the base DN.
|
void |
setBinaryAttributes(String... attrs)
Sets names of binary attributes.
|
void |
setDerefAliases(DerefAliases da)
Sets how to dereference aliases.
|
void |
setReturnAttributes(String... attrs)
Sets the search return attributes.
|
void |
setSearchEntryHandlers(SearchEntryHandler... handlers)
Sets the search entry handlers.
|
void |
setSearchFilter(SearchFilter filter)
Sets the search filter.
|
void |
setSearchReferenceHandlers(SearchReferenceHandler... handlers)
Sets the search reference handlers.
|
void |
setSearchScope(SearchScope scope)
Sets the search scope.
|
void |
setSizeLimit(long limit)
Sets the size limit.
|
void |
setSortBehavior(SortBehavior sb)
Sets the sort behavior.
|
void |
setTimeLimit(Duration limit)
Sets the time limit.
|
void |
setTypesOnly(boolean b)
Sets whether to return only attribute types.
|
String |
toString() |
getControls, getIntermediateResponseHandlers, getReferralHandler, setControls, setIntermediateResponseHandlers, setReferralHandler
private static final int HASH_CODE_SEED
private String baseDn
private SearchFilter searchFilter
private String[] retAttrs
private SearchScope searchScope
private Duration timeLimit
private long sizeLimit
private DerefAliases derefAliases
private boolean typesOnly
private String[] binaryAttrs
private SortBehavior sortBehavior
private SearchEntryHandler[] entryHandlers
private SearchReferenceHandler[] referenceHandlers
public SearchRequest()
public SearchRequest(String dn, SearchFilter filter)
dn
- to searchfilter
- search filterpublic SearchRequest(String dn, SearchFilter filter, String... attrs)
dn
- to searchfilter
- search filterattrs
- to returnpublic SearchRequest(String dn, String filter)
dn
- to searchfilter
- search filterpublic String getBaseDn()
public void setBaseDn(String dn)
dn
- base DNpublic SearchFilter getSearchFilter()
public void setSearchFilter(SearchFilter filter)
filter
- search filterpublic String[] getReturnAttributes()
public void setReturnAttributes(String... attrs)
attrs
- search return attributespublic SearchScope getSearchScope()
public void setSearchScope(SearchScope scope)
scope
- search scopepublic Duration getTimeLimit()
public void setTimeLimit(Duration limit)
limit
- time limitpublic long getSizeLimit()
public void setSizeLimit(long limit)
limit
- size limitpublic DerefAliases getDerefAliases()
public void setDerefAliases(DerefAliases da)
da
- how to dereference aliasespublic boolean getTypesOnly()
public void setTypesOnly(boolean b)
b
- whether to return only attribute typespublic String[] getBinaryAttributes()
public void setBinaryAttributes(String... attrs)
attrs
- binary attribute namespublic SortBehavior getSortBehavior()
public void setSortBehavior(SortBehavior sb)
sb
- sort behaviorpublic SearchEntryHandler[] getSearchEntryHandlers()
public void setSearchEntryHandlers(SearchEntryHandler... handlers)
handlers
- search entry handlerspublic SearchReferenceHandler[] getSearchReferenceHandlers()
public void setSearchReferenceHandlers(SearchReferenceHandler... handlers)
handlers
- search reference handlerspublic static SearchRequest newObjectScopeSearchRequest(String dn)
dn
- of an ldap entrypublic static SearchRequest newObjectScopeSearchRequest(String dn, String[] attrs)
dn
- of an ldap entryattrs
- to returnpublic static SearchRequest newObjectScopeSearchRequest(String dn, String[] attrs, SearchFilter filter)
dn
- of an ldap entryattrs
- to returnfilter
- to execute on the ldap entryprotected static SearchRequest newSearchRequest(SearchRequest request)
request
- search request to read properties fromCopyright © 2003-2019 Virginia Tech. All Rights Reserved.