Package pl.gsmservice.gateway.utils
Class AsyncHook.IdempotencyHook
- java.lang.Object
-
- pl.gsmservice.gateway.utils.AsyncHook.IdempotencyHook
-
- All Implemented Interfaces:
AsyncHook.BeforeRequest
- Enclosing class:
- AsyncHook
public static final class AsyncHook.IdempotencyHook extends java.lang.Object implements AsyncHook.BeforeRequest
-
-
Field Summary
-
Fields inherited from interface pl.gsmservice.gateway.utils.AsyncHook.BeforeRequest
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description IdempotencyHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.net.http.HttpRequest>beforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request)Transforms the givenHttpRequestbefore sending.
-
-
-
Method Detail
-
beforeRequest
public java.util.concurrent.CompletableFuture<java.net.http.HttpRequest> beforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request)
Description copied from interface:AsyncHook.BeforeRequestTransforms the givenHttpRequestbefore sending.Note that
HttpRequestis immutable. To modify the request you can useHttpRequest#newBuilder(HttpRequest, BiPredicate<String, String>)with JDK 16 and later (which will copy the request for modification in a builder). If that method is not available then useHelpers.copy(java.net.http.HttpRequest)(which also returns a builder).- Specified by:
beforeRequestin interfaceAsyncHook.BeforeRequest- Parameters:
context- context for the hook callrequest- request to be transformed- Returns:
- transformed request
-
-