Class ApiKey
java.lang.Object
org.elasticsearch.client.security.support.ApiKey
API key information
-
Constructor Summary
ConstructorDescriptionApiKey
(String name, String id, Instant creation, Instant expiration, boolean invalidated, String username, String realm, Map<String, Object> metadata) ApiKey
(String name, String id, Instant creation, Instant expiration, boolean invalidated, String username, String realm, Map<String, Object> metadata, Object[] sortValues) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static ApiKey
fromXContent
(org.elasticsearch.xcontent.XContentParser parser) getId()
getName()
getRealm()
Object[]
API keys can be retrieved with eitherGetApiKeyRequest
orQueryApiKeyRequest
.int
hashCode()
boolean
toString()
-
Constructor Details
-
ApiKey
-
ApiKey
-
-
Method Details
-
getId
-
getName
-
getCreation
- Returns:
- a instance of
Instant
when this API key was created.
-
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
- Returns:
- the username for which this API key was created.
-
getRealm
- Returns:
- the realm name of the user for which this API key was created.
-
getMetadata
-
getSortValues
API keys can be retrieved with eitherGetApiKeyRequest
orQueryApiKeyRequest
. 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() -
equals
-
fromXContent
public static ApiKey fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
toString
-