public class TokenRefreshInterceptor extends Object implements Interceptor
Interceptor.RequestTags| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHORIZATION |
protected Config |
config |
static String |
NAME |
| Constructor and Description |
|---|
TokenRefreshInterceptor(Config config,
HttpClient.Factory factory,
Instant latestRefreshTimestamp) |
TokenRefreshInterceptor(Config config,
Instant latestRefreshTimestamp,
Function<Config,CompletableFuture<String>> remoteRefresh) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
afterFailure(BasicBuilder headerBuilder,
HttpResponse<?> response,
Interceptor.RequestTags tags)
Called after a websocket failure or by default from a normal request
|
void |
before(BasicBuilder headerBuilder,
HttpRequest request,
Interceptor.RequestTags tags)
Called before a request to allow for the manipulation of the request
|
protected boolean |
isBasicAuth() |
protected boolean |
shouldFail(HttpResponse<?> response) |
protected boolean |
useBasicAuth() |
protected boolean |
useRemoteRefresh(Config newestConfig) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafter, afterFailure, consumerpublic static final String AUTHORIZATION
public static final String NAME
protected final Config config
public TokenRefreshInterceptor(Config config, HttpClient.Factory factory, Instant latestRefreshTimestamp)
public void before(BasicBuilder headerBuilder, HttpRequest request, Interceptor.RequestTags tags)
Interceptorbefore in interface InterceptorheaderBuilder - used to modify the requestrequest - the current requestprotected boolean useBasicAuth()
protected final boolean isBasicAuth()
public CompletableFuture<Boolean> afterFailure(BasicBuilder headerBuilder, HttpResponse<?> response, Interceptor.RequestTags tags)
InterceptorafterFailure in interface InterceptorheaderBuilder - used to modify the requestresponse - the failed responseprotected boolean shouldFail(HttpResponse<?> response)
protected boolean useRemoteRefresh(Config newestConfig)
Copyright © 2015–2024 Red Hat. All rights reserved.