public class TokenRefreshInterceptor extends Object implements Interceptor
| Constructor and Description |
|---|
TokenRefreshInterceptor(Config config,
HttpClient.Factory factory,
Instant latestRefreshTimestamp) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
afterFailure(BasicBuilder headerBuilder,
HttpResponse<?> response)
Called after a websocket failure or by default from a normal request
|
void |
before(BasicBuilder headerBuilder,
HttpHeaders headers)
Called before a request to allow for the manipulation of the request
|
Interceptor |
withConfig(Config config)
Interceptors that rely upon the Config, in particular the RequestConfig, must implement
this method to receive the modified configuration |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterFailure, useConfigpublic static final String NAME
public TokenRefreshInterceptor(Config config, HttpClient.Factory factory, Instant latestRefreshTimestamp)
public Interceptor withConfig(Config config)
InterceptorInterceptors that rely upon the Config, in particular the RequestConfig, must implement
this method to receive the modified configurationwithConfig in interface Interceptorpublic void before(BasicBuilder headerBuilder, HttpHeaders headers)
Interceptorbefore in interface InterceptorheaderBuilder - used to modify the requestheaders - the current headerspublic CompletableFuture<Boolean> afterFailure(BasicBuilder headerBuilder, HttpResponse<?> response)
InterceptorafterFailure in interface InterceptorheaderBuilder - used to modify the requestresponse - the failed responseCopyright © 2015–2022 Red Hat. All rights reserved.