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 RefreshTokenManager
Exception
RefreshTokenManager.refreshToken(org.mule.security.oauth.OAuth2Adapter,
java.lang.String)
protected org.apache.commons.collections.Factory internalObjectStoreFactory()
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public void setMinRefreshIntervalInMillis(int minRefreshIntervalInMillis)
RefreshTokenManager
setMinRefreshIntervalInMillis
in interface RefreshTokenManager
minRefreshIntervalInMillis
- a number of millisecondspublic void setRefreshedTokensStore(ObjectStore<Boolean> refreshedTokens) throws IllegalStateException
RefreshTokenManager
ObjectStore
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 RefreshTokenManager
IllegalStateException
- if called after initialization.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.