class CatalogRest {

    @GET
    @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/{commitId}")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Gets a specific Commit on a specific Branch.")
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response getBranchCommit(@PathParam("catalogId") String catalogId,
                             @PathParam("recordId") String recordId,
                             @PathParam("branchId") String branchId,
                             @PathParam("commitId") String commitId,
                             @DefaultValue("jsonld") @QueryParam("format") String format) {
        long start = System.currentTimeMillis();
        try {
            Commit commit = catalogManager.getCommit(vf.createIRI(catalogId), vf.createIRI(recordId),
                    vf.createIRI(branchId), vf.createIRI(commitId)).orElseThrow(() ->
                    ErrorUtils.sendError("Commit " + commitId + " could not be found", Response.Status.NOT_FOUND));
            return createCommitResponse(commit, catalogManager.getCommitDifference(commit.getResource()), format,
                    transformer, bNodeService);
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (IllegalStateException | MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        } finally {
            LOG.trace("getBranchCommit took {}ms", System.currentTimeMillis() - start);
        }
    }

}