Q - type of ldap requestS - type of ldap responsepublic abstract class AbstractReferralHandler<Q extends Request,S> extends Object implements ReferralHandler<Q,S>
| Modifier and Type | Field and Description |
|---|---|
private ReferralConnectionFactory |
connectionFactory
Referral connection factory.
|
protected static ReferralConnectionFactory |
DEFAULT_CONNECTION_FACTORY
Default referral connection factory.
|
protected static int |
DEFAULT_REFERRAL_LIMIT
Default referral limit.
|
protected Logger |
logger
Logger for this class.
|
private int |
referralDepth
Referral depth.
|
private int |
referralLimit
Referral limit.
|
| Constructor and Description |
|---|
AbstractReferralHandler(int limit,
int depth,
ReferralConnectionFactory factory)
Creates a new abstract referral handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Operation<Q,S> |
createReferralOperation(Connection conn)
Creates an operation for this type of referral.
|
protected abstract Q |
createReferralRequest(Q request,
LdapURL url)
Creates a new request for this type of referral.
|
protected Response<S> |
followReferral(Connection conn,
Q request,
String[] referralUrls)
Follows the supplied referral URLs in order until a SUCCESS or REFERRAL_LIMIT_EXCEEDED occurs.
|
ReferralConnectionFactory |
getReferralConnectionFactory()
Returns the referral connection factory.
|
int |
getReferralDepth()
Returns the referral depth of this handler.
|
int |
getReferralLimit()
Returns the maximum number of referrals to follow.
|
HandlerResult<Response<S>> |
handle(Connection conn,
Q request,
Response<S> response)
Handle the supplied result.
|
HandlerResult<Response<S>> |
handle(Connection conn,
Q request,
String[] referralUrls)
Implementation that does not require the response.
|
void |
initializeRequest(Q request)
Initialize the request for use with this referral handler.
|
protected static final int DEFAULT_REFERRAL_LIMIT
protected static final ReferralConnectionFactory DEFAULT_CONNECTION_FACTORY
DefaultConnectionFactory.protected final Logger logger
private final int referralLimit
private final int referralDepth
private final ReferralConnectionFactory connectionFactory
public AbstractReferralHandler(int limit,
int depth,
ReferralConnectionFactory factory)
limit - number of referrals to followdepth - number of referrals followedfactory - referral connection factorypublic int getReferralLimit()
public int getReferralDepth()
public ReferralConnectionFactory getReferralConnectionFactory()
protected abstract Q createReferralRequest(Q request, LdapURL url)
request - of the original operationurl - of the referralprotected abstract Operation<Q,S> createReferralOperation(Connection conn)
conn - to execute the operation onprotected Response<S> followReferral(Connection conn, Q request, String[] referralUrls) throws LdapException
conn - the original operation occurred onrequest - of the operation that produced a referralreferralUrls - produced by the requestLdapException - if a REFERRAL_LIMIT_EXCEEDED in encounteredpublic HandlerResult<Response<S>> handle(Connection conn, Q request, Response<S> response) throws LdapException
Handlerhandle in interface Handler<Q extends Request,Response<S>>handle in interface ReferralHandler<Q extends Request,S>conn - connection the operation was executed onrequest - executed by the operationresponse - produced from the operationLdapException - if handling failspublic HandlerResult<Response<S>> handle(Connection conn, Q request, String[] referralUrls) throws LdapException
conn - the operation occurred onrequest - the operation executedreferralUrls - encountered in the operationLdapException - if an error occurs following referralspublic void initializeRequest(Q request)
ReferralHandlerinitializeRequest in interface ReferralHandler<Q extends Request,S>request - to initialize for this referral handlerCopyright © 2003-2019 Virginia Tech. All Rights Reserved.