Interface ExceptionFactory

All Known Subinterfaces:
AuthenticatorExceptionFactory

public interface ExceptionFactory
  • Method Details

    • forbiddenException

      RuntimeException forbiddenException(ErrorCode errorCode)
    • forbiddenException

      RuntimeException forbiddenException(ErrorCode errorCode, String errorDetailMessage)
    • unauthorizedException

      RuntimeException unauthorizedException(ErrorCode errorCode)
    • unauthorizedException

      RuntimeException unauthorizedException(ErrorCode errorCode, String errorDetailMessage)
    • unauthorizedException

      RuntimeException unauthorizedException(ErrorCode errorCode, String errorDetailMessage, String realm)
    • unauthorizedException

      RuntimeException unauthorizedException(ErrorCode errorCode, String errorDetailMessage, String realm, String authScheme)
    • badRequestException

      RuntimeException badRequestException(ErrorCode errorCode)
    • badRequestException

      RuntimeException badRequestException(ErrorCode errorCode, String errorDetailMessage)
    • internalServerException

      RuntimeException internalServerException(ErrorCode errorCode)
    • internalServerException

      RuntimeException internalServerException(ErrorCode errorCode, String errorDetailMessage)
    • configurationException

      RuntimeException configurationException(String errorDetailMessage)
    • redirectException

      RuntimeException redirectException(String redirectUri)
      Redirects a request to another location.
      Parameters:
      redirectUri - the URI to redirect to
      Returns:
      an Exception that can be thrown to redirect the caller to the given URI
      See Also:
      "Implementation Requirements:"
      The redirect status code that implementations of this interface must use is a 302, moved temporarily.
    • redirectException

      RuntimeException redirectException(String redirectUri, RedirectStatusCode redirectStatusCode)
      Creates a Redirect Exception that can be used to redirect the caller to a different location using the given RedirectStatusCode.
      Parameters:
      redirectUri - the URI to redirect to
      redirectStatusCode - the status code to use when redirecting the client
      Returns:
      an Exception that can be thrown to redirect the caller to the given URI
    • redirectException

      RuntimeException redirectException(String redirectUri, RedirectStatusCode redirectStatusCode, Map<String,Collection<String>> parameters, boolean addParametersToFragment)
      Creates a Redirect Exception with the given parameters on the query string or fragment that can be used to redirect the caller to a different location.
      Parameters:
      redirectUri - the URI to redirect to
      redirectStatusCode - the status code to use when redirecting the client
      parameters - any parameters that should be added to the query string or fragment
      addParametersToFragment - true if the parameters should be added to the fragment; false if they should be added to the query string
      Returns:
      an Exception that can be thrown to redirect the caller to the given URI
    • redirectException

      RuntimeException redirectException(URI redirectUri, RedirectStatusCode redirectStatusCode, Map<String,Collection<String>> parameters, boolean addParametersToFragment)
      Creates a RedirectException with the given parameters on the query string or fragment that can be used to redirect the caller to a different location.
      Parameters:
      redirectUri - the URI to redirect to
      redirectStatusCode - the status code to use when redirecting the client
      parameters - any parameters that should be added to the query string or fragment
      addParametersToFragment - true if the parameters should be added to the fragment; false if they should be added to the query string
      Returns:
      an Exception that can be thrown to redirect the caller to the given URI
    • notFoundException

      RuntimeException notFoundException()
    • notFoundException

      RuntimeException notFoundException(ErrorCode errorCode, String errorDetailMessage)
    • methodNotAllowed

      RuntimeException methodNotAllowed()
    • methodNotAllowed

      RuntimeException methodNotAllowed(String errorDetailMessage)
    • contentTypeNotAcceptable

      RuntimeException contentTypeNotAcceptable(Collection<String> acceptableContentTypes)
    • serviceUnavailable

      RuntimeException serviceUnavailable()
    • requestValidationException

      RuntimeException requestValidationException(Set<ErrorMessage> errorMessages)
    • templateNotFoundException

      RuntimeException templateNotFoundException(String template)
    • externalServiceException

      RuntimeException externalServiceException(String message)
    • credentialManagerException

      RuntimeException credentialManagerException(String message)
      Create an Exception representing a failure on a CredentialManager.

      This error is normally thrown when a user's credentials are invalid or cannot be updated.

      Parameters:
      message - detailed error message
      Returns:
      Exception
      Since:
      4.0.0