class CatalogRest {

    @GET
    @Path("{catalogId}")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Retrieves the Catalog specified by the provided ID.")
    public Response getCatalog(@PathParam("catalogId") String catalogId) {
        try {
            Resource catalogIri = vf.createIRI(catalogId);
            if (catalogIri.equals(configProvider.getLocalCatalogIRI())) {
                return Response.ok(thingToSkolemizedObjectNode(catalogManager.getLocalCatalog(),
                        Catalog.TYPE, transformer, bNodeService).toString()).build();
            } else if (catalogIri.equals(configProvider.getDistributedCatalogIRI())) {
                return Response.ok(thingToSkolemizedObjectNode(catalogManager.getDistributedCatalog(),
                        Catalog.TYPE, transformer, bNodeService).toString()).build();
            } else {
                throw ErrorUtils.sendError("Catalog " + catalogId + " does not exist", Response.Status.NOT_FOUND);
            }
        } catch (IllegalStateException | MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}