Q
- type of ldap requestS
- type of ldap responsepublic abstract class AbstractRetryOperationExceptionHandler<Q extends Request,S> extends Object implements OperationExceptionHandler<Q,S>
Modifier and Type | Field and Description |
---|---|
protected Logger |
logger
Logger for this class.
|
private int |
retry
Number of times to retry.
|
private int |
retryBackoff
Factor to multiply retry wait by.
|
private long |
retryWait
Amount of time in seconds to wait before retries.
|
Constructor and Description |
---|
AbstractRetryOperationExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract HandlerResult<Response<S>> |
createResult(Connection conn,
Q request,
Response<S> response)
Invoked if
handleInternal(org.ldaptive.Connection, Q, org.ldaptive.Response<S>) succeeded. |
int |
getRetry()
Returns the retry.
|
int |
getRetryBackoff()
Returns the retry backoff.
|
long |
getRetryWait()
Returns the retry wait.
|
HandlerResult<Response<S>> |
handle(Connection conn,
Q request,
Response<S> response)
Handle the supplied result.
|
protected abstract void |
handleInternal(Connection conn,
Q request,
Response<S> response)
Perform any operations required to recover from the operation exception.
|
protected boolean |
retry(int count)
Returns whether the supplied count indicates that the operation should be retried.
|
void |
setRetry(int i)
Sets the number of retries.
|
void |
setRetryBackoff(int backoff)
Sets the retry backoff.
|
void |
setRetryWait(long time)
Sets the retry wait.
|
protected final Logger logger
private int retry
private long retryWait
private int retryBackoff
public AbstractRetryOperationExceptionHandler()
public int getRetry()
public void setRetry(int i)
i
- to setpublic long getRetryWait()
public void setRetryWait(long time)
time
- in secondspublic int getRetryBackoff()
public void setRetryBackoff(int backoff)
backoff
- to setpublic HandlerResult<Response<S>> handle(Connection conn, Q request, Response<S> response) throws LdapException
Handler
handle
in interface Handler<Q extends Request,Response<S>>
handle
in interface OperationExceptionHandler<Q extends Request,S>
conn
- connection the operation was executed onrequest
- executed by the operationresponse
- produced from the operationLdapException
- if handling failsprotected abstract void handleInternal(Connection conn, Q request, Response<S> response) throws LdapException
conn
- connection the operation was executed onrequest
- executed by the operationresponse
- typically nullLdapException
- if the retry failsprotected abstract HandlerResult<Response<S>> createResult(Connection conn, Q request, Response<S> response) throws LdapException
handleInternal(org.ldaptive.Connection, Q, org.ldaptive.Response<S>)
succeeded. Creates a response for the original invocation that failed.conn
- connection the operation was executed onrequest
- executed by the operationresponse
- typically nullLdapException
- if the operation failsprotected boolean retry(int count)
count
- number of times the operation has been retriedCopyright © 2003-2019 Virginia Tech. All Rights Reserved.