Package org.apache.drill.exec.oauth
Class PersistentTokenTable
java.lang.Object
org.apache.drill.exec.oauth.PersistentTokenTable
- All Implemented Interfaces:
Tokens
Implementation of tokens table that updates its version in persistent store after modifications.
For OAuth tokens, the only possible tokens are the access_token, the refresh_token and authorization_code.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPersistentTokenTable
(Map<String, String> tokens, String key, PersistentTokenRegistry.StoreProvider storeProvider) -
Method Summary
Modifier and TypeMethodDescriptionReturns value from tokens table that corresponds to provided plugin.Gets the current access token.getKey()
Key of {@link this} tokens table.boolean
Associates provided token with provided plugin in token table.boolean
Removes value for specified token from tokens table.void
setAccessToken
(String token) Sets the access token.void
setExpiresIn
(String expiresIn) void
setRefreshToken
(String token)
-
Field Details
-
ACCESS_TOKEN_KEY
- See Also:
-
REFRESH_TOKEN_KEY
- See Also:
-
EXPIRES_IN_KEY
- See Also:
-
-
Constructor Details
-
PersistentTokenTable
public PersistentTokenTable(Map<String, String> tokens, String key, PersistentTokenRegistry.StoreProvider storeProvider)
-
-
Method Details
-
getKey
Description copied from interface:Tokens
Key of {@link this} tokens table. -
get
Description copied from interface:Tokens
Returns value from tokens table that corresponds to provided plugin. -
put
Description copied from interface:Tokens
Associates provided token with provided plugin in token table.- Specified by:
put
in interfaceTokens
- Parameters:
token
- Token of the value to associate withvalue
- Value that will be associated with provided aliasreplace
- Whether existing value for the same token should be replaced- Returns:
true
if provided token was associated with the provided value in tokens table
-
getAccessToken
Description copied from interface:Tokens
Gets the current access token.- Specified by:
getAccessToken
in interfaceTokens
- Returns:
- The current access token
-
getRefreshToken
- Specified by:
getRefreshToken
in interfaceTokens
-
getExpiresIn
- Specified by:
getExpiresIn
in interfaceTokens
-
setExpiresIn
- Specified by:
setExpiresIn
in interfaceTokens
-
setAccessToken
Description copied from interface:Tokens
Sets the access token.- Specified by:
setAccessToken
in interfaceTokens
- Parameters:
token
- Sets the access token.
-
setRefreshToken
- Specified by:
setRefreshToken
in interfaceTokens
-
remove
Description copied from interface:Tokens
Removes value for specified token from tokens table. -
getTokens
-