Package io.jans.as.model.error
Class ErrorResponseFactory
- java.lang.Object
-
- io.jans.as.model.error.ErrorResponseFactory
-
- All Implemented Interfaces:
Configuration
public class ErrorResponseFactory extends Object implements 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
Constructors Constructor Description ErrorResponseFactory()
ErrorResponseFactory(ErrorMessages messages, AppConfiguration appConfiguration)
-
Method Summary
-
-
-
Constructor Detail
-
ErrorResponseFactory
public ErrorResponseFactory()
-
ErrorResponseFactory
public ErrorResponseFactory(ErrorMessages messages, AppConfiguration appConfiguration)
-
-
Method Detail
-
getMessages
public ErrorMessages getMessages()
-
setMessages
public void setMessages(ErrorMessages messages)
-
getErrorAsJson
public String getErrorAsJson(IErrorType type)
-
errorAsJson
public String errorAsJson(IErrorType type, String reason)
-
validateFeatureEnabled
public void validateFeatureEnabled(FeatureFlagType flagType)
-
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
public String getErrorAsJson(IErrorType type, String state, String reason)
-
getErrorAsQueryString
public String getErrorAsQueryString(IErrorType type, String state)
-
getErrorAsQueryString
public String getErrorAsQueryString(IErrorType type, String state, String reason)
-
getErrorResponse
public DefaultErrorResponse getErrorResponse(IErrorType type, String state, String reason)
-
getErrorResponse
public DefaultErrorResponse getErrorResponse(IErrorType type)
-
getJsonErrorResponse
public String getJsonErrorResponse(IErrorType type)
-
-