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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPersistentTokenTable(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} tokens table.invalid @link
{@link thisbooleanAssociates provided token with provided plugin in token table.booleanRemoves value for specified token from tokens table.voidsetAccessToken(String token) Sets the access token.voidsetExpiresIn(String expiresIn) voidsetRefreshToken(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:TokensKey of} tokens table.invalid @link
{@link this -
get
Description copied from interface:TokensReturns value from tokens table that corresponds to provided plugin. -
put
Description copied from interface:TokensAssociates provided token with provided plugin in token table.- Specified by:
putin 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:
trueif provided token was associated with the provided value in tokens table
-
getAccessToken
Description copied from interface:TokensGets the current access token.- Specified by:
getAccessTokenin interfaceTokens- Returns:
- The current access token
-
getRefreshToken
- Specified by:
getRefreshTokenin interfaceTokens
-
getExpiresIn
- Specified by:
getExpiresInin interfaceTokens
-
setExpiresIn
- Specified by:
setExpiresInin interfaceTokens
-
setAccessToken
Description copied from interface:TokensSets the access token.- Specified by:
setAccessTokenin interfaceTokens- Parameters:
token- Sets the access token.
-
setRefreshToken
- Specified by:
setRefreshTokenin interfaceTokens
-
remove
Description copied from interface:TokensRemoves value for specified token from tokens table. -
getTokens
-