AccessTokenProvider (Apache Hadoop HDFS Client 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.web.oauth2, class: AccessTokenProvider

Package org.apache.hadoop.hdfs.web.oauth2

# Class AccessTokenProvider

java.lang.Object
org.apache.hadoop.hdfs.web.oauth2.AccessTokenProvider

All Implemented Interfaces:
  `org.apache.hadoop.conf.Configurable`

Direct Known Subclasses:
  `ConfRefreshTokenBasedAccessTokenProvider`, `CredentialBasedAccessTokenProvider`

@Public @Evolving public abstract class AccessTokenProvider extends Object implements org.apache.hadoop.conf.Configurable
Provide an OAuth2 access token to be used to authenticate http calls in WebHDFS.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AccessTokenProvider()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract String`
  `getAccessToken()`
  Obtain the access token that should be added to http connection's header.
  `org.apache.hadoop.conf.Configuration`
  `getConf()`
  Return the conf.
  `void`
  `setConf(org.apache.hadoop.conf.Configuration configuration)`
  Set the conf.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AccessTokenProvider

    public AccessTokenProvider()

- ## Method Details

  - ### getAccessToken

    public abstract String getAccessToken() throws IOException
    Obtain the access token that should be added to http connection's header. Will be called for each connection, so implementations should be performant. Implementations are responsible for any refreshing of the token.
    Returns:
      Access token to be added to connection header.
    Throws:
      `IOException`

  - ### getConf

    public org.apache.hadoop.conf.Configuration getConf()
    Return the conf.
    Specified by:
      `getConf` in interface `org.apache.hadoop.conf.Configurable`
    Returns:
      the conf.

  - ### setConf

    public void setConf(org.apache.hadoop.conf.Configuration configuration)
    Set the conf.
    Specified by:
      `setConf` in interface `org.apache.hadoop.conf.Configurable`
    Parameters:
      `configuration` - New configuration.