class CatalogRest {

    @PUT
    @Path("{catalogId}/records/{recordId}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Updates the Catalog Record by its ID using the provided Record JSON-LD.")
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response updateRecord(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          String newRecordJson) {
        try {
            Record newRecord = getNewThing(newRecordJson, vf.createIRI(recordId),
                    factoryRegistry.getFactoryOfType(Record.class).get());
            catalogManager.updateRecord(vf.createIRI(catalogId), newRecord);
            return Response.ok().build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}