Class KeyProviderDelegationTokenExtension

All Implemented Interfaces:
Closeable, AutoCloseable, DelegationTokenIssuer

public class KeyProviderDelegationTokenExtension extends KeyProviderExtension<KeyProviderDelegationTokenExtension.DelegationTokenExtension> implements DelegationTokenIssuer
A KeyProvider extension with the ability to add a renewer's Delegation Tokens to the provided Credentials.
  • Method Details

    • getCanonicalServiceName

      public String getCanonicalServiceName()
      Description copied from interface: DelegationTokenIssuer
      The service name used as the alias for the token in the credential token map. addDelegationTokens will use this to determine if a token exists, and if not, add a new token with this alias.
      Specified by:
      getCanonicalServiceName in interface DelegationTokenIssuer
      Returns:
      the token.
    • getDelegationToken

      public Token<?> getDelegationToken(String renewer) throws IOException
      Description copied from interface: DelegationTokenIssuer
      Unconditionally get a new token with the optional renewer. Returning null indicates the service does not issue tokens.
      Specified by:
      getDelegationToken in interface DelegationTokenIssuer
      Parameters:
      renewer - renewer.
      Returns:
      the token.
      Throws:
      IOException - raised on errors performing I/O.
    • createKeyProviderDelegationTokenExtension

      public static KeyProviderDelegationTokenExtension createKeyProviderDelegationTokenExtension(KeyProvider keyProvider)
      Creates a KeyProviderDelegationTokenExtension using a given KeyProvider.

      If the given KeyProvider implements the KeyProviderDelegationTokenExtension.DelegationTokenExtension interface the KeyProvider itself will provide the extension functionality, otherwise a default extension implementation will be used.

      Parameters:
      keyProvider - KeyProvider to use to create the KeyProviderDelegationTokenExtension extension.
      Returns:
      a KeyProviderDelegationTokenExtension instance using the given KeyProvider.