Class D4ScienceIAMClientException

  • All Implemented Interfaces:
    Serializable

    public class D4ScienceIAMClientException
    extends Exception
    Exception thrown by D4Science IAM client operations.
    Author:
    Luca Frosini (ISTI-CNR)
    See Also:
    Serialized Form
    • Constructor Detail

      • 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 Detail

      • 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
      • getResponseString

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