Class PersistentTokenTable

java.lang.Object
org.apache.drill.exec.oauth.PersistentTokenTable
All Implemented Interfaces:
Tokens

public class PersistentTokenTable extends Object implements 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 Details

  • Constructor Details

  • Method Details

    • getKey

      public String getKey()
      Description copied from interface: Tokens
      Key of {@link this} tokens table.
      Specified by:
      getKey in interface Tokens
    • get

      public String get(String token)
      Description copied from interface: Tokens
      Returns value from tokens table that corresponds to provided plugin.
      Specified by:
      get in interface Tokens
      Parameters:
      token - token of the value to obtain
      Returns:
      value from token table that corresponds to provided plugin
    • put

      public boolean put(String token, String value, boolean replace)
      Description copied from interface: Tokens
      Associates provided token with provided plugin in token table.
      Specified by:
      put in interface Tokens
      Parameters:
      token - Token of the value to associate with
      value - Value that will be associated with provided alias
      replace - 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

      public String getAccessToken()
      Description copied from interface: Tokens
      Gets the current access token.
      Specified by:
      getAccessToken in interface Tokens
      Returns:
      The current access token
    • getRefreshToken

      public String getRefreshToken()
      Specified by:
      getRefreshToken in interface Tokens
    • getExpiresIn

      public String getExpiresIn()
      Specified by:
      getExpiresIn in interface Tokens
    • setExpiresIn

      public void setExpiresIn(String expiresIn)
      Specified by:
      setExpiresIn in interface Tokens
    • setAccessToken

      public void setAccessToken(String token)
      Description copied from interface: Tokens
      Sets the access token.
      Specified by:
      setAccessToken in interface Tokens
      Parameters:
      token - Sets the access token.
    • setRefreshToken

      public void setRefreshToken(String token)
      Specified by:
      setRefreshToken in interface Tokens
    • remove

      public boolean remove(String token)
      Description copied from interface: Tokens
      Removes value for specified token from tokens table.
      Specified by:
      remove in interface Tokens
      Parameters:
      token - token of the value to remove
      Returns:
      true if the value associated with provided token was removed from the tokens table.
    • getTokens

      public Map<String,String> getTokens()