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

public final class ApiKey extends Object
API key information
  • Constructor Details

  • Method Details

    • getId

      public String getId()
    • getName

      public String getName()
    • getCreation

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

      public 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 String getUsername()
      Returns:
      the username for which this API key was created.
    • getRealm

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

      public Map<String,Object> getMetadata()
    • getSortValues

      public Object[] getSortValues()
      API keys can be retrieved with either GetApiKeyRequest or QueryApiKeyRequest. When sorting is specified for QueryApiKeyRequest, the sort values for each key is returned along with each API key.
      Returns:
      Sort values for this API key if it is retrieved with QueryApiKeyRequest and sorting is required. Otherwise, it is null.
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • fromXContent

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

      public String toString()
      Overrides:
      toString in class Object