Class User
java.lang.Object
org.elasticsearch.client.security.user.User
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
-
Method Summary
-
Constructor Details
-
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
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 Details
-
getUsername
- Returns:
- The principal of this user - effectively serving as the
unique identity of the user. Can never be
null
.
-
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
- Returns:
- The metadata that is associated with this user. Can never be
null
.
-
getFullName
- Returns:
- The full name of this user. May be
null
.
-
getEmail
- Returns:
- The email of this user. May be
null
.
-
toString
-
equals
-
hashCode
public int hashCode()
-