Class RefreshAndRetryInterceptor
- java.lang.Object
-
- com.cheetahdigital.corekit.rest.interceptors.RefreshAndRetryInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
public class RefreshAndRetryInterceptor extends java.lang.Object implements okhttp3.Interceptor
Interceptor for automatic Access Token Refresh viaSdk
. A request passes through the following pipeline during Expired Token scenarios:- Stops the thread of the current request, and all the succeeding requests
- Refresh the token via the current request thread
- After refreshing the token, notify all the stopped threads to continue
- Rewrite the original request object w/ the newly refreshed token
Checks for error code 4002: Expired token
-
-
Constructor Summary
Constructors Constructor Description RefreshAndRetryInterceptor(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Response
intercept(okhttp3.Interceptor.Chain chain)
-