public class BmcGenericRetrier extends Object
A generic retrier that can be used to implement custom retry behavior for specific types of calls.
| Constructor and Description |
|---|
BmcGenericRetrier(RetryConfiguration retryConfiguration)
Creates a new retrier with the given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected <REQUEST,RESPONSE> |
doFunctionCall(REQUEST request,
Function<REQUEST,RESPONSE> functionCall)
Executes the actual function call.
|
protected <REQUEST,RESPONSE> |
doFunctionCallAsync(REQUEST request,
Function<REQUEST,CompletionStage<RESPONSE>> functionCall) |
<REQUEST,RESPONSE> |
execute(REQUEST requestToUse,
Function<REQUEST,RESPONSE> functionCall)
Executes the functionCall based upon the
RetryConfiguration of this retrier |
<REQUEST,RESPONSE> |
executeAsync(WaiterScheduler runner,
REQUEST requestToUse,
Function<REQUEST,CompletionStage<RESPONSE>> functionCall) |
RetryCondition |
getRetryCondition() |
GenericWaiter |
getWaiter() |
public BmcGenericRetrier(@Nonnull
RetryConfiguration retryConfiguration)
Creates a new retrier with the given configuration.
retryConfiguration - The retry configuration to use.public <REQUEST,RESPONSE> RESPONSE execute(@Nonnull
REQUEST requestToUse,
@Nonnull
Function<REQUEST,RESPONSE> functionCall)
Executes the functionCall based upon the RetryConfiguration of this retrier
REQUEST - Request object classRESPONSE - Response object classrequestToUse - The request that is passed to the functionCallfunctionCall - Function that will be invoked to send out the request.public final <REQUEST,RESPONSE> CompletionStage<RESPONSE> executeAsync(WaiterScheduler runner, @Nonnull REQUEST requestToUse, @Nonnull Function<REQUEST,CompletionStage<RESPONSE>> functionCall)
protected <REQUEST,RESPONSE> RESPONSE doFunctionCall(@Nonnull
REQUEST request,
@Nonnull
Function<REQUEST,RESPONSE> functionCall)
Executes the actual function call. Can be overridden, e.g. for debugging.
REQUEST - Request object classRESPONSE - Response object classfunctionCall - Function that will be invoked to send out the request.request - request data for the function callprotected <REQUEST,RESPONSE> CompletionStage<RESPONSE> doFunctionCallAsync(@Nullable @Nonnull REQUEST request, @Nonnull Function<REQUEST,CompletionStage<RESPONSE>> functionCall)
public GenericWaiter getWaiter()
public RetryCondition getRetryCondition()
Copyright © 2016–2024. All rights reserved.