Class D4ScienceIAMClientException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.gcube.common.iam.D4ScienceIAMClientException
All Implemented Interfaces:
Serializable

public class D4ScienceIAMClientException extends Exception
Exception thrown by D4Science IAM client operations.
Author:
Mauro Mugnaini (Nubisware S.r.l.)
See Also:
  • Constructor Details

    • D4ScienceIAMClientException

      public D4ScienceIAMClientException(String message)
      Creates a new exception with the specified message.
      Parameters:
      message - the exception message
    • D4ScienceIAMClientException

      public D4ScienceIAMClientException(Throwable cause)
      Creates a new exception with the specified cause.
      Parameters:
      cause - the underlying cause
    • D4ScienceIAMClientException

      public D4ScienceIAMClientException(String message, Throwable cause)
      Creates a new exception with the specified message and cause.
      Parameters:
      message - the exception message
      cause - the underlying cause
  • Method Details

    • getStatus

      public int getStatus()
      Returns the HTTP status code if the cause is a KeycloakClientException.
      Returns:
      the HTTP status code, or -1 if not available
    • getContentType

      public String getContentType()
      Returns the content type if the cause is a KeycloakClientException.
      Returns:
      the content type, or null if not available
    • hasJSONPayload

      public boolean hasJSONPayload()
      Checks if the response has a JSON payload.
      Returns:
      true if the response has a JSON payload, false otherwise
    • getError

      public String getError()
      Returns the OAuth error of the IAM answer (e.g. access_denied, invalid_scope, invalid_grant), if the answer is a JSON error object.
      Returns:
      the error code, or null if not available
    • getErrorDescription

      public String getErrorDescription()
      Returns the OAuth error_description of the IAM answer, if the answer is a JSON error object.
      Returns:
      the description, or null if not available
    • getResponseString

      public String getResponseString()
      Returns the response string if the cause is a KeycloakClientException.
      Returns:
      the response string, or null if not available