Package org.ldaptive
Class SearchOperation
- java.lang.Object
-
- org.ldaptive.AbstractOperation<SearchRequest,SearchResponse>
-
- org.ldaptive.SearchOperation
-
- All Implemented Interfaces:
Operation<SearchRequest,SearchResponse>
public class SearchOperation extends AbstractOperation<SearchRequest,SearchResponse>
Executes an ldap search operation.- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSearchOperation.BuilderSearch operation builder.-
Nested classes/interfaces inherited from class org.ldaptive.AbstractOperation
AbstractOperation.AbstractBuilder<B,T extends AbstractOperation>
-
-
Constructor Summary
Constructors Constructor Description SearchOperation()Default constructor.SearchOperation(ConnectionFactory factory)Creates a new search operation.SearchOperation(ConnectionFactory factory, java.lang.String baseDN)Creates a new search operation.SearchOperation(ConnectionFactory factory, SearchRequest req)Creates a new search operation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SearchOperation.Builderbuilder()Creates a builder for this class.protected SearchOperationHandleconfigureHandle(SearchOperationHandle handle)Adds configured functions to the supplied handle.static SearchOperationcopy(SearchOperation operation)Returns a new search operation with the same properties as the supplied operation.SearchResponseexecute()Executes a search request usinggetRequest().SearchResponseexecute(java.lang.String filter)Executes a search request.SearchResponseexecute(java.lang.String filter, java.lang.String... returnAttributes)Executes a search request.SearchResponseexecute(java.lang.String filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.SearchResponseexecute(java.lang.String baseDN, java.lang.String filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.SearchResponseexecute(java.lang.String baseDN, Filter filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.SearchResponseexecute(java.lang.String baseDN, FilterTemplate template, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.static SearchResponseexecute(ConnectionFactory factory, SearchRequest req)Executes a search request.SearchResponseexecute(Filter filter)Executes a search request.SearchResponseexecute(Filter filter, java.lang.String... returnAttributes)Executes a search request.SearchResponseexecute(Filter filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.SearchResponseexecute(FilterTemplate template)Executes a search request.SearchResponseexecute(FilterTemplate template, java.lang.String... returnAttributes)Executes a search request.SearchResponseexecute(FilterTemplate template, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Executes a search request.SearchResponseexecute(SearchRequest req)Sends an asynchronous request and waits for the response.LdapEntryHandler[]getEntryHandlers()SearchReferenceHandler[]getReferenceHandlers()SearchRequestgetRequest()SearchResultHandler[]getSearchResultHandlers()FilterTemplategetTemplate()SearchOperationHandlesend()Sends a search request.SearchOperationHandlesend(java.lang.String filter)Sends a search request.SearchOperationHandlesend(java.lang.String filter, java.lang.String... returnAttributes)Sends a search request.SearchOperationHandlesend(java.lang.String filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.SearchOperationHandlesend(java.lang.String baseDN, java.lang.String filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.SearchOperationHandlesend(java.lang.String baseDN, Filter filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.SearchOperationHandlesend(java.lang.String baseDN, FilterTemplate template, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.static SearchOperationHandlesend(ConnectionFactory factory, SearchRequest req)Sends a search request.SearchOperationHandlesend(Filter filter)Sends a search request.SearchOperationHandlesend(Filter filter, java.lang.String... returnAttributes)Sends a search request.SearchOperationHandlesend(Filter filter, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.SearchOperationHandlesend(FilterTemplate template)Sends a search request.SearchOperationHandlesend(FilterTemplate template, java.lang.String... returnAttributes)Sends a search request.SearchOperationHandlesend(FilterTemplate template, java.lang.String[] returnAttributes, LdapEntryHandler... handlers)Sends a search request.SearchOperationHandlesend(SearchRequest req)Sends the supplied search request.voidsetEntryHandlers(LdapEntryHandler... handlers)voidsetReferenceHandlers(SearchReferenceHandler... handlers)voidsetRequest(SearchRequest req)voidsetSearchResultHandlers(SearchResultHandler... handlers)voidsetTemplate(FilterTemplate template)java.lang.StringtoString()-
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
-
-
-
-
Constructor Detail
-
SearchOperation
public SearchOperation()
Default constructor.
-
SearchOperation
public SearchOperation(ConnectionFactory factory)
Creates a new search operation.- Parameters:
factory- connection factory
-
SearchOperation
public SearchOperation(ConnectionFactory factory, SearchRequest req)
Creates a new search operation.- Parameters:
factory- connection factoryreq- search request
-
SearchOperation
public SearchOperation(ConnectionFactory factory, java.lang.String baseDN)
Creates a new search operation.- Parameters:
factory- connection factorybaseDN- to search from
-
-
Method Detail
-
getRequest
public SearchRequest getRequest()
-
setRequest
public void setRequest(SearchRequest req)
-
getTemplate
public FilterTemplate getTemplate()
-
setTemplate
public void setTemplate(FilterTemplate template)
-
getEntryHandlers
public LdapEntryHandler[] getEntryHandlers()
-
setEntryHandlers
public void setEntryHandlers(LdapEntryHandler... handlers)
-
getReferenceHandlers
public SearchReferenceHandler[] getReferenceHandlers()
-
setReferenceHandlers
public void setReferenceHandlers(SearchReferenceHandler... handlers)
-
getSearchResultHandlers
public SearchResultHandler[] getSearchResultHandlers()
-
setSearchResultHandlers
public void setSearchResultHandlers(SearchResultHandler... handlers)
-
send
public SearchOperationHandle send(java.lang.String filter) throws LdapException
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
public SearchOperationHandle send(FilterTemplate template) throws LdapException
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
public SearchOperationHandle send(Filter filter) throws LdapException
Sends a search request. SeeSearchOperationHandle.send().- Parameters:
filter- search filter- Returns:
- search operation handle
- Throws:
LdapException- if the connection cannot be opened
-
send
public SearchOperationHandle send(java.lang.String filter, java.lang.String... returnAttributes) throws LdapException
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, java.lang.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
public SearchOperationHandle send(Filter filter, java.lang.String... returnAttributes) throws LdapException
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(java.lang.String filter, java.lang.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, java.lang.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, java.lang.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(java.lang.String baseDN, java.lang.String filter, java.lang.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(java.lang.String baseDN, FilterTemplate template, java.lang.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(java.lang.String baseDN, Filter filter, java.lang.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
public SearchOperationHandle send(SearchRequest req) throws LdapException
Sends the supplied search request.- Parameters:
req- search request to send- Returns:
- search operation handle
- Throws:
LdapException- if the connection cannot be opened
-
send
public SearchOperationHandle send() throws LdapException
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
public SearchResponse execute(java.lang.String filter) throws LdapException
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
public SearchResponse execute(FilterTemplate template) throws LdapException
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
public SearchResponse execute(Filter filter) throws LdapException
Executes a search request. SeeSearchOperationHandle.execute().- Parameters:
filter- search filter- Returns:
- search result
- Throws:
LdapException- if the connection cannot be opened
-
execute
public SearchResponse execute(java.lang.String filter, java.lang.String... returnAttributes) throws LdapException
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, java.lang.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
public SearchResponse execute(Filter filter, java.lang.String... returnAttributes) throws LdapException
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(java.lang.String filter, java.lang.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, java.lang.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, java.lang.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(java.lang.String baseDN, java.lang.String filter, java.lang.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(java.lang.String baseDN, FilterTemplate template, java.lang.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(java.lang.String baseDN, Filter filter, java.lang.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
public SearchResponse execute(SearchRequest req) throws LdapException
Description copied from interface:OperationSends an asynchronous request and waits for the response.- Parameters:
req- operation request- Returns:
- operation result
- Throws:
LdapException- if the operation fails
-
execute
public SearchResponse execute() throws LdapException
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
-
configureHandle
protected SearchOperationHandle configureHandle(SearchOperationHandle handle)
Adds configured functions to the supplied handle.- Parameters:
handle- to configure- Returns:
- configured handle
-
copy
public static SearchOperation copy(SearchOperation operation)
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
public java.lang.String toString()
- Overrides:
toStringin classAbstractOperation<SearchRequest,SearchResponse>
-
builder
public static SearchOperation.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-