Package io.jans.as.model.error
Class ErrorResponseFactory
java.lang.Object
io.jans.as.model.error.ErrorResponseFactory
- All Implemented Interfaces:
Configuration
Provides an easy way to get Error responses based in an error response type
- Version:
- August 20, 2019
- Author:
- Yuriy Zabrovarnyy, Javier Rojas Blum, Yuriy Movchan
-
Constructor Summary
ConstructorsConstructorDescriptionErrorResponseFactory
(ErrorMessages messages, AppConfiguration appConfiguration) -
Method Summary
Modifier and TypeMethodDescription@NotNull jakarta.ws.rs.WebApplicationException
createBadRequestException
(@NotNull ErrorResponse error) @NotNull jakarta.ws.rs.WebApplicationException
createBadRequestException
(@NotNull IErrorType error, @Nullable String state) jakarta.ws.rs.WebApplicationException
createWebApplicationException
(jakarta.ws.rs.core.Response.Status status, IErrorType type, String reason) errorAsJson
(IErrorType type, String reason) getErrorAsJson
(IErrorType type) getErrorAsJson
(IErrorType type, String state, String reason) getErrorAsQueryString
(IErrorType type, String state) getErrorAsQueryString
(IErrorType type, String state, String reason) getErrorResponse
(IErrorType type) getErrorResponse
(IErrorType type, String state, String reason) boolean
isFeatureFlagEnabled
(FeatureFlagType flagType) jakarta.ws.rs.core.Response.ResponseBuilder
newErrorResponse
(jakarta.ws.rs.core.Response.Status status) void
setMessages
(ErrorMessages messages) void
validateFeatureEnabled
(FeatureFlagType flagType)
-
Constructor Details
-
ErrorResponseFactory
public ErrorResponseFactory() -
ErrorResponseFactory
-
-
Method Details
-
getMessages
-
setMessages
-
getErrorAsJson
-
errorAsJson
-
isFeatureFlagEnabled
-
validateFeatureEnabled
-
newErrorResponse
public jakarta.ws.rs.core.Response.ResponseBuilder newErrorResponse(jakarta.ws.rs.core.Response.Status status) -
createWebApplicationException
public jakarta.ws.rs.WebApplicationException createWebApplicationException(jakarta.ws.rs.core.Response.Status status, IErrorType type, String reason) throws jakarta.ws.rs.WebApplicationException - Throws:
jakarta.ws.rs.WebApplicationException
-
createBadRequestException
@NotNull public @NotNull jakarta.ws.rs.WebApplicationException createBadRequestException(@NotNull @NotNull ErrorResponse error) -
createBadRequestException
@NotNull public @NotNull jakarta.ws.rs.WebApplicationException createBadRequestException(@NotNull @NotNull IErrorType error, @Nullable @Nullable String state) -
getErrorAsJson
-
getErrorAsQueryString
-
getErrorAsQueryString
-
getErrorResponse
-
getErrorResponse
-
getJsonErrorResponse
-