Class User
- java.lang.Object
-
- org.elasticsearch.client.security.user.User
-
public final class User extends Object
A user to be utilized with security APIs. Can be an existing authenticated user or it can be a new user to be enrolled to the native realm.
-
-
Constructor Summary
Constructors Constructor Description User(String username, Collection<String> roles)Builds the user to be utilized with security APIs.User(String username, Collection<String> roles, Map<String,Object> metadata, String fullName, String email)Builds the user to be utilized with security APIs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetEmail()StringgetFullName()Map<String,Object>getMetadata()Set<String>getRoles()StringgetUsername()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
User
public User(String username, Collection<String> roles, Map<String,Object> metadata, @Nullable String fullName, @Nullable String email)
Builds the user to be utilized with security APIs.- Parameters:
username- the username, also known as the principal, unique for in the scope of a realmroles- the roles that this user is assignedmetadata- a map of additional user attributes that may be used in templating rolesfullName- the full name of the user that may be used for display purposesemail- the email address of the user
-
User
public User(String username, Collection<String> roles)
Builds the user to be utilized with security APIs.- Parameters:
username- the username, also known as the principal, unique for in the scope of a realmroles- the roles that this user is assigned
-
-
Method Detail
-
getUsername
public String getUsername()
- Returns:
- The principal of this user - effectively serving as the
unique identity of the user. Can never be
null.
-
getRoles
public Set<String> getRoles()
- Returns:
- The roles this user is associated with. The roles are
identified by their unique names and each represents as
set of permissions. Can never be
null.
-
getMetadata
public Map<String,Object> getMetadata()
- Returns:
- The metadata that is associated with this user. Can never be
null.
-
-