java.lang.Object
org.elasticsearch.xpack.core.security.user.User
All Implemented Interfaces:
ToXContent, ToXContentObject
Direct Known Subclasses:
InternalUser, ReservedUser

public class User extends Object implements ToXContentObject
An authenticated user
  • Constructor Details

  • Method Details

    • principal

      public String principal()
      Returns:
      The principal of this user - effectively serving as the unique identity of the user (within a given realm).
    • roles

      public String[] roles()
      Returns:
      The roles this user is associated with. The roles are identified by their unique names and each represents as set of permissions
    • metadata

      public Map<String,Object> metadata()
      Returns:
      The metadata that is associated with this user. Can never be null.
    • fullName

      public String fullName()
      Returns:
      The full name of this user. May be null.
    • email

      public String email()
      Returns:
      The email of this user. May be null.
    • enabled

      public boolean enabled()
      Returns:
      whether the user is enabled or not
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toXContent

      public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • innerToXContent

      public void innerToXContent(XContentBuilder builder) throws IOException
      Throws:
      IOException
    • writeUser

      public static void writeUser(User user, StreamOutput output) throws IOException
      Write the given User
      Throws:
      IOException