public class ODataErrorContext extends Object
EntityProvider
,
ODataErrorCallback
Constructor and Description |
---|
ODataErrorContext()
create a new context object
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Get the content type which should be used to serialize an error response.
|
String |
getErrorCode()
Return OData error code that is returned in error response.
|
Exception |
getException()
Returns the causing exception.
|
HttpStatusCodes |
getHttpStatus()
Get the status code which will be returned in error response.
|
String |
getInnerError()
Get a string for a OData inner error to be returned in error response.
|
Locale |
getLocale()
Return the locale of the translated message.
|
String |
getMessage()
Return a translated error message.
|
PathInfo |
getPathInfo()
Get
PathInfo object. |
List<String> |
getRequestHeader(String name)
Get the list of values for a request header.
|
Map<String,List<String>> |
getRequestHeaders()
Return a map of http headers to be returned in error response.
|
URI |
getRequestUri()
Get the request uri to be used in an error response.
|
void |
putRequestHeader(String key,
List<String> value)
Put http headers to be returned in error response.
|
void |
setContentType(String contentType)
Set content type which should be used to serialize an error response.
|
void |
setErrorCode(String errorCode)
Set OData error code that should be returned in error response.
|
void |
setException(Exception exception)
Set the causing exception.
|
void |
setHttpStatus(HttpStatusCodes status)
Set http status code that should be returned in error response.
|
void |
setInnerError(String innerError)
Set a string for a OData inner error to be returned in error response.
|
void |
setLocale(Locale locale)
Set the locale for a translated message.
|
void |
setMessage(String message)
Set a translated message.
|
void |
setPathInfo(PathInfo pathInfo)
Set
PathInfo object. |
void |
setRequestUri(URI requestUri)
Set the request uri to be used in a error response.
|
public Exception getException()
public void setException(Exception exception)
exception
- exception objectpublic String getContentType()
public void setContentType(String contentType)
contentType
- a content typepublic HttpStatusCodes getHttpStatus()
public void setHttpStatus(HttpStatusCodes status)
status
- http status codepublic String getErrorCode()
public void setErrorCode(String errorCode)
errorCode
- an application defined error codepublic String getMessage()
public void setMessage(String message)
message
- translated messagepublic Locale getLocale()
public void setLocale(Locale locale)
locale
- a localepublic void putRequestHeader(String key, List<String> value)
key
- header namevalue
- list of header valuespublic Map<String,List<String>> getRequestHeaders()
public List<String> getRequestHeader(String name)
name
- header namepublic void setRequestUri(URI requestUri)
requestUri
- a uri objectpublic URI getRequestUri()
public String getInnerError()
public void setInnerError(String innerError)
innerError
- a inner error messagepublic PathInfo getPathInfo()
PathInfo
object.
May be NULL
if no path info was created/set till error occurred (but may be over written by
application).PathInfo
or NULL
.Copyright © 2013-2017 The Apache Software Foundation. All Rights Reserved.