Class SelfTokenRestInterceptor

  • All Implemented Interfaces:
    org.springframework.http.client.ClientHttpRequestInterceptor

    public class SelfTokenRestInterceptor
    extends Object
    implements org.springframework.http.client.ClientHttpRequestInterceptor
    This class intercepts and renew client token.
    Author:
    Urvil Joshi
    • Constructor Detail

      • SelfTokenRestInterceptor

        public SelfTokenRestInterceptor​(org.springframework.core.env.Environment environment,
                                        org.springframework.web.client.RestTemplate restTemplate,
                                        TokenHolder<String> cachedToken,
                                        TokenHelper tokenHelper,
                                        TokenValidationHelper tokenValidationHelper,
                                        String applName)
    • Method Detail

      • intercept

        public org.springframework.http.client.ClientHttpResponse intercept​(org.springframework.http.HttpRequest request,
                                                                            byte[] body,
                                                                            org.springframework.http.client.ClientHttpRequestExecution execution)
                                                                     throws IOException
        Specified by:
        intercept in interface org.springframework.http.client.ClientHttpRequestInterceptor
        Throws:
        IOException