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

public class User extends Object implements org.elasticsearch.xcontent.ToXContentObject
An authenticated user
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent

    org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
  • Field Summary

    Fields inherited from interface org.elasticsearch.xcontent.ToXContent

    EMPTY, EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    User(String username, String... roles)
     
    User(String username, String[] roles, String fullName, String email, Map<String,Object> metadata, boolean enabled)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    boolean
     
     
    int
     
    void
    innerToXContent(org.elasticsearch.xcontent.XContentBuilder builder)
     
     
     
     
     
    final org.elasticsearch.xcontent.XContentBuilder
    toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     
    static void
    writeUser(User user, StreamOutput output)
    Write the given User

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject

    isFragment
  • 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 org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • innerToXContent

      public void innerToXContent(org.elasticsearch.xcontent.XContentBuilder builder) throws IOException
      Throws:
      IOException
    • writeUser

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