Class ODataErrorContext
java.lang.Object
org.apache.olingo.odata2.api.processor.ODataErrorContext
Error context information bean. Usually created and in error situations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the content type which should be used to serialize an error response.Return OData error code that is returned in error response.Get a collection of detailed errors for a OData inner error to be returned in error response.Returns the causing exception.Get the status code which will be returned in error response.Get a string for a OData inner error to be returned in error response.Return the locale of the translated message.Return a translated error message.GetPathInfoobject.getRequestHeader(String name) Get the list of values for a request header.Return a map of http headers to be returned in error response.Get the request uri to be used in an error response.Return OData severity that is returned in error response.Get a target of detailed error for a OData inner error to be returned in error response.voidputRequestHeader(String key, List<String> value) Put http headers to be returned in error response.voidsetContentType(String contentType) Set content type which should be used to serialize an error response.voidsetErrorCode(String errorCode) Set OData error code that should be returned in error response.voidsetErrorDetails(Collection<ODataErrorContext> errorDetails) Set a collection of detailed errors for a OData inner error to be returned in error response.voidsetException(Exception exception) Set the causing exception.voidsetHttpStatus(HttpStatusCodes status) Set http status code that should be returned in error response.voidsetInnerError(String innerError) Set a string for a OData inner error to be returned in error response.voidSet the locale for a translated message.voidsetMessage(String message) Set a translated message.voidsetPathInfo(PathInfo pathInfo) SetPathInfoobject.voidsetRequestUri(URI requestUri) Set the request uri to be used in a error response.voidsetSeverity(String severity) Set OData severity that should be returned in error response.voidSet a target for a OData detailed error to be returned in error response.
-
Constructor Details
-
ODataErrorContext
public ODataErrorContext()create a new context object
-
-
Method Details
-
getException
Returns the causing exception.- Returns:
- exception object
-
setException
Set the causing exception.- Parameters:
exception- exception object
-
getContentType
Get the content type which should be used to serialize an error response.- Returns:
- a content type
-
setContentType
Set content type which should be used to serialize an error response.- Parameters:
contentType- a content type
-
getHttpStatus
Get the status code which will be returned in error response.- Returns:
- http status code
-
setHttpStatus
Set http status code that should be returned in error response.- Parameters:
status- http status code
-
getErrorCode
Return OData error code that is returned in error response.- Returns:
- an application defined error code
-
setErrorCode
Set OData error code that should be returned in error response.- Parameters:
errorCode- an application defined error code
-
getSeverity
Return OData severity that is returned in error response.- Returns:
- an application defined severity
-
setSeverity
Set OData severity that should be returned in error response.- Parameters:
severity- an application defined severity
-
getMessage
Return a translated error message.- Returns:
- translated message
-
setMessage
Set a translated message.- Parameters:
message- translated message
-
getLocale
Return the locale of the translated message.- Returns:
- a locale
-
setLocale
Set the locale for a translated message.- Parameters:
locale- a locale
-
putRequestHeader
Put http headers to be returned in error response.- Parameters:
key- header namevalue- list of header values
-
getRequestHeaders
Return a map of http headers to be returned in error response.- Returns:
- a map of http headers
-
getRequestHeader
Get the list of values for a request header.- Parameters:
name- header name- Returns:
- list of values
-
setRequestUri
Set the request uri to be used in a error response.- Parameters:
requestUri- a uri object
-
getRequestUri
Get the request uri to be used in an error response. Might be null in case the URI was the cause of the exception.- Returns:
- a uri object
-
getInnerError
Get a string for a OData inner error to be returned in error response.- Returns:
- a inner error message
-
setInnerError
Set a string for a OData inner error to be returned in error response.- Parameters:
innerError- a inner error message
-
getErrorDetails
Get a collection of detailed errors for a OData inner error to be returned in error response.- Returns:
- a inner error message
-
getTarget
Get a target of detailed error for a OData inner error to be returned in error response.- Returns:
- a target
-
setTarget
Set a target for a OData detailed error to be returned in error response.- Parameters:
target- a target
-
setErrorDetails
Set a collection of detailed errors for a OData inner error to be returned in error response. If set, will overwrite theinnerErrorelement.- Parameters:
errorDetails- a inner error message
-
getPathInfo
GetPathInfoobject. May beNULLif no path info was created/set till error occurred (but may be over written by application).- Returns:
PathInfoorNULL.
-
setPathInfo
SetPathInfoobject.- Parameters:
pathInfo- path info
-