Package org.ldaptive
Interface SearchOperationHandle
-
- All Superinterfaces:
OperationHandle<SearchRequest,SearchResponse>
- All Known Implementing Classes:
DefaultSearchOperationHandle
public interface SearchOperationHandle extends OperationHandle<SearchRequest,SearchResponse>
Handle that notifies on the components of a search request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SearchResponse
await()
Waits for a result or reports a timeout exception.default SearchResponse
execute()
Convenience method that invokesOperationHandle.send()
followed byOperationHandle.await()
.SearchOperationHandle
onComplete(CompleteHandler function)
Sets the function to execute when the operation completes.SearchOperationHandle
onControl(ResponseControlHandler... function)
Sets the functions to execute when a control is received.SearchOperationHandle
onEntry(LdapEntryHandler... function)
Sets the functions to execute when a search result entry is received.SearchOperationHandle
onException(ExceptionHandler function)
Sets the function to execute when an exception occurs.SearchOperationHandle
onIntermediate(IntermediateResponseHandler... function)
Sets the functions to execute when an intermediate response is received.SearchOperationHandle
onReference(SearchReferenceHandler... function)
Sets the functions to execute when a search result reference is received.SearchOperationHandle
onReferral(ReferralHandler... function)
Sets the functions to execute when a referral is received.SearchOperationHandle
onResult(ResultHandler... function)
Sets the functions to execute when a result is received.SearchOperationHandle
onSearchResult(SearchResultHandler... function)
Sets the functions to execute when a search result is complete.SearchOperationHandle
onUnsolicitedNotification(UnsolicitedNotificationHandler... function)
Sets the functions to execute when an unsolicited notification is received.SearchOperationHandle
send()
Sends this request to the server.SearchOperationHandle
throwIf(ResultPredicate function)
Sets the function to determine whether an exception should be raised by a particular result.-
Methods inherited from interface org.ldaptive.OperationHandle
abandon, cancel, getReceivedTime, getSentTime
-
-
-
-
Method Detail
-
send
SearchOperationHandle send()
Description copied from interface:OperationHandle
Sends this request to the server.- Specified by:
send
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Returns:
- this handle
-
await
SearchResponse await() throws LdapException
Description copied from interface:OperationHandle
Waits for a result or reports a timeout exception.- Specified by:
await
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Returns:
- result of the operation or empty if the operation is abandoned
- Throws:
LdapException
- if an error occurs executing the request
-
execute
default SearchResponse execute() throws LdapException
Description copied from interface:OperationHandle
Convenience method that invokesOperationHandle.send()
followed byOperationHandle.await()
. Provides a single method to make a synchronous request.- Specified by:
execute
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Returns:
- result of the operation or empty if the operation is abandoned
- Throws:
LdapException
- if an error occurs executing the request
-
onResult
SearchOperationHandle onResult(ResultHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a result is received.- Specified by:
onResult
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on a result- Returns:
- this handle
-
onControl
SearchOperationHandle onControl(ResponseControlHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a control is received.- Specified by:
onControl
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on a control- Returns:
- this handle
-
onReferral
SearchOperationHandle onReferral(ReferralHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a referral is received.- Specified by:
onReferral
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on a referral- Returns:
- this handle
-
onIntermediate
SearchOperationHandle onIntermediate(IntermediateResponseHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when an intermediate response is received.- Specified by:
onIntermediate
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on an intermediate response- Returns:
- this handle
-
onUnsolicitedNotification
SearchOperationHandle onUnsolicitedNotification(UnsolicitedNotificationHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when an unsolicited notification is received.- Specified by:
onUnsolicitedNotification
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on an unsolicited notification- Returns:
- this handle
-
onException
SearchOperationHandle onException(ExceptionHandler function)
Description copied from interface:OperationHandle
Sets the function to execute when an exception occurs.- Specified by:
onException
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute when an exception occurs- Returns:
- this handle
-
onComplete
SearchOperationHandle onComplete(CompleteHandler function)
Description copied from interface:OperationHandle
Sets the function to execute when the operation completes.- Specified by:
onComplete
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to execute on completion- Returns:
- this handle
-
throwIf
SearchOperationHandle throwIf(ResultPredicate function)
Description copied from interface:OperationHandle
Sets the function to determine whether an exception should be raised by a particular result.- Specified by:
throwIf
in interfaceOperationHandle<SearchRequest,SearchResponse>
- Parameters:
function
- to determine whether to throw an exception- Returns:
- this handle
-
onEntry
SearchOperationHandle onEntry(LdapEntryHandler... function)
Sets the functions to execute when a search result entry is received.- Parameters:
function
- to execute on a search result entry- Returns:
- this handle
-
onReference
SearchOperationHandle onReference(SearchReferenceHandler... function)
Sets the functions to execute when a search result reference is received.- Parameters:
function
- to execute on a search result reference- Returns:
- this handle
-
onSearchResult
SearchOperationHandle onSearchResult(SearchResultHandler... function)
Sets the functions to execute when a search result is complete.- Parameters:
function
- to execute on a search result- Returns:
- this handle
-
-