|
Cumulus4j API (1.0.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cumulus4j.keymanager.back.shared.Message org.cumulus4j.keymanager.back.shared.Response org.cumulus4j.keymanager.back.shared.ErrorResponse
public class ErrorResponse
Response
implementation for sending an error back to the app-server.
It can optionally wrap a Throwable
to provide more precise information
(the type) than just a message.
Constructor Summary | |
---|---|
ErrorResponse()
Create an empty instance of ErrorResponse . |
|
ErrorResponse(Request request,
String errorMessage)
Create an instance of ErrorResponse in order to reply the given request . |
|
ErrorResponse(Request request,
Throwable throwable)
Create an instance of ErrorResponse in order to reply the given request . |
Method Summary | |
---|---|
String |
getMessage()
Get the error-message. |
String |
getType()
Get the error-type. |
void |
setMessage(String errorMessage)
Set the error-message, i.e. |
void |
setType(String type)
Set the error-type. |
Methods inherited from class org.cumulus4j.keymanager.back.shared.Response |
---|
toString |
Methods inherited from class org.cumulus4j.keymanager.back.shared.Message |
---|
equals, getRequestID, hashCode, setRequestID |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ErrorResponse()
ErrorResponse
.
Only used for serialisation/deserialisation.
public ErrorResponse(Request request, String errorMessage)
ErrorResponse
in order to reply the given request
.
request
- the request to be replied.errorMessage
- a description of what went wrong.public ErrorResponse(Request request, Throwable throwable)
ErrorResponse
in order to reply the given request
.
request
- the request to be replied.throwable
- the error to be wrapped and sent back to the app-server instead of a normal response.Method Detail |
---|
public String getType()
Throwable
-sub-class
passed to ErrorResponse(Request, Throwable)
or otherwise set
.
null
.setType(String)
public void setType(String type)
type
- the error-type or null
. If not null
, this must be a fully
qualified class-name of the Throwable
-sub-class.getType()
public String getMessage()
ErrorResponse
instance,
it will be the result of Throwable.getMessage()
.
setMessage(String)
public void setMessage(String errorMessage)
errorMessage
- the error message.getMessage()
|
Cumulus4j API (1.0.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |