public class DefaultRefreshTokenManager extends Object implements MuleContextAware, RefreshTokenManager
RefreshTokenManager that guarantees that no refresh
token is used more than once. If two threads try to refresh the same token
concurrently, only one will succeed and the other one will rely on the result of
the first oneDEFAULT_MIN_REFRESH_INTERVAL| Constructor and Description |
|---|
DefaultRefreshTokenManager() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.collections.Factory |
internalObjectStoreFactory() |
void |
refreshToken(OAuth2Adapter adapter,
String accessTokenId)
Refreshes the token of the given id for the given adapter.
|
void |
setMinRefreshIntervalInMillis(int minRefreshIntervalInMillis)
Sets the minimum interval of time in which we allow a given access token id to be refresh.
|
void |
setMuleContext(MuleContext context) |
void |
setRefreshedTokensStore(ObjectStore<Boolean> refreshedTokens)
Sets the
ObjectStore to use for the tokens refresh state. |
public void refreshToken(OAuth2Adapter adapter, String accessTokenId) throws Exception
refreshToken in interface RefreshTokenManagerExceptionRefreshTokenManager.refreshToken(org.mule.security.oauth.OAuth2Adapter,
java.lang.String)protected org.apache.commons.collections.Factory internalObjectStoreFactory()
public void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwarepublic void setMinRefreshIntervalInMillis(int minRefreshIntervalInMillis)
RefreshTokenManagersetMinRefreshIntervalInMillis in interface RefreshTokenManagerminRefreshIntervalInMillis - a number of millisecondspublic void setRefreshedTokensStore(ObjectStore<Boolean> refreshedTokens) throws IllegalStateException
RefreshTokenManagerObjectStore to use for the tokens refresh state.
This can only be set during initialization. If this is set, the value given to
RefreshTokenManager.setMinRefreshIntervalInMillis(int) will be ignored.setRefreshedTokensStore in interface RefreshTokenManagerIllegalStateException - if called after initialization.Copyright © 2003–2018 MuleSoft, Inc.. All rights reserved.