Class ExecutableResponse


  • class ExecutableResponse
    extends java.lang.Object
    Encapsulates response values for the 3rd party executable response (e.g. OIDC, SAML, error responses).
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutableResponse​(com.google.api.client.json.GenericJson json)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String getErrorCode()
      Returns the error code if the execution was unsuccessful, null otherwise.
      (package private) java.lang.String getErrorMessage()
      Returns the error message if the execution was unsuccessful, null otherwise.
      (package private) java.lang.Long getExpirationTime()
      Returns the subject token expiration time in seconds (Unix epoch time).
      (package private) java.lang.String getSubjectToken()
      Returns the subject token if the execution was successful, null otherwise.
      (package private) java.lang.String getTokenType()
      Returns the 3rd party subject token type.
      (package private) int getVersion()
      Returns the version of the executable output.
      (package private) boolean isExpired()
      Returns true if the subject token is expired, false otherwise.
      (package private) boolean isSuccessful()
      Returns the status of the response.
      (package private) boolean isValid()
      Returns whether the execution was successful and returned an unexpired token.
      private static int parseIntField​(java.lang.Object field)  
      private static long parseLongField​(java.lang.Object field)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SAML_SUBJECT_TOKEN_TYPE

        private static final java.lang.String SAML_SUBJECT_TOKEN_TYPE
        See Also:
        Constant Field Values
      • version

        private final int version
      • success

        private final boolean success
      • expirationTime

        @Nullable
        private java.lang.Long expirationTime
      • tokenType

        @Nullable
        private java.lang.String tokenType
      • subjectToken

        @Nullable
        private java.lang.String subjectToken
      • errorCode

        @Nullable
        private java.lang.String errorCode
      • errorMessage

        @Nullable
        private java.lang.String errorMessage
    • Constructor Detail

      • ExecutableResponse

        ExecutableResponse​(com.google.api.client.json.GenericJson json)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getVersion

        int getVersion()
        Returns the version of the executable output. Only version `1` is currently supported. This is useful for future changes to the expected output format.
        Returns:
        The version of the JSON output.
      • isSuccessful

        boolean isSuccessful()
        Returns the status of the response.

        When this is true, the response will contain the 3rd party token for a sign in / refresh operation. When this is false, the response should contain an additional error code and message.

        Returns:
        Whether the `success` field in the executable response is true.
      • isExpired

        boolean isExpired()
        Returns true if the subject token is expired, false otherwise.
      • isValid

        boolean isValid()
        Returns whether the execution was successful and returned an unexpired token.
      • getExpirationTime

        @Nullable
        java.lang.Long getExpirationTime()
        Returns the subject token expiration time in seconds (Unix epoch time).
      • getTokenType

        @Nullable
        java.lang.String getTokenType()
        Returns the 3rd party subject token type.

        Possible valid values:

        • urn:ietf:params:oauth:token-type:id_token
        • urn:ietf:params:oauth:token-type:jwt
        • urn:ietf:params:oauth:token-type:saml2
        Returns:
        The 3rd party subject token type for success responses, null otherwise.
      • getSubjectToken

        @Nullable
        java.lang.String getSubjectToken()
        Returns the subject token if the execution was successful, null otherwise.
      • getErrorCode

        @Nullable
        java.lang.String getErrorCode()
        Returns the error code if the execution was unsuccessful, null otherwise.
      • getErrorMessage

        @Nullable
        java.lang.String getErrorMessage()
        Returns the error message if the execution was unsuccessful, null otherwise.
      • parseIntField

        private static int parseIntField​(java.lang.Object field)
      • parseLongField

        private static long parseLongField​(java.lang.Object field)