rishson/dojoEnterpriseApp — Issue #6: Handling of HTTP Status Codes
Author: craigbarker
Created: 2011-11-09 14:24:17+00:00
State: open

On the rest backend we would like to use the standard Java JSR311 Response Object to deal with the appropriate HTTP status codes to deal with known error conditions e.g. duplicate client created.

For example:

```java
try {
delegate.doSomething(somethingId);
} catch (IndexException e) {
Response.ResponseBuilder builder =
Response.status(Response.Status.CONFLICT);
builder.type("application/json");
builder.entity("Could not do something, something already exists");
throw new WebApplicationException(e, builder.build());
}
```

This means that the enterprise framework needs to be sensitive to the Status Code of the response message and before it publishes the message back to the topic adapts the Status Code to a set of flags which keeps the subscriber ignorant of the present of HTTP Codes but allows it to respond in an widget specific way depending on what the response was.

Initially the codes needed are:
* 200 OK
* 409 CONFLICT