@Path("/{pushAppID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updatePushApplication(@PathParam("pushAppID") String pushApplicationID, PushApplication updatedPushApp) {
PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID);
if (pushApp != null) {
// some validation
try {
validateModelClass(updatedPushApp);
} catch (ConstraintViolationException cve) {
// Build and return the 400 (Bad Request) response
ResponseBuilder builder = createBadRequestResponse(cve.getConstraintViolations());
return builder.build();
}
// update name/desc:
pushApp.setDescription(updatedPushApp.getDescription());
pushApp.setName(updatedPushApp.getName());
pushAppService.updatePushApplication(pushApp);
return Response.noContent().build();
}