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 Classes Modifier and Type Class Description protected static class
AbstractOperation.AbstractBuilder<B,T extends AbstractOperation>
Base class for operation builders.
-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactory
connectionFactory
Connection factory.private ResponseControlHandler[]
controlHandlers
Functions to handle response controls.private ExceptionHandler
exceptionHandler
Function to handle exceptions.private IntermediateResponseHandler[]
intermediateResponseHandlers
Functions to handle intermediate responses.private ReferralHandler[]
referralHandlers
Functions to handle referrals.private ReferralResultHandler<S>
referralResultHandler
Functions to handle referral responses.private RequestHandler<Q>[]
requestHandlers
Functions to handle requests.private ResultHandler[]
resultHandlers
Functions to handle response results.private ResultPredicate
throwCondition
Function to test results.private UnsolicitedNotificationHandler[]
unsolicitedNotificationHandlers
Functions to handle unsolicited notifications.
-
Constructor Summary
Constructors Constructor Description AbstractOperation()
Default constructor.AbstractOperation(ConnectionFactory factory)
Creates a new abstract operation.
-
Method Summary
-
-
-
Field Detail
-
connectionFactory
private ConnectionFactory connectionFactory
Connection factory.
-
requestHandlers
private RequestHandler<Q extends Request>[] requestHandlers
Functions to handle requests.
-
resultHandlers
private ResultHandler[] resultHandlers
Functions to handle response results.
-
controlHandlers
private ResponseControlHandler[] controlHandlers
Functions to handle response controls.
-
referralHandlers
private ReferralHandler[] referralHandlers
Functions to handle referrals.
-
intermediateResponseHandlers
private IntermediateResponseHandler[] intermediateResponseHandlers
Functions to handle intermediate responses.
-
exceptionHandler
private ExceptionHandler exceptionHandler
Function to handle exceptions.
-
throwCondition
private ResultPredicate throwCondition
Function to test results.
-
unsolicitedNotificationHandlers
private UnsolicitedNotificationHandler[] unsolicitedNotificationHandlers
Functions to handle unsolicited notifications.
-
referralResultHandler
private ReferralResultHandler<S extends Result> referralResultHandler
Functions to handle referral responses.
-
-
Constructor Detail
-
AbstractOperation
public AbstractOperation()
Default constructor.
-
AbstractOperation
public AbstractOperation(ConnectionFactory factory)
Creates a new abstract operation.- Parameters:
factory
- connection factory
-
-
Method Detail
-
getConnectionFactory
public ConnectionFactory getConnectionFactory()
-
setConnectionFactory
public void setConnectionFactory(ConnectionFactory factory)
-
getRequestHandlers
public RequestHandler<Q>[] getRequestHandlers()
-
setRequestHandlers
public void setRequestHandlers(RequestHandler<Q>... handlers)
-
getResultHandlers
public ResultHandler[] getResultHandlers()
-
setResultHandlers
public void setResultHandlers(ResultHandler... handlers)
-
getControlHandlers
public ResponseControlHandler[] getControlHandlers()
-
setControlHandlers
public void setControlHandlers(ResponseControlHandler... handlers)
-
getReferralHandlers
public ReferralHandler[] getReferralHandlers()
-
setReferralHandlers
public void setReferralHandlers(ReferralHandler... handlers)
-
getIntermediateResponseHandlers
public IntermediateResponseHandler[] getIntermediateResponseHandlers()
-
setIntermediateResponseHandlers
public void setIntermediateResponseHandlers(IntermediateResponseHandler... handlers)
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
-
setExceptionHandler
public void setExceptionHandler(ExceptionHandler handler)
-
getThrowCondition
public ResultPredicate getThrowCondition()
-
setThrowCondition
public void setThrowCondition(ResultPredicate function)
-
getUnsolicitedNotificationHandlers
public UnsolicitedNotificationHandler[] getUnsolicitedNotificationHandlers()
-
setUnsolicitedNotificationHandlers
public void setUnsolicitedNotificationHandlers(UnsolicitedNotificationHandler... handlers)
-
getReferralResultHandler
public ReferralResultHandler<S> getReferralResultHandler()
-
setReferralResultHandler
public void setReferralResultHandler(ReferralResultHandler<S> handler)
-
configureRequest
protected Q configureRequest(Q request)
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
protected OperationHandle<Q,S> configureHandle(OperationHandle<Q,S> handle)
Adds configured functions to the supplied handle.- Parameters:
handle
- to configure- Returns:
- configured handle
-
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
-
-