public final class AuthorizationTokenManager extends ApiBase
| Constructor and Description |
|---|
AuthorizationTokenManager(MangoPayApi root)
Instantiates new AuthorizationTokenManager object.
|
| Modifier and Type | Method and Description |
|---|---|
OAuthToken |
getToken()
Gets the current authorization token.
|
void |
registerCustomStorageStrategy(StorageStrategy customStorageStrategy)
Registers custom storage strategy implementation.
|
void |
storeToken(OAuthToken token)
Stores authorization token passed as an argument in the underlying storage strategy implementation.
|
createObject, createObject, createObject, getList, getList, getList, getList, getList, getList, getListNoClientId, getObject, getObjectNoClientId, getRequestType, getRequestUrl, getRoot, updateObject, updateObject, updateObject, updateObjectpublic AuthorizationTokenManager(MangoPayApi root)
root - Root/parent instance that holds the OAuthToken and Configuration instances.public OAuthToken getToken() throws java.lang.Exception
In the very first call, this method creates a new token before returning. If currently stored token is expired, this method creates a new one.
java.lang.Exceptionpublic void storeToken(OAuthToken token)
token - Token instance to be stored.public void registerCustomStorageStrategy(StorageStrategy customStorageStrategy)
By default, the DefaultStorageStrategy instance is used.
There is no need to explicitly call this method until some more complex
storage implementation is needed.
customStorageStrategy - StorageStrategy interface implementation.