Search in sources :

Example 1 with QueryGroups

use of com.google.gerrit.server.group.QueryGroups in project gerrit by GerritCodeReview.

the class GroupsImpl method query.

private List<GroupInfo> query(QueryRequest r) throws RestApiException {
    try {
        QueryGroups myQueryGroups = queryGroups.get();
        myQueryGroups.setQuery(r.getQuery());
        myQueryGroups.setLimit(r.getLimit());
        myQueryGroups.setStart(r.getStart());
        for (ListGroupsOption option : r.getOptions()) {
            myQueryGroups.addOption(option);
        }
        return myQueryGroups.apply(TopLevelResource.INSTANCE);
    } catch (Exception e) {
        throw asRestApiException("Cannot query groups", e);
    }
}
Also used : ListGroupsOption(com.google.gerrit.extensions.client.ListGroupsOption) QueryGroups(com.google.gerrit.server.group.QueryGroups) ApiUtil.asRestApiException(com.google.gerrit.server.api.ApiUtil.asRestApiException) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException)

Aggregations

ListGroupsOption (com.google.gerrit.extensions.client.ListGroupsOption)1 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 ApiUtil.asRestApiException (com.google.gerrit.server.api.ApiUtil.asRestApiException)1 QueryGroups (com.google.gerrit.server.group.QueryGroups)1