Package org.ldaptive.transport
Class DefaultCompareOperationHandle
java.lang.Object
org.ldaptive.transport.DefaultOperationHandle<CompareRequest,CompareResponse>
org.ldaptive.transport.DefaultCompareOperationHandle
- All Implemented Interfaces:
CompareOperationHandle,OperationHandle<CompareRequest,CompareResponse>
public class DefaultCompareOperationHandle
extends DefaultOperationHandle<CompareRequest,CompareResponse>
implements CompareOperationHandle
Handle that notifies on the components of a compare request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CompareValueHandler[]Functions to handle the compare result.Fields inherited from class org.ldaptive.transport.DefaultOperationHandle
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCompareOperationHandle(CompareRequest req, TransportConnection conn, Duration timeout) Creates a new compare operation handle. -
Method Summary
Modifier and TypeMethodDescriptionawait()Waits for a result or reports a timeout exception.voidcompare(CompareResponse response) InvokesonCompare.onCompare(CompareValueHandler... function) Sets the function to execute when a compare result is received.onComplete(CompleteHandler function) Sets the function to execute when the operation completes.onControl(ResponseControlHandler... function) Sets the functions to execute when a control is received.onException(ExceptionHandler function) Sets the function to execute when an exception occurs.onIntermediate(IntermediateResponseHandler... function) Sets the functions to execute when an intermediate response is received.onReferral(ReferralHandler... function) Sets the functions to execute when a referral is received.onResult(ResultHandler... function) Sets the functions to execute when a result is received.onUnsolicitedNotification(UnsolicitedNotificationHandler... function) Sets the functions to execute when an unsolicited notification is received.send()Sends this request to the server.throwIf(ResultPredicate function) Sets the function to determine whether an exception should be raised by a particular result.toString()Methods inherited from class org.ldaptive.transport.DefaultOperationHandle
abandon, abandon, cancel, consumedMessage, control, exception, getMessageID, getOnComplete, getOnControl, getOnException, getOnIntermediate, getOnReferral, getOnResult, getOnUnsolicitedNotification, getReceivedTime, getRequest, getSentTime, getThrowCondition, hasConsumedMessage, initializeMessageFunctional, intermediate, messageID, referral, result, sent, unsolicitedNotificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ldaptive.CompareOperationHandle
executeMethods inherited from interface org.ldaptive.OperationHandle
abandon, cancel, getReceivedTime, getSentTime
-
Field Details
-
onCompare
Functions to handle the compare result.
-
-
Constructor Details
-
DefaultCompareOperationHandle
public DefaultCompareOperationHandle(CompareRequest req, TransportConnection conn, Duration timeout) Creates a new compare operation handle.- Parameters:
req- compare request to expect a response forconn- the request will be executed ontimeout- duration to wait for a response
-
-
Method Details
-
send
Description copied from interface:OperationHandleSends this request to the server.- Specified by:
sendin interfaceCompareOperationHandle- Specified by:
sendin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
sendin classDefaultOperationHandle<CompareRequest,CompareResponse> - Returns:
- this handle
-
await
Description copied from interface:OperationHandleWaits for a result or reports a timeout exception.- Specified by:
awaitin interfaceCompareOperationHandle- Specified by:
awaitin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
awaitin classDefaultOperationHandle<CompareRequest,CompareResponse> - Returns:
- result of the operation or empty if the operation is abandoned
- Throws:
LdapException- if an error occurs executing the request
-
onResult
Description copied from interface:OperationHandleSets the functions to execute when a result is received.- Specified by:
onResultin interfaceCompareOperationHandle- Specified by:
onResultin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onResultin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on a result- Returns:
- this handle
-
onControl
Description copied from interface:OperationHandleSets the functions to execute when a control is received.- Specified by:
onControlin interfaceCompareOperationHandle- Specified by:
onControlin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onControlin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on a control- Returns:
- this handle
-
onReferral
Description copied from interface:OperationHandleSets the functions to execute when a referral is received.- Specified by:
onReferralin interfaceCompareOperationHandle- Specified by:
onReferralin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onReferralin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on a referral- Returns:
- this handle
-
onIntermediate
Description copied from interface:OperationHandleSets the functions to execute when an intermediate response is received.- Specified by:
onIntermediatein interfaceCompareOperationHandle- Specified by:
onIntermediatein interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onIntermediatein classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on an intermediate response- Returns:
- this handle
-
onUnsolicitedNotification
public DefaultCompareOperationHandle onUnsolicitedNotification(UnsolicitedNotificationHandler... function) Description copied from interface:OperationHandleSets the functions to execute when an unsolicited notification is received.- Specified by:
onUnsolicitedNotificationin interfaceCompareOperationHandle- Specified by:
onUnsolicitedNotificationin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onUnsolicitedNotificationin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on an unsolicited notification- Returns:
- this handle
-
onException
Description copied from interface:OperationHandleSets the function to execute when an exception occurs.- Specified by:
onExceptionin interfaceCompareOperationHandle- Specified by:
onExceptionin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onExceptionin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute when an exception occurs- Returns:
- this handle
-
throwIf
Description copied from interface:OperationHandleSets the function to determine whether an exception should be raised by a particular result.- Specified by:
throwIfin interfaceCompareOperationHandle- Specified by:
throwIfin interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
throwIfin classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to determine whether to throw an exception- Returns:
- this handle
-
onComplete
Description copied from interface:OperationHandleSets the function to execute when the operation completes.- Specified by:
onCompletein interfaceCompareOperationHandle- Specified by:
onCompletein interfaceOperationHandle<CompareRequest,CompareResponse> - Overrides:
onCompletein classDefaultOperationHandle<CompareRequest,CompareResponse> - Parameters:
function- to execute on completion- Returns:
- this handle
-
onCompare
Sets the function to execute when a compare result is received.- Specified by:
onComparein interfaceCompareOperationHandle- Parameters:
function- to execute on a compare result- Returns:
- this handle
-
compare
InvokesonCompare.- Parameters:
response- compare response
-
toString
- Overrides:
toStringin classDefaultOperationHandle<CompareRequest,CompareResponse>
-