Package pl.gsmservice.gateway.utils
Class Hook.IdempotencyHook
- java.lang.Object
-
- pl.gsmservice.gateway.utils.Hook.IdempotencyHook
-
- All Implemented Interfaces:
Hook.BeforeRequest
- Enclosing class:
- Hook
public static final class Hook.IdempotencyHook extends java.lang.Object implements Hook.BeforeRequest
-
-
Field Summary
-
Fields inherited from interface pl.gsmservice.gateway.utils.Hook.BeforeRequest
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description IdempotencyHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.http.HttpRequestbeforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request)Transforms the givenHttpRequestbefore sending.
-
-
-
Method Detail
-
beforeRequest
public java.net.http.HttpRequest beforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request) throws java.lang.Exception
Description copied from interface:Hook.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 interfaceHook.BeforeRequest- Parameters:
context- context for the hook callrequest- request to be transformed- Returns:
- transformed request
- Throws:
java.lang.Exception- on error
-
-