Class HttpServiceExceptionFactory
java.lang.Object
oracle.wcc.ridc.adfca.http.internal.exception.HttpServiceExceptionFactory
Factory to create and log HttpService exceptions.
The HttpServiceExceptionFactory is a utility factory class for producing
the exceptions thrown in the oracle.wcc.ridc.adfca.http.internal package.
The class is thread safe. It uses a thread safe resource bundle and an
ADFLogger to log the exceptions, both of which are held as final field
and are constructed during the construction of the factory. The ADFLogger
is a thin thread safe wrapper over the java.util.Logger.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpServiceExceptionFactory(oracle.adf.share.logging.ADFLogger logger) Exception factory constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateBadRequest(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with BAD REQUEST HTTP status.createBadRequest(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with BAD REQUEST HTTP status.createBadRequest(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with BAD REQUEST HTTP status.createForbidden(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with FORBIDDEN HTTP status.createForbidden(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with FORBIDDEN HTTP status.createInternalServerError(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.createInternalServerError(String sourceClass, String sourceMethod, String message, Object[] messageParams) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.createInternalServerError(String sourceClass, String sourceMethod, String message, Object[] messageParams, Level logLevel) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.createInternalServerError(String sourceClass, String sourceMethod, String message, String messageParam) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.createInternalServerError(String sourceClass, String sourceMethod, Throwable t) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.createNotAcceptable(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with NOT_ACCEPTABLE HTTP status.createNotFound(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with NOT_FOUND HTTP status.createNotFound(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with NOT_FOUND HTTP status.createNotModified(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with NOT_MODIFIED HTTP status.createPreconditionFailed(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.createPreconditionFailed(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.createPreconditionFailed(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.createRedirection(String sourceClass, String sourceMethod, HttpStatus status, String redirectURL) Create and log a new HttpServiceException with a redirection (3xx) HTTP status.
-
Constructor Details
-
Method Details
-
createForbidden
public ForbiddenException createForbidden(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with FORBIDDEN HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParam- message parameter.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createForbidden
public ForbiddenException createForbidden(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with FORBIDDEN HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParams- message parameters.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createNotFound
public NotFoundException createNotFound(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with NOT_FOUND HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParam- message parameter.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createNotFound
public NotFoundException createNotFound(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with NOT_FOUND HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParams- message parameters.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createBadRequest
public BadRequestException createBadRequest(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with BAD REQUEST HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParam- message parameter.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createBadRequest
public BadRequestException createBadRequest(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with BAD REQUEST HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParams- message parameters.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createBadRequest
public BadRequestException createBadRequest(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with BAD REQUEST HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessageKey- Resource bundle key or message if no localization.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createPreconditionFailed
public PreconditionFailedException createPreconditionFailed(String sourceClass, String sourceMethod, String message, Object messageParam, Throwable cause) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParam- message parameter.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createPreconditionFailed
public PreconditionFailedException createPreconditionFailed(String sourceClass, String sourceMethod, String message, Object[] messageParams, Throwable cause) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- exception message,messageParams- message parameters.cause- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createPreconditionFailed
public PreconditionFailedException createPreconditionFailed(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with PRECONDITION_FAILED HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessageKey- Resource bundle key or message if no localization.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createNotAcceptable
public NotAcceptableException createNotAcceptable(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with NOT_ACCEPTABLE HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessageKey- Resource bundle key or message if no localization.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createNotModified
public NotModifiedException createNotModified(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with NOT_MODIFIED HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessageKey- Resource bundle key or message if no localization.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createRedirection
public RedirectionException createRedirection(String sourceClass, String sourceMethod, HttpStatus status, String redirectURL) Create and log a new HttpServiceException with a redirection (3xx) HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionstatus- The redirection statusredirectURL- The redirect URL- Returns:
- RedirectionException Constructed exception, ready to be thrown.
-
createInternalServerError
public InternalServerErrorException createInternalServerError(String sourceClass, String sourceMethod, Throwable t) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptiont- Throwable exception that is the underlying cause of the internal server error HttpServiceException being created.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createInternalServerError
public InternalServerErrorException createInternalServerError(String sourceClass, String sourceMethod, String messageKey) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessageKey- Resource bundle key or message if no localization.- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createInternalServerError
public InternalServerErrorException createInternalServerError(String sourceClass, String sourceMethod, String message, String messageParam) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- Exception message (or resource bundle key)messageParam- Single String message parameter- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createInternalServerError
public InternalServerErrorException createInternalServerError(String sourceClass, String sourceMethod, String message, Object[] messageParams) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- the main text to logmessageParams- parameters for the message (may be null)- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-
createInternalServerError
public InternalServerErrorException createInternalServerError(String sourceClass, String sourceMethod, String message, Object[] messageParams, Level logLevel) Create and log a new HttpServiceException with INTERNAL_SERVER_ERROR HTTP status.- Parameters:
sourceClass- The name of the class that is the source of the exceptionsourceMethod- The name of the method that is the source of the exceptionmessage- the main text to logmessageParams- parameters for the message (may be null)- Returns:
- HttpServiceException Constructed exception, ready to be thrown.
-