@GET @Path("/collection") @Permission({ "collection", "list" }) @ExplicitDetails @ApiOperation( value = "List collections", notes = "Gets a list of all the subject collections, for example groups, users, etc.") public Set<SubjectCollection> listCollections() { PermissionService srv = getPermissionService(); try { Set<SubjectCollection> colls = new HashSet<>(); for (String id : srv.getAllIdentifiers().get()) { colls.add(srv.loadCollection(id).get()); } return colls; } catch (InterruptedException e) { throw new ClientErrorException(e.getMessage(), Response.Status.REQUEST_TIMEOUT); } catch (ExecutionException e) { throw new InternalServerErrorException(e.getMessage()); } }