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 Details

    • JKClientRequestFilter

      public JKClientRequestFilter()
  • Method Details

    • filter

      public void filter(jakarta.ws.rs.client.ClientRequestContext requestContext) throws IOException
      This method filters and modifies the HTTP request.
      Specified by:
      filter in interface jakarta.ws.rs.client.ClientRequestFilter
      Parameters:
      requestContext - Represents the context of the HTTP request.
      Throws:
      IOException - if an I/O exception has occurred.
    • getTokenAuthentication

      protected String getTokenAuthentication()
      This method retrieves the current authentication token.
      Returns:
      the current authentication token.
    • getTenantId

      protected String getTenantId()
      This method retrieves the current tenant ID.
      Returns:
      the current tenant ID.
    • syncContextHeader

      protected void syncContextHeader(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers)
      This method synchronizes context information and adds it to the request headers.
      Parameters:
      headers - Specifies the headers of the HTTP request.