Class ApiKey
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 booleanequals(java.lang.Object obj)static ApiKeyfromXContent(org.elasticsearch.common.xcontent.XContentParser parser)java.time.InstantgetCreation()java.time.InstantgetExpiration()java.lang.StringgetId()java.lang.StringgetName()java.lang.StringgetRealm()java.lang.StringgetUsername()inthashCode()booleanisInvalidated()java.lang.StringtoString()
-
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
Instantwhen this API key was created.
-
getExpiration
public java.time.Instant getExpiration()- Returns:
- a instance of
Instantwhen this API key will expire. In case the API key does not expire then will returnnull
-
isInvalidated
public boolean isInvalidated()- Returns:
trueif this API key has been invalidated else returnsfalse
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.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:
toStringin classjava.lang.Object
-