Package fr.gouv.vitam.common.error
Class VitamError<T>
java.lang.Object
fr.gouv.vitam.common.model.RequestResponse<T>
fr.gouv.vitam.common.error.VitamError<T>
VitamError class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAllErrors
(List<VitamError<T>> errors) addToErrors
(VitamError<T> error) getCode()
List<VitamError<T>>
static VitamError<com.fasterxml.jackson.databind.JsonNode>
getFromJsonNode
(com.fasterxml.jackson.databind.JsonNode node) static <T> VitamError<T>
getFromJsonNode
(com.fasterxml.jackson.databind.JsonNode node, Class<T> clasz) getState()
static <T> VitamError<T>
newVitamError
(Class<T> clasz) setContext
(String context) setDescription
(String description) setHttpCode
(int httpCode) setMessage
(String message) javax.ws.rs.core.Response
transform a RequestResponse to a standard responsejavax.ws.rs.core.Response
transform a RequestResponse to a stream responseMethods inherited from class fr.gouv.vitam.common.model.RequestResponse
addHeader, getHeaderString, getHttpCode, getStatus, getVitamHeaders, isOk, isRequestResponseEmpty, isRequestResponseOk, parseFromResponse, parseFromResponse, parseHeadersFromResponse, parseRequestResponseOk, parseRequestResponseOk, parseVitamError, parseVitamError, toJsonNode, toString, unSetVitamHeaders
-
Constructor Details
-
VitamError
protected VitamError() -
VitamError
VitamError constructor- Parameters:
code
- the code used to identify this error object
-
-
Method Details
-
newVitamError
-
setCode
- Parameters:
code
- of error as integer- Returns:
- the VitamError object with the code is setted
-
setHttpCode
- Overrides:
setHttpCode
in classRequestResponse<T>
- Parameters:
httpCode
- the httpCode to set- Returns:
- this
-
setContext
- Parameters:
context
- of error as String- Returns:
- the VitamError object with the context is setted
-
setState
- Parameters:
state
- of error as String- Returns:
- the VitamError object with the error state is setted
-
setMessage
- Parameters:
message
- of error as String- Returns:
- the VitamError object with the error message is setted
-
setDescription
- Parameters:
description
- of error as String- Returns:
- the VitamError object with the description error is setted
-
addAllErrors
- Parameters:
errors
- errors as List- Returns:
- the VitamError object with the list of errors is setted
-
addToErrors
- Parameters:
error
- one error- Returns:
- the VitamError object with the list of errors is setted
-
getCode
- Returns:
- the code of the VitamError object
-
getContext
- Returns:
- the context of the VitamError object
-
getState
- Returns:
- the state of the VitamError object
-
getMessage
- Returns:
- the message of the VitamError object
-
getDescription
- Returns:
- the description of the VitamError object
-
getErrors
- Returns:
- the errors list of the VitamError object
-
getFromJsonNode
public static <T> VitamError<T> getFromJsonNode(com.fasterxml.jackson.databind.JsonNode node, Class<T> clasz) throws InvalidParseOperationException - Parameters:
node
- of vitam error in format JsonNode- Returns:
- the corresponding VitamError
- Throws:
InvalidParseOperationException
- if parse JsonNode node exception occurred
-
getFromJsonNode
public static VitamError<com.fasterxml.jackson.databind.JsonNode> getFromJsonNode(com.fasterxml.jackson.databind.JsonNode node) throws InvalidParseOperationException - Parameters:
node
- of vitam error in format JsonNode- Returns:
- the corresponding VitamError
- Throws:
InvalidParseOperationException
- if parse JsonNode node exception occurred
-
toResponse
public javax.ws.rs.core.Response toResponse()transform a RequestResponse to a standard response- Specified by:
toResponse
in classRequestResponse<T>
- Returns:
- Response
-
toStreamResponse
public javax.ws.rs.core.Response toStreamResponse()transform a RequestResponse to a stream response- Returns:
- Response
-