class CatalogRest {

    @GET
    @Path("{catalogId}/records/{recordId}/versions")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Gets a list of Versions for a VersionedRecord.")
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response getVersions(@Context UriInfo uriInfo,
                         @PathParam("catalogId") String catalogId,
                         @PathParam("recordId") String recordId,
                         @QueryParam("sort") String sort,
                         @DefaultValue("0") @QueryParam("offset") int offset,
                         @DefaultValue("100") @QueryParam("limit") int limit,
                         @DefaultValue("true") @QueryParam("ascending") boolean asc) {
        try {
            validatePaginationParams(sort, SORT_RESOURCES, limit, offset);
            Set<Version> versions = catalogManager.getVersions(vf.createIRI(catalogId), vf.createIRI(recordId));
            return createPaginatedThingResponseJackson(uriInfo, versions, vf.createIRI(sort), offset, limit,
                    asc, null, Version.TYPE, transformer, bNodeService);
        } 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);
        }
    }

}