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 final class DefaultCompareOperationHandle extends DefaultOperationHandle<CompareRequest,CompareResponse> implements CompareOperationHandle
Handle that notifies on the components of a compare request.
-
-
Field Summary
Fields Modifier and Type Field Description private CompareValueHandler[]onCompareFunctions to handle the compare result.-
Fields inherited from class org.ldaptive.transport.DefaultOperationHandle
logger
-
-
Constructor Summary
Constructors Constructor Description DefaultCompareOperationHandle(CompareRequest req, TransportConnection conn, Duration timeout)Creates a new compare operation handle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompare(CompareResponse response)InvokesonCompare.CompareValueHandler[]getOnCompare()DefaultCompareOperationHandleonCompare(CompareValueHandler... function)Sets the function to execute when a compare result is received.DefaultCompareOperationHandleonComplete(CompleteHandler function)Sets the function to execute when the operation completes.DefaultCompareOperationHandleonControl(ResponseControlHandler... function)Sets the functions to execute when a control is received.DefaultCompareOperationHandleonException(ExceptionHandler function)Sets the function to execute when an exception occurs.DefaultCompareOperationHandleonIntermediate(IntermediateResponseHandler... function)Sets the functions to execute when an intermediate response is received.DefaultCompareOperationHandleonReferral(ReferralHandler... function)Sets the functions to execute when a referral is received.DefaultCompareOperationHandleonReferralResult(ReferralResultHandler<CompareResponse> function)Sets the functions to execute when a response is complete and contains a referral result code.DefaultCompareOperationHandleonResult(ResultHandler... function)Sets the functions to execute when a result is received.DefaultCompareOperationHandleonUnsolicitedNotification(UnsolicitedNotificationHandler... function)Sets the functions to execute when an unsolicited notification is received.DefaultCompareOperationHandlesend()Sends this request to the server.DefaultCompareOperationHandlethrowIf(ResultPredicate function)Sets the function to determine whether an exception should be raised by a particular result.StringtoString()-
Methods inherited from class org.ldaptive.transport.DefaultOperationHandle
abandon, abandon, await, cancel, consumedMessage, consumedMessage, control, evaluateThrowCondition, exception, finalizeResult, getAbandonedTime, getMessageID, getOnComplete, getOnControl, getOnException, getOnIntermediate, getOnReferral, getOnReferralResult, getOnResult, getOnUnsolicitedNotification, getReceivedTime, getRequest, getResponseTimeoutCondition, getSentTime, getThrowCondition, hasConsumedMessage, initializeMessageFunctional, initializeMessageFunctional, intermediate, messageID, notifyExceptionHandlers, processHandlerException, processReferralResult, processResult, referral, result, sent, unsolicitedNotification
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.CompareOperationHandle
await, execute
-
Methods inherited from interface org.ldaptive.OperationHandle
abandon, cancel, getAbandonedTime, getReceivedTime, getSentTime
-
-
-
-
Field Detail
-
onCompare
private CompareValueHandler[] onCompare
Functions to handle the compare result.
-
-
Constructor Detail
-
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 Detail
-
send
public DefaultCompareOperationHandle 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
-
onResult
public DefaultCompareOperationHandle onResult(ResultHandler... function)
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
public DefaultCompareOperationHandle onControl(ResponseControlHandler... function)
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
public DefaultCompareOperationHandle onReferral(ReferralHandler... function)
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
public DefaultCompareOperationHandle onIntermediate(IntermediateResponseHandler... function)
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
-
onReferralResult
public DefaultCompareOperationHandle onReferralResult(ReferralResultHandler<CompareResponse> function)
Description copied from interface:OperationHandleSets the functions to execute when a response is complete and contains a referral result code.- Specified by:
onReferralResultin interfaceCompareOperationHandle- Specified by:
onReferralResultin interfaceOperationHandle<CompareRequest,CompareResponse>- Overrides:
onReferralResultin classDefaultOperationHandle<CompareRequest,CompareResponse>- Parameters:
function- to execute on a referral response- Returns:
- this handle
-
onException
public DefaultCompareOperationHandle onException(ExceptionHandler function)
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
public DefaultCompareOperationHandle throwIf(ResultPredicate function)
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
public DefaultCompareOperationHandle onComplete(CompleteHandler function)
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
public DefaultCompareOperationHandle onCompare(CompareValueHandler... function)
Description copied from interface:CompareOperationHandleSets 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
-
getOnCompare
public CompareValueHandler[] getOnCompare()
-
compare
public void compare(CompareResponse response)
InvokesonCompare.- Parameters:
response- compare response
-
toString
public String toString()
- Overrides:
toStringin classDefaultOperationHandle<CompareRequest,CompareResponse>
-
-