Search in sources :

Example 1 with GroupIdList

use of org.apache.archiva.rest.api.model.GroupIdList in project archiva by apache.

the class DefaultSearchService method getAllGroupIds.

@Override
public GroupIdList getAllGroupIds(List<String> selectedRepos) throws ArchivaRestServiceException {
    List<String> observableRepos = getObservableRepos();
    List<String> repos = ListUtils.intersection(observableRepos, selectedRepos);
    if (repos == null || repos.isEmpty()) {
        return new GroupIdList(Collections.<String>emptyList());
    }
    try {
        return new GroupIdList(new ArrayList<>(repositorySearch.getAllGroupIds(getPrincipal(), repos)));
    } catch (RepositorySearchException e) {
        log.error(e.getMessage(), e);
        throw new ArchivaRestServiceException(e.getMessage(), e);
    }
}
Also used : GroupIdList(org.apache.archiva.rest.api.model.GroupIdList) ArchivaRestServiceException(org.apache.archiva.rest.api.services.ArchivaRestServiceException) RepositorySearchException(org.apache.archiva.indexer.search.RepositorySearchException)

Aggregations

RepositorySearchException (org.apache.archiva.indexer.search.RepositorySearchException)1 GroupIdList (org.apache.archiva.rest.api.model.GroupIdList)1 ArchivaRestServiceException (org.apache.archiva.rest.api.services.ArchivaRestServiceException)1