Class LoggingInterceptor

java.lang.Object
uk.ac.gda.ui.tool.rest.LoggingInterceptor
All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor

public class LoggingInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
Intercepts http communication in order
  1. Logs the request body, if the logger is in debug mode.
  2. Submits the request to the endpoint.
  3. Logs the response body, If the logger is in debug mode.
  • Constructor Details

    • LoggingInterceptor

      public LoggingInterceptor()
  • Method Details

    • intercept

      public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest req, byte[] reqBody, org.springframework.http.client.ClientHttpRequestExecution ex) throws IOException
      Specified by:
      intercept in interface org.springframework.http.client.ClientHttpRequestInterceptor
      Throws:
      IOException