Interface User
- All Known Implementing Classes:
HadoopUser,JdkUser
public interface User
Provides a platform independent way of accessing user information.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEsToken(EsToken esToken) Adds the given esToken to the user<T> TdoAs(PrivilegedAction<T> action) Execute the given action as the user<T> TdoAs(PrivilegedExceptionAction<T> action) Execute the given action as the usergetEsToken(String clusterName) boolean
-
Method Details
-
doAs
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
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
- Parameters:
clusterName- The cluster name- Returns:
- a previously added Elasticsearch authentication token, or null if it does not exist
-
getAllEsTokens
- Returns:
- all previously added Elasticsearch authentication tokens, or an empty iterable if none exist
-
addEsToken
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.
-