Package org.ldaptive
Class SearchOperation
- All Implemented Interfaces:
Operation<SearchRequest,
SearchResponse>
Executes an ldap search operation.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.ldaptive.AbstractOperation
AbstractOperation.AbstractBuilder<B,
T extends AbstractOperation> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LdapEntryHandler[]
Functions to handle response entries.private FilterTemplate
Filter template.private SearchReferenceHandler[]
Functions to handle response references.private SearchRequest
Search request to execute.private SearchResultHandler[]
Functions to handle response results. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SearchOperation
(ConnectionFactory factory) Creates a new search operation.SearchOperation
(ConnectionFactory factory, String baseDN) Creates a new search operation.SearchOperation
(ConnectionFactory factory, SearchRequest req) Creates a new search operation. -
Method Summary
Modifier and TypeMethodDescriptionstatic SearchOperation.Builder
builder()
Creates a builder for this class.protected SearchOperationHandle
configureHandle
(SearchOperationHandle handle) Adds configured functions to the supplied handle.private SearchRequest
configureRequest
(String baseDN, Filter filter, String[] returnAttributes) Creates a new request fromgetRequest()
and applies any non-null supplied properties.static SearchOperation
copy
(SearchOperation operation) Returns a new search operation with the same properties as the supplied operation.execute()
Executes a search request usinggetRequest()
.Executes a search request.Executes a search request.execute
(String filter, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.execute
(String baseDN, String filter, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.execute
(String baseDN, Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.execute
(String baseDN, FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.static SearchResponse
execute
(ConnectionFactory factory, SearchRequest req) Executes a search request.Executes a search request.Executes a search request.execute
(Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.execute
(FilterTemplate template) Executes a search request.execute
(FilterTemplate template, String... returnAttributes) Executes a search request.execute
(FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) Executes a search request.execute
(SearchRequest req) Sends an asynchronous request and waits for the response.send()
Sends a search request.Sends a search request.Sends a search request.send
(String filter, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.send
(String baseDN, String filter, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.send
(String baseDN, Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.send
(String baseDN, FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.static SearchOperationHandle
send
(ConnectionFactory factory, SearchRequest req) Sends a search request.Sends a search request.Sends a search request.send
(Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.send
(FilterTemplate template) Sends a search request.send
(FilterTemplate template, String... returnAttributes) Sends a search request.send
(FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) Sends a search request.send
(SearchRequest req) Sends the supplied search request.void
setEntryHandlers
(LdapEntryHandler... handlers) void
setReferenceHandlers
(SearchReferenceHandler... handlers) void
setRequest
(SearchRequest req) void
setSearchResultHandlers
(SearchResultHandler... handlers) void
setTemplate
(FilterTemplate template) toString()
Methods inherited from class org.ldaptive.AbstractOperation
configureHandle, configureRequest, getConnectionFactory, getControlHandlers, getExceptionHandler, getIntermediateResponseHandlers, getReferralHandlers, getRequestHandlers, getResultHandlers, getThrowCondition, getUnsolicitedNotificationHandlers, setConnectionFactory, setControlHandlers, setExceptionHandler, setIntermediateResponseHandlers, setReferralHandlers, setRequestHandlers, setResultHandlers, setThrowCondition, setUnsolicitedNotificationHandlers
-
Field Details
-
request
Search request to execute. -
filterTemplate
Filter template. -
entryHandlers
Functions to handle response entries. -
referenceHandlers
Functions to handle response references. -
searchResultHandlers
Functions to handle response results.
-
-
Constructor Details
-
SearchOperation
public SearchOperation()Default constructor. -
SearchOperation
Creates a new search operation.- Parameters:
factory
- connection factory
-
SearchOperation
Creates a new search operation.- Parameters:
factory
- connection factoryreq
- search request
-
SearchOperation
Creates a new search operation.- Parameters:
factory
- connection factorybaseDN
- to search from
-
-
Method Details
-
getRequest
-
setRequest
-
getTemplate
-
setTemplate
-
getEntryHandlers
-
setEntryHandlers
-
getReferenceHandlers
-
setReferenceHandlers
-
getSearchResultHandlers
-
setSearchResultHandlers
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filter- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
template
- filter template- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filter- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to return- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(FilterTemplate template, String... returnAttributes) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
template
- filter templatereturnAttributes
- attributes to return- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to return- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(String filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
template
- filter templatereturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(String baseDN, String filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
baseDN
- base DNfilter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(String baseDN, FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
baseDN
- base DNtemplate
- filter templatereturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
send
public SearchOperationHandle send(String baseDN, Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
baseDN
- base DNfilter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
Sends the supplied search request.- Parameters:
req
- search request to send- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
Sends a search request. SeeSearchOperationHandle.send()
.- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
send
public static SearchOperationHandle send(ConnectionFactory factory, SearchRequest req) throws LdapException Sends a search request. SeeSearchOperationHandle.send()
.- Parameters:
factory
- connection factoryreq
- search request- Returns:
- search operation handle
- Throws:
LdapException
- if the connection cannot be opened
-
execute
Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filter- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
template
- filter template- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filter- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
execute
Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to return- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(FilterTemplate template, String... returnAttributes) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
template
- filter templatereturnAttributes
- attributes to return- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to return- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(String filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
template
- filter templatereturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
filter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(String baseDN, String filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
baseDN
- base DNfilter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(String baseDN, FilterTemplate template, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
baseDN
- base DNtemplate
- filter templatereturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
FilterParseException
- if the filter cannot be parsedLdapException
- if the connection cannot be opened
-
execute
public SearchResponse execute(String baseDN, Filter filter, String[] returnAttributes, LdapEntryHandler... handlers) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
baseDN
- base DNfilter
- search filterreturnAttributes
- attributes to returnhandlers
- entry handlers- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
execute
Description copied from interface:Operation
Sends an asynchronous request and waits for the response.- Parameters:
req
- operation request- Returns:
- operation result
- Throws:
LdapException
- if the operation fails
-
execute
Executes a search request usinggetRequest()
. SeeSearchOperationHandle.execute()
.- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
execute
public static SearchResponse execute(ConnectionFactory factory, SearchRequest req) throws LdapException Executes a search request. SeeSearchOperationHandle.execute()
.- Parameters:
factory
- connection factoryreq
- search request- Returns:
- search result
- Throws:
LdapException
- if the connection cannot be opened
-
configureRequest
Creates a new request fromgetRequest()
and applies any non-null supplied properties.- Parameters:
baseDN
- base DNfilter
- search filterreturnAttributes
- attributes to return- Returns:
- configured search request
-
configureHandle
Adds configured functions to the supplied handle.- Parameters:
handle
- to configure- Returns:
- configured handle
-
copy
Returns a new search operation with the same properties as the supplied operation.- Parameters:
operation
- to copy- Returns:
- copy of the supplied search operation
-
toString
- Overrides:
toString
in classAbstractOperation<SearchRequest,
SearchResponse>
-
builder
Creates a builder for this class.- Returns:
- new builder
-