Package org.ldaptive.transport
Class DefaultExtendedOperationHandle
- java.lang.Object
-
- org.ldaptive.transport.DefaultOperationHandle<ExtendedRequest,ExtendedResponse>
-
- org.ldaptive.transport.DefaultExtendedOperationHandle
-
- All Implemented Interfaces:
ExtendedOperationHandle
,OperationHandle<ExtendedRequest,ExtendedResponse>
public final class DefaultExtendedOperationHandle extends DefaultOperationHandle<ExtendedRequest,ExtendedResponse> implements ExtendedOperationHandle
Handle that notifies on the components of an extended request.
-
-
Field Summary
Fields Modifier and Type Field Description private ExtendedValueHandler[]
onExtended
Functions to handle extended response name and value.-
Fields inherited from class org.ldaptive.transport.DefaultOperationHandle
logger
-
-
Constructor Summary
Constructors Constructor Description DefaultExtendedOperationHandle(ExtendedRequest req, TransportConnection conn, Duration timeout)
Creates a new extended operation handle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extended(ExtendedResponse response)
InvokesonExtended
.ExtendedValueHandler[]
getOnExtended()
DefaultExtendedOperationHandle
onComplete(CompleteHandler function)
Sets the function to execute when the operation completes.DefaultExtendedOperationHandle
onControl(ResponseControlHandler... function)
Sets the functions to execute when a control is received.DefaultExtendedOperationHandle
onException(ExceptionHandler function)
Sets the function to execute when an exception occurs.DefaultExtendedOperationHandle
onExtended(ExtendedValueHandler... function)
Sets the function to execute when an extended result is received.DefaultExtendedOperationHandle
onIntermediate(IntermediateResponseHandler... function)
Sets the functions to execute when an intermediate response is received.DefaultExtendedOperationHandle
onReferral(ReferralHandler... function)
Sets the functions to execute when a referral is received.DefaultExtendedOperationHandle
onReferralResult(ReferralResultHandler<ExtendedResponse> function)
Sets the functions to execute when a response is complete and contains a referral result code.DefaultExtendedOperationHandle
onResult(ResultHandler... function)
Sets the functions to execute when a result is received.DefaultExtendedOperationHandle
onUnsolicitedNotification(UnsolicitedNotificationHandler... function)
Sets the functions to execute when an unsolicited notification is received.DefaultExtendedOperationHandle
send()
Sends this request to the server.DefaultExtendedOperationHandle
throwIf(ResultPredicate function)
Sets the function to determine whether an exception should be raised by a particular result.String
toString()
-
Methods inherited from class org.ldaptive.transport.DefaultOperationHandle
abandon, abandon, await, cancel, consumedMessage, consumedMessage, control, evaluateThrowCondition, exception, finalizeResult, getMessageID, getOnComplete, getOnControl, getOnException, getOnIntermediate, getOnReferral, getOnReferralResult, getOnResult, getOnUnsolicitedNotification, getReceivedTime, getRequest, getResponseTimeoutCondition, getSentTime, getThrowCondition, hasConsumedMessage, initializeMessageFunctional, initializeMessageFunctional, intermediate, messageID, 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.extended.ExtendedOperationHandle
await, execute
-
Methods inherited from interface org.ldaptive.OperationHandle
abandon, cancel, getReceivedTime, getSentTime
-
-
-
-
Field Detail
-
onExtended
private ExtendedValueHandler[] onExtended
Functions to handle extended response name and value.
-
-
Constructor Detail
-
DefaultExtendedOperationHandle
public DefaultExtendedOperationHandle(ExtendedRequest req, TransportConnection conn, Duration timeout)
Creates a new extended operation handle.- Parameters:
req
- search request to expect a response forconn
- the request will be executed ontimeout
- duration to wait for a response
-
-
Method Detail
-
send
public DefaultExtendedOperationHandle send()
Description copied from interface:OperationHandle
Sends this request to the server.- Specified by:
send
in interfaceExtendedOperationHandle
- Specified by:
send
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
send
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Returns:
- this handle
-
onResult
public DefaultExtendedOperationHandle onResult(ResultHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a result is received.- Specified by:
onResult
in interfaceExtendedOperationHandle
- Specified by:
onResult
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onResult
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on a result- Returns:
- this handle
-
onControl
public DefaultExtendedOperationHandle onControl(ResponseControlHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a control is received.- Specified by:
onControl
in interfaceExtendedOperationHandle
- Specified by:
onControl
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onControl
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on a control- Returns:
- this handle
-
onReferral
public DefaultExtendedOperationHandle onReferral(ReferralHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when a referral is received.- Specified by:
onReferral
in interfaceExtendedOperationHandle
- Specified by:
onReferral
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onReferral
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on a referral- Returns:
- this handle
-
onIntermediate
public DefaultExtendedOperationHandle onIntermediate(IntermediateResponseHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when an intermediate response is received.- Specified by:
onIntermediate
in interfaceExtendedOperationHandle
- Specified by:
onIntermediate
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onIntermediate
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on an intermediate response- Returns:
- this handle
-
onUnsolicitedNotification
public DefaultExtendedOperationHandle onUnsolicitedNotification(UnsolicitedNotificationHandler... function)
Description copied from interface:OperationHandle
Sets the functions to execute when an unsolicited notification is received.- Specified by:
onUnsolicitedNotification
in interfaceExtendedOperationHandle
- Specified by:
onUnsolicitedNotification
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onUnsolicitedNotification
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on an unsolicited notification- Returns:
- this handle
-
onReferralResult
public DefaultExtendedOperationHandle onReferralResult(ReferralResultHandler<ExtendedResponse> function)
Description copied from interface:OperationHandle
Sets the functions to execute when a response is complete and contains a referral result code.- Specified by:
onReferralResult
in interfaceExtendedOperationHandle
- Specified by:
onReferralResult
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onReferralResult
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on a referral response- Returns:
- this handle
-
onException
public DefaultExtendedOperationHandle onException(ExceptionHandler function)
Description copied from interface:OperationHandle
Sets the function to execute when an exception occurs.- Specified by:
onException
in interfaceExtendedOperationHandle
- Specified by:
onException
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onException
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute when an exception occurs- Returns:
- this handle
-
throwIf
public DefaultExtendedOperationHandle 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 interfaceExtendedOperationHandle
- Specified by:
throwIf
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
throwIf
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to determine whether to throw an exception- Returns:
- this handle
-
onComplete
public DefaultExtendedOperationHandle onComplete(CompleteHandler function)
Description copied from interface:OperationHandle
Sets the function to execute when the operation completes.- Specified by:
onComplete
in interfaceExtendedOperationHandle
- Specified by:
onComplete
in interfaceOperationHandle<ExtendedRequest,ExtendedResponse>
- Overrides:
onComplete
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
- Parameters:
function
- to execute on completion- Returns:
- this handle
-
onExtended
public DefaultExtendedOperationHandle onExtended(ExtendedValueHandler... function)
Description copied from interface:ExtendedOperationHandle
Sets the function to execute when an extended result is received.- Specified by:
onExtended
in interfaceExtendedOperationHandle
- Parameters:
function
- to execute on an extended result- Returns:
- this handle
-
getOnExtended
public ExtendedValueHandler[] getOnExtended()
-
extended
public void extended(ExtendedResponse response)
InvokesonExtended
.- Parameters:
response
- extended response
-
toString
public String toString()
- Overrides:
toString
in classDefaultOperationHandle<ExtendedRequest,ExtendedResponse>
-
-