java.lang.Object
org.elasticsearch.client.security.support.ApiKey

public final class ApiKey
extends java.lang.Object
API key information
  • Constructor Summary

    Constructors
    Constructor Description
    ApiKey​(java.lang.String name, java.lang.String id, java.time.Instant creation, java.time.Instant expiration, boolean invalidated, java.lang.String username, java.lang.String realm)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)  
    static ApiKey fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)  
    java.time.Instant getCreation()  
    java.time.Instant getExpiration()  
    java.lang.String getId()  
    java.lang.String getName()  
    java.lang.String getRealm()  
    java.lang.String getUsername()  
    int hashCode()  
    boolean isInvalidated()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ApiKey

      public ApiKey​(java.lang.String name, java.lang.String id, java.time.Instant creation, java.time.Instant expiration, boolean invalidated, java.lang.String username, java.lang.String realm)
  • Method Details

    • getId

      public java.lang.String getId()
    • getName

      public java.lang.String getName()
    • getCreation

      public java.time.Instant getCreation()
      Returns:
      a instance of Instant when this API key was created.
    • getExpiration

      public java.time.Instant getExpiration()
      Returns:
      a instance of Instant when this API key will expire. In case the API key does not expire then will return null
    • isInvalidated

      public boolean isInvalidated()
      Returns:
      true if this API key has been invalidated else returns false
    • getUsername

      public java.lang.String getUsername()
      Returns:
      the username for which this API key was created.
    • getRealm

      public java.lang.String getRealm()
      Returns:
      the realm name of the user for which this API key was created.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • fromXContent

      public static ApiKey fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object