Top Description Fields Constructors Methods
com.oracle.bmc.retrier

public Class BmcGenericRetrier

extends Object
Class Inheritance
Known Direct Subclasses
com.oracle.bmc.retrier.TokenRefreshRetrier
Imports
com.oracle.bmc.model.BmcException, com.oracle.bmc.waiter.GenericWaiter, .WaiterScheduler, jakarta.annotation.Nonnull, .Nullable, java.util.Objects, .Optional, java.util.concurrent.CompletableFuture, .CompletionException, .CompletionStage, java.util.concurrent.atomic.AtomicReference, java.util.function.Function, .Predicate, .Supplier

A generic retrier that can be used to implement custom retry behavior for specific types of calls.

Field Summary

Modifier and TypeField and Description
private static final Logger
private final RetryCondition
private final GenericWaiter

Constructor Summary

AccessConstructor and Description
public
BmcGenericRetrier(final RetryConfiguration
The retry configuration to use.
retryConfiguration
)

Creates a new retrier with the given configuration.

Method Summary

Modifier and TypeMethod and Description
protected <
Request object class
REQUEST
,
Response object class
RESPONSE
>
RESPONSE

Returns:

The successful response
doFunctionCall
(REQUEST
request data for the function call
request
,
Function<REQUEST, RESPONSE>
Function that will be invoked to send out the request.
functionCall
)

Executes the actual function call.

protected <REQUEST, RESPONSE> CompletionStage<RESPONSE>
doFunctionCallAsync(REQUEST request, Function<REQUEST, CompletionStage<RESPONSE>> functionCall)

public <
Request object class
REQUEST
,
Response object class
RESPONSE
>
RESPONSE

Returns:

The successful response
execute
(final REQUEST
The request that is passed to the functionCall
requestToUse
,
final Function<REQUEST, RESPONSE>
Function that will be invoked to send out the request.
functionCall
)

Executes the functionCall based upon the RetryConfiguration of this retrier

public final <REQUEST, RESPONSE> CompletionStage<RESPONSE>
executeAsync(WaiterScheduler runner, final REQUEST requestToUse, final Function<REQUEST, CompletionStage<RESPONSE>> functionCall)

public RetryCondition
public GenericWaiter
private static Throwable
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
retryConditionback to summary
private final RetryCondition retryCondition
waiterback to summary
private final GenericWaiter waiter

Constructor Detail

BmcGenericRetrierback to summary
public BmcGenericRetrier(final RetryConfiguration retryConfiguration)

Creates a new retrier with the given configuration.

Parameters
retryConfiguration:RetryConfiguration

The retry configuration to use.

Method Detail

doFunctionCallback to summary
protected <REQUEST, RESPONSE> RESPONSE doFunctionCall(REQUEST request, Function<REQUEST, RESPONSE> functionCall)

Executes the actual function call. Can be overridden, e.g. for debugging.

Parameters
<REQUEST>
Request object class
<RESPONSE>
Response object class
request:REQUEST

request data for the function call

functionCall:Function<REQUEST, RESPONSE>

Function that will be invoked to send out the request.

Returns:RESPONSE

The successful response

doFunctionCallAsyncback to summary
protected <REQUEST, RESPONSE> CompletionStage<RESPONSE> doFunctionCallAsync(REQUEST request, Function<REQUEST, CompletionStage<RESPONSE>> functionCall)
executeback to summary
public <REQUEST, RESPONSE> RESPONSE execute(final REQUEST requestToUse, final Function<REQUEST, RESPONSE> functionCall)

Executes the functionCall based upon the RetryConfiguration of this retrier

Parameters
<REQUEST>
Request object class
<RESPONSE>
Response object class
requestToUse:REQUEST

The request that is passed to the functionCall

functionCall:Function<REQUEST, RESPONSE>

Function that will be invoked to send out the request.

Returns:RESPONSE

The successful response

executeAsyncback to summary
public final <REQUEST, RESPONSE> CompletionStage<RESPONSE> executeAsync(WaiterScheduler runner, final REQUEST requestToUse, final Function<REQUEST, CompletionStage<RESPONSE>> functionCall)
getRetryConditionback to summary
public RetryCondition getRetryCondition()
getWaiterback to summary
public GenericWaiter getWaiter()
unwrapback to summary
private static Throwable unwrap(Throwable t)