Package org.ldaptive
Class AbstractOperationFactory<Q extends Request,S extends Result>
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.AbstractOperationFactory<Q,S>
-
- Type Parameters:
Q- type of requestS- type of result
- All Implemented Interfaces:
ConnectionFactoryManager,Freezable
- Direct Known Subclasses:
AbstractSearchOperationFactory
public abstract class AbstractOperationFactory<Q extends Request,S extends Result> extends AbstractFreezable implements ConnectionFactoryManager
Base class for classes that need to configure an operation.
-
-
Field Summary
Fields Modifier and Type Field Description private ResponseControlHandler[]controlHandlersFunctions to handle response controls.private ExceptionHandlerexceptionHandlerFunction to handle exceptions.private ConnectionFactoryfactoryConnection factory.private IntermediateResponseHandler[]intermediateResponseHandlersFunctions to handle intermediate responses.protected LoggerloggerLogger for this class.private ReferralHandler[]referralHandlersFunctions to handle referrals.private RequestHandler<Q>[]requestHandlersFunctions to handle requests.private ResultHandler[]resultHandlersFunctions to handle response results.private ResultPredicatethrowConditionFunction to test results.private UnsolicitedNotificationHandler[]unsolicitedNotificationHandlersFunctions to handle unsolicited notifications.
-
Constructor Summary
Constructors Constructor Description AbstractOperationFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfreeze()Freezes this object, making it immutable.ConnectionFactorygetConnectionFactory()Returns the connection factory.ResponseControlHandler[]getControlHandlers()Returns the control handlers.ExceptionHandlergetExceptionHandler()Returns the search exception handler.IntermediateResponseHandler[]getIntermediateResponseHandlers()Returns the intermediate response handlers.ReferralHandler[]getReferralHandlers()Returns the referral handlers.RequestHandler<Q>[]getRequestHandlers()Returns the request handlers.ResultHandler[]getResultHandlers()Returns the search result handlers.ResultPredicategetThrowCondition()Returns the throw condition.UnsolicitedNotificationHandler[]getUnsolicitedNotificationHandlers()Returns the unsolicited notification handlers.protected voidinitializeOperation(AbstractOperation<Q,S> op)Initializes the supplied operation with the properties configured on this factory.voidsetConnectionFactory(ConnectionFactory cf)Sets the connection factory.voidsetControlHandlers(ResponseControlHandler... handlers)Sets the control handlers.voidsetExceptionHandler(ExceptionHandler handler)Sets the search exception handler.voidsetIntermediateResponseHandlers(IntermediateResponseHandler... handlers)Sets the intermediate response handlers.voidsetReferralHandlers(ReferralHandler... handlers)Sets the referral handlers.voidsetRequestHandlers(RequestHandler<Q>... handlers)Sets the request handlers.voidsetResultHandlers(ResultHandler... handlers)Sets the search result handlers.voidsetThrowCondition(ResultPredicate function)Sets the throw condition.voidsetUnsolicitedNotificationHandlers(UnsolicitedNotificationHandler... handlers)Sets the unsolicited notification handlers.StringtoString()-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
factory
private ConnectionFactory factory
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.
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getConnectionFactory
public ConnectionFactory getConnectionFactory()
Returns the connection factory.- Specified by:
getConnectionFactoryin interfaceConnectionFactoryManager- Returns:
- connection factory
-
setConnectionFactory
public void setConnectionFactory(ConnectionFactory cf)
Sets the connection factory.- Specified by:
setConnectionFactoryin interfaceConnectionFactoryManager- Parameters:
cf- connection factory
-
getRequestHandlers
public RequestHandler<Q>[] getRequestHandlers()
Returns the request handlers.- Returns:
- request handlers
-
setRequestHandlers
public void setRequestHandlers(RequestHandler<Q>... handlers)
Sets the request handlers.- Parameters:
handlers- request handler
-
getResultHandlers
public ResultHandler[] getResultHandlers()
Returns the search result handlers.- Returns:
- search result handlers
-
setResultHandlers
public void setResultHandlers(ResultHandler... handlers)
Sets the search result handlers.- Parameters:
handlers- search result handlers
-
getControlHandlers
public ResponseControlHandler[] getControlHandlers()
Returns the control handlers.- Returns:
- control handlers
-
setControlHandlers
public void setControlHandlers(ResponseControlHandler... handlers)
Sets the control handlers.- Parameters:
handlers- control handlers
-
getReferralHandlers
public ReferralHandler[] getReferralHandlers()
Returns the referral handlers.- Returns:
- referral handlers
-
setReferralHandlers
public void setReferralHandlers(ReferralHandler... handlers)
Sets the referral handlers.- Parameters:
handlers- referral handlers
-
getIntermediateResponseHandlers
public IntermediateResponseHandler[] getIntermediateResponseHandlers()
Returns the intermediate response handlers.- Returns:
- intermediate response handlers
-
setIntermediateResponseHandlers
public void setIntermediateResponseHandlers(IntermediateResponseHandler... handlers)
Sets the intermediate response handlers.- Parameters:
handlers- intermediate response handlers
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
Returns the search exception handler.- Returns:
- search exception handler
-
setExceptionHandler
public void setExceptionHandler(ExceptionHandler handler)
Sets the search exception handler.- Parameters:
handler- search exception handler
-
getThrowCondition
public ResultPredicate getThrowCondition()
Returns the throw condition.- Returns:
- throw condition
-
setThrowCondition
public void setThrowCondition(ResultPredicate function)
Sets the throw condition.- Parameters:
function- throw condition
-
getUnsolicitedNotificationHandlers
public UnsolicitedNotificationHandler[] getUnsolicitedNotificationHandlers()
Returns the unsolicited notification handlers.- Returns:
- unsolicited notification handlers
-
setUnsolicitedNotificationHandlers
public void setUnsolicitedNotificationHandlers(UnsolicitedNotificationHandler... handlers)
Sets the unsolicited notification handlers.- Parameters:
handlers- unsolicited notification handlers
-
initializeOperation
protected void initializeOperation(AbstractOperation<Q,S> op)
Initializes the supplied operation with the properties configured on this factory.- Parameters:
op- operation to initialize
-
-