Package com.jk.services.client
Class JKClientRequestFilter
java.lang.Object
com.jk.services.client.JKClientRequestFilter
- All Implemented Interfaces:
jakarta.ws.rs.client.ClientRequestFilter
public class JKClientRequestFilter
extends Object
implements jakarta.ws.rs.client.ClientRequestFilter
This class implements the
ClientRequestFilter interface.
This class filters and modifies the HTTP requests.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(jakarta.ws.rs.client.ClientRequestContext requestContext) This method filters and modifies the HTTP request.protected StringThis method retrieves the current tenant ID.protected StringThis method retrieves the current authentication token.protected voidsyncContextHeader(jakarta.ws.rs.core.MultivaluedMap<String, Object> headers) This method synchronizes context information and adds it to the request headers.
-
Constructor Details
-
JKClientRequestFilter
public JKClientRequestFilter()
-
-
Method Details
-
filter
This method filters and modifies the HTTP request.- Specified by:
filterin interfacejakarta.ws.rs.client.ClientRequestFilter- Parameters:
requestContext- Represents the context of the HTTP request.- Throws:
IOException- if an I/O exception has occurred.
-
getTokenAuthentication
This method retrieves the current authentication token.- Returns:
- the current authentication token.
-
getTenantId
This method retrieves the current tenant ID.- Returns:
- the current tenant ID.
-
syncContextHeader
This method synchronizes context information and adds it to the request headers.- Parameters:
headers- Specifies the headers of the HTTP request.
-