Package org.ldaptive
Class AbstractOperation<Q extends Request,S extends Result>
java.lang.Object
org.ldaptive.AbstractOperation<Q,S>
- Type Parameters:
Q- type of requestS- type of result
- All Implemented Interfaces:
Operation<Q,S>
- Direct Known Subclasses:
AddOperation,BindOperation,CompareOperation,DeleteOperation,ExtendedOperation,ModifyDnOperation,ModifyOperation,SearchOperation
public abstract class AbstractOperation<Q extends Request,S extends Result>
extends Object
implements Operation<Q,S>
Base class for operations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classBase class for operation builders. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConnectionFactoryConnection factory.private ResponseControlHandler[]Functions to handle response controls.private ExceptionHandlerFunction to handle exceptions.private IntermediateResponseHandler[]Functions to handle intermediate responses.private ReferralHandler[]Functions to handle referrals.private ReferralResultHandler<S>Functions to handle referral responses.private RequestHandler<Q>[]Functions to handle requests.private ResultHandler[]Functions to handle response results.private ResultPredicateFunction to test results.private UnsolicitedNotificationHandler[]Functions to handle unsolicited notifications. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AbstractOperation(ConnectionFactory factory) Creates a new abstract operation. -
Method Summary
Modifier and TypeMethodDescriptionprotected OperationHandle<Q,S> configureHandle(OperationHandle<Q, S> handle) Adds configured functions to the supplied handle.protected QconfigureRequest(Q request) Applies any configured request handlers to the supplied request.copy(AbstractOperation<Q, S> from, AbstractOperation<Q, S> to, boolean deep) Copies properties from one operation to another.Returns the connection factory.Returns the control handlers.Returns the exception handler.Returns the intermediate response handlers.Returns the referral handlers.Returns the referral result handler.RequestHandler<Q>[]Returns the request handlers.Returns the result handlers.Returns the throw condition.Returns the unsolicited notification handlers.voidsetConnectionFactory(ConnectionFactory factory) Sets the connection factory.voidsetControlHandlers(ResponseControlHandler... handlers) Sets the control handlers.voidsetExceptionHandler(ExceptionHandler handler) Sets the exception handler.voidSets the intermediate response handlers.voidsetReferralHandlers(ReferralHandler... handlers) Sets the referral handlers.voidsetReferralResultHandler(ReferralResultHandler<S> handler) Sets the referral result handler.voidsetRequestHandlers(RequestHandler<Q>... handlers) Sets the request handlers.voidsetResultHandlers(ResultHandler... handlers) Sets the result handlers.voidsetThrowCondition(ResultPredicate function) Sets the throw condition.voidSets the unsolicited notification handlers.toString()
-
Field Details
-
connectionFactory
Connection factory. -
requestHandlers
Functions to handle requests. -
resultHandlers
Functions to handle response results. -
controlHandlers
Functions to handle response controls. -
referralHandlers
Functions to handle referrals. -
intermediateResponseHandlers
Functions to handle intermediate responses. -
exceptionHandler
Function to handle exceptions. -
throwCondition
Function to test results. -
unsolicitedNotificationHandlers
Functions to handle unsolicited notifications. -
referralResultHandler
Functions to handle referral responses.
-
-
Constructor Details
-
AbstractOperation
public AbstractOperation()Default constructor. -
AbstractOperation
Creates a new abstract operation.- Parameters:
factory- connection factory
-
-
Method Details
-
getConnectionFactory
Returns the connection factory.- Returns:
- connection factory
-
setConnectionFactory
Sets the connection factory.- Parameters:
factory- connection factory
-
getRequestHandlers
Returns the request handlers.- Returns:
- request handlers
-
setRequestHandlers
Sets the request handlers.- Parameters:
handlers- request handlers
-
getResultHandlers
Returns the result handlers.- Returns:
- result handlers
-
setResultHandlers
Sets the result handlers.- Parameters:
handlers- result handlers
-
getControlHandlers
Returns the control handlers.- Returns:
- control handlers
-
setControlHandlers
Sets the control handlers.- Parameters:
handlers- control handlers
-
getReferralHandlers
Returns the referral handlers.- Returns:
- referral handlers
-
setReferralHandlers
Sets the referral handlers.- Parameters:
handlers- referral handlers
-
getIntermediateResponseHandlers
Returns the intermediate response handlers.- Returns:
- intermediate response handlers
-
setIntermediateResponseHandlers
Sets the intermediate response handlers.- Parameters:
handlers- intermediate response handlers
-
getExceptionHandler
Returns the exception handler.- Returns:
- exception handler
-
setExceptionHandler
Sets the exception handler.- Parameters:
handler- exception handler
-
getThrowCondition
Returns the throw condition.- Returns:
- throw condition
-
setThrowCondition
Sets the throw condition.- Parameters:
function- throw condition
-
getUnsolicitedNotificationHandlers
Returns the unsolicited notification handlers.- Returns:
- unsolicited notification handlers
-
setUnsolicitedNotificationHandlers
Sets the unsolicited notification handlers.- Parameters:
handlers- unsolicited notification handlers
-
getReferralResultHandler
Returns the referral result handler.- Returns:
- referral result handler
-
setReferralResultHandler
Sets the referral result handler.- Parameters:
handler- referral result handler
-
configureRequest
Applies any configured request handlers to the supplied request. Returns the supplied request unaltered if no request handlers are configured.- Parameters:
request- to configure- Returns:
- configured request
-
configureHandle
Adds configured functions to the supplied handle.- Parameters:
handle- to configure- Returns:
- configured handle
-
toString
-
copy
protected static <Q extends Request,S extends Result> void copy(AbstractOperation<Q, S> from, AbstractOperation<Q, S> to, boolean deep) Copies properties from one operation to another.- Type Parameters:
Q- type of requestS- type of result- Parameters:
from- to copy properties fromto- to copy properties todeep- whether to make a deep copy
-