Interface User

All Known Implementing Classes:
HadoopUser, JdkUser

public interface User
Provides a platform independent way of accessing user information.
  • Method Details

    • doAs

      <T> T doAs(PrivilegedAction<T> action)
      Execute the given action as the user
      Type Parameters:
      T - The return type from the action
      Parameters:
      action - To execute
      Returns:
      Whatever was returned from the action
    • doAs

      <T> T doAs(PrivilegedExceptionAction<T> action) throws EsHadoopException
      Execute the given action as the user
      Type Parameters:
      T - The return type from the action
      Parameters:
      action - To execute
      Returns:
      Whatever was returned from the action
      Throws:
      EsHadoopException - Should an exception be thrown during the operation
    • getEsToken

      EsToken getEsToken(String clusterName)
      Parameters:
      clusterName - The cluster name
      Returns:
      a previously added Elasticsearch authentication token, or null if it does not exist
    • getAllEsTokens

      Iterable<EsToken> getAllEsTokens()
      Returns:
      all previously added Elasticsearch authentication tokens, or an empty iterable if none exist
    • addEsToken

      void addEsToken(EsToken esToken)
      Adds the given esToken to the user
      Parameters:
      esToken - Authentication token for Elasticsearch
    • getUserName

      String getUserName()
      Returns:
      the most appropriate and available user name for this user, or null if one cannot be found
    • getKerberosPrincipal

      KerberosPrincipal getKerberosPrincipal()
      Returns:
      the KerberosPrincipal attached to the user, or null if it does not exist
    • isProxyUser

      boolean isProxyUser()
      Returns:
      true if the current user is a proxy user with a real user underneath it
    • getRealUserProvider

      UserProvider getRealUserProvider()
      Returns:
      Returns a user provider that will select the real user from any currently logged in user.