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(@NonNull RetryConfiguration retryConfiguration)
Creates a new retrier with the given configuration.
|
Modifier and Type | Method and Description |
---|---|
protected <REQUEST,RESPONSE> |
doFunctionCall(REQUEST request,
@NonNull Function<REQUEST,RESPONSE> functionCall)
Executes the actual function call.
|
<REQUEST,RESPONSE> |
execute(REQUEST requestToUse,
@NonNull Function<REQUEST,RESPONSE> functionCall)
Executes the functionCall based upon the
RetryConfiguration of this retrier |
RetryCondition |
getRetryCondition() |
public BmcGenericRetrier(@NonNull @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 @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.protected <REQUEST,RESPONSE> RESPONSE doFunctionCall(@NonNull REQUEST request, @NonNull @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 callpublic RetryCondition getRetryCondition()
Copyright © 2016–2021. All rights reserved.