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, java.util.Map<java.lang.String,java.lang.Object> metadata)
-
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.util.Map<java.lang.String,java.lang.Object>
getMetadata()
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, java.util.Map<java.lang.String,java.lang.Object> metadata)
-
-
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 returnnull
-
isInvalidated
public boolean isInvalidated()- Returns:
true
if 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.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.Object> getMetadata() -
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in 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:
toString
in classjava.lang.Object
-