Class Auth.TokenDetails

  • Enclosing class:
    Auth

    public static class Auth.TokenDetails
    extends java.lang.Object
    A 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.String capability
      The capability associated with this token.
      java.lang.String clientId
      The clientId, if any, bound to this token.
      long expires
      The time (in millis since the epoch) at which this token expires.
      long issued
      The time (in millis since the epoch) at which this token was issued.
      java.lang.String token
      The token itself
    • 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.
    • Constructor Detail

      • TokenDetails

        public TokenDetails()
      • TokenDetails

        public TokenDetails​(java.lang.String token)
    • 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:
        equals in class java.lang.Object
        Parameters:
        obj -