Class JdkUser

java.lang.Object
org.elasticsearch.hadoop.security.JdkUser
All Implemented Interfaces:
User

public class JdkUser extends Object implements User
  • Constructor Details

  • Method Details

    • doAs

      public <T> T doAs(PrivilegedAction<T> action)
      Description copied from interface: User
      Execute the given action as the user
      Specified by:
      doAs in interface User
      Type Parameters:
      T - The return type from the action
      Parameters:
      action - To execute
      Returns:
      Whatever was returned from the action
    • doAs

      public <T> T doAs(PrivilegedExceptionAction<T> action) throws EsHadoopException
      Description copied from interface: User
      Execute the given action as the user
      Specified by:
      doAs in interface 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

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

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

      public void addEsToken(EsToken esToken)
      Description copied from interface: User
      Adds the given esToken to the user
      Specified by:
      addEsToken in interface User
      Parameters:
      esToken - Authentication token for Elasticsearch
    • getUserName

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

      public KerberosPrincipal getKerberosPrincipal()
      Specified by:
      getKerberosPrincipal in interface User
      Returns:
      the KerberosPrincipal attached to the user, or null if it does not exist
    • isProxyUser

      public boolean isProxyUser()
      Specified by:
      isProxyUser in interface User
      Returns:
      true if the current user is a proxy user with a real user underneath it
    • getRealUserProvider

      public UserProvider getRealUserProvider()
      Specified by:
      getRealUserProvider in interface User
      Returns:
      Returns a user provider that will select the real user from any currently logged in user.
    • toString

      public String toString()
      Overrides:
      toString in class Object