|
@@ -30,12 +30,12 @@ import org.slf4j.LoggerFactory;
|
|
|
*/
|
|
|
public class RetryTestTokenProvider implements CustomTokenProviderAdaptee {
|
|
|
|
|
|
- private static final Logger LOG = LoggerFactory.getLogger(
|
|
|
- RetryTestTokenProvider.class);
|
|
|
-
|
|
|
// Need to track first token fetch otherwise will get counted as a retry too.
|
|
|
- private boolean isThisFirstTokenFetch = true;
|
|
|
- private int retryCount = 0;
|
|
|
+ private static boolean isThisFirstTokenFetch = true;
|
|
|
+ public static int reTryCount = 0;
|
|
|
+
|
|
|
+ private static final Logger LOG = LoggerFactory
|
|
|
+ .getLogger(RetryTestTokenProvider.class);
|
|
|
|
|
|
@Override
|
|
|
public void initialize(Configuration configuration, String accountName)
|
|
@@ -43,13 +43,9 @@ public class RetryTestTokenProvider implements CustomTokenProviderAdaptee {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Clear earlier retry details and reset RetryTestTokenProvider instance to
|
|
|
- * state of first access token fetch call.
|
|
|
- */
|
|
|
- public void resetStatusToFirstTokenFetch() {
|
|
|
+ public static void ResetStatusToFirstTokenFetch() {
|
|
|
isThisFirstTokenFetch = true;
|
|
|
- retryCount = 0;
|
|
|
+ reTryCount = 0;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -57,7 +53,7 @@ public class RetryTestTokenProvider implements CustomTokenProviderAdaptee {
|
|
|
if (isThisFirstTokenFetch) {
|
|
|
isThisFirstTokenFetch = false;
|
|
|
} else {
|
|
|
- retryCount++;
|
|
|
+ reTryCount++;
|
|
|
}
|
|
|
|
|
|
LOG.debug("RetryTestTokenProvider: Throw an exception in fetching tokens");
|
|
@@ -68,13 +64,4 @@ public class RetryTestTokenProvider implements CustomTokenProviderAdaptee {
|
|
|
public Date getExpiryTime() {
|
|
|
return new Date();
|
|
|
}
|
|
|
-
|
|
|
- public static RetryTestTokenProvider getCurrentRetryTestProviderInstance(
|
|
|
- AccessTokenProvider customTokenProvider) {
|
|
|
- return (RetryTestTokenProvider) ((CustomTokenProviderAdapter) customTokenProvider).getCustomTokenProviderAdaptee();
|
|
|
- }
|
|
|
-
|
|
|
- public int getRetryCount() {
|
|
|
- return retryCount;
|
|
|
- }
|
|
|
}
|