Package com.oracle.bmc.util.internal
Class RefreshAuthTokenWrappingAsyncHandler<REQUEST,RESPONSE>
- java.lang.Object
-
- com.oracle.bmc.util.internal.RefreshAuthTokenWrappingAsyncHandler<REQUEST,RESPONSE>
-
- Type Parameters:
REQUEST
- The request type.RESPONSE
- The response type.
- All Implemented Interfaces:
AsyncHandler<REQUEST,RESPONSE>
public abstract class RefreshAuthTokenWrappingAsyncHandler<REQUEST,RESPONSE> extends Object implements AsyncHandler<REQUEST,RESPONSE>
Deprecated.in favor of RefreshAuthTokenWrapper – versions after 1.25.1 do not use RefreshAuthTokenWrappingAsyncHandler anymoreCallbacks for asynchronous requests intended to work with some authenticated calls, like instance principals.This handler wraps a base AsyncHandler and has additional logic so that if a call fails with a 401, we’ll refresh the auth token and then try again up to a given number of retries (it is recommended that we only do one retry).
This is to account for scenarios where we have a valid/non-expired token but the permissions for the instance have changed since the token was issued and so on the server-side the presented token is considered invalid.
-
-
Constructor Summary
Constructors Constructor Description RefreshAuthTokenWrappingAsyncHandler(RefreshableOnNotAuthenticatedProvider<?> authDetailsProvider, AsyncHandler<REQUEST,RESPONSE> innerHandler)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
onError(REQUEST request, Throwable error)
Deprecated.Called if the request could not be completed successfully.void
onSuccess(REQUEST request, RESPONSE response)
Deprecated.Called if the request was successfully completed.abstract void
retryCall()
Deprecated.If we need to retry the request (i.e.
-
-
-
Constructor Detail
-
RefreshAuthTokenWrappingAsyncHandler
public RefreshAuthTokenWrappingAsyncHandler(RefreshableOnNotAuthenticatedProvider<?> authDetailsProvider, AsyncHandler<REQUEST,RESPONSE> innerHandler)
Deprecated.
-
-
Method Detail
-
onSuccess
public void onSuccess(REQUEST request, RESPONSE response)
Deprecated.Description copied from interface:AsyncHandler
Called if the request was successfully completed.- Specified by:
onSuccess
in interfaceAsyncHandler<REQUEST,RESPONSE>
- Parameters:
request
- The request that was made.response
- The response that was received.
-
onError
public void onError(REQUEST request, Throwable error)
Deprecated.Description copied from interface:AsyncHandler
Called if the request could not be completed successfully.- Specified by:
onError
in interfaceAsyncHandler<REQUEST,RESPONSE>
- Parameters:
request
- The request that was made.error
- The error that was received.
-
retryCall
public abstract void retryCall()
Deprecated.If we need to retry the request (i.e.on a 401), this method contains the information on how to do that. This method will be leveraged by the onError callback of this handler.
-
-