Package io.ably.lib.rest
Class Auth.TokenDetails
- java.lang.Object
-
- io.ably.lib.rest.Auth.TokenDetails
-
- Enclosing class:
- Auth
public static class Auth.TokenDetails extends java.lang.ObjectA class providing details of a token and its associated metadata, provided when the system successfully requests a token from the system.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringcapabilityThe capability associated with this token.java.lang.StringclientIdThe clientId, if any, bound to this token.longexpiresThe time (in millis since the epoch) at which this token expires.longissuedThe time (in millis since the epoch) at which this token was issued.java.lang.StringtokenThe token itself
-
Constructor Summary
Constructors Constructor Description TokenDetails()TokenDetails(java.lang.String token)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringasJson()Convert a TokenDetails into a JSON string.com.google.gson.JsonObjectasJsonElement()Convert a TokenDetails into a JSON object.booleanequals(java.lang.Object obj)Check equality of a TokenDetailsstatic Auth.TokenDetailsfromJson(java.lang.String json)Convert a JSON element response body to a TokenDetails.static Auth.TokenDetailsfromJSON(com.google.gson.JsonObject json)Deprecated.static Auth.TokenDetailsfromJsonElement(com.google.gson.JsonObject json)Convert a JSON element response body to a TokenDetails.
-
-
-
Field Detail
-
token
public java.lang.String token
The token itself
-
expires
public long expires
The time (in millis since the epoch) at which this token expires.
-
issued
public long issued
The time (in millis since the epoch) at which this token was issued.
-
capability
public java.lang.String capability
The capability associated with this token. See the Ably Authentication documentation for details.
-
clientId
public java.lang.String clientId
The clientId, if any, bound to this token. If a clientId is included, then the token authenticates its bearer as that clientId, and the token may only be used to perform operations on behalf of that clientId.
-
-
Method Detail
-
fromJSON
@Deprecated public static Auth.TokenDetails fromJSON(com.google.gson.JsonObject json)
Deprecated.Convert a JSON response body to a TokenDetails. Deprecated: use fromJson() instead- Parameters:
json-- Returns:
-
fromJson
public static Auth.TokenDetails fromJson(java.lang.String json)
Convert a JSON element response body to a TokenDetails. Spec: TD7- Parameters:
json-- Returns:
-
fromJsonElement
public static Auth.TokenDetails fromJsonElement(com.google.gson.JsonObject json)
Convert a JSON element response body to a TokenDetails.- Parameters:
json-- Returns:
-
asJsonElement
public com.google.gson.JsonObject asJsonElement()
Convert a TokenDetails into a JSON object.
-
asJson
public java.lang.String asJson()
Convert a TokenDetails into a JSON string.
-
equals
public boolean equals(java.lang.Object obj)
Check equality of a TokenDetails- Overrides:
equalsin classjava.lang.Object- Parameters:
obj-
-
-