Search in sources :

Example 16 with RepositoryGroup

use of org.apache.archiva.admin.model.beans.RepositoryGroup in project archiva by apache.

the class DefaultRepositoryGroupAdmin method getRepositoryToGroupMap.

@Override
public Map<String, List<String>> getRepositoryToGroupMap() throws RepositoryAdminException {
    Map<String, List<String>> map = new HashMap<>();
    for (RepositoryGroup group : getRepositoriesGroups()) {
        for (String repositoryId : group.getRepositories()) {
            List<String> groups = map.get(repositoryId);
            if (groups == null) {
                groups = new ArrayList<>();
                map.put(repositoryId, groups);
            }
            groups.add(group.getId());
        }
    }
    return map;
}
Also used : RepositoryGroup(org.apache.archiva.admin.model.beans.RepositoryGroup) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

RepositoryGroup (org.apache.archiva.admin.model.beans.RepositoryGroup)16 ManagedRepository (org.apache.archiva.admin.model.beans.ManagedRepository)9 Test (org.junit.Test)8 AbstractRepositoryAdminTest (org.apache.archiva.admin.repository.AbstractRepositoryAdminTest)5 RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)4 Path (java.nio.file.Path)3 HashMap (java.util.HashMap)3 ManagedRepositoriesService (org.apache.archiva.rest.api.services.ManagedRepositoriesService)3 RepositoryGroupService (org.apache.archiva.rest.api.services.RepositoryGroupService)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ProxyConnector (org.apache.archiva.admin.model.beans.ProxyConnector)2 RemoteRepository (org.apache.archiva.admin.model.beans.RemoteRepository)2 Configuration (org.apache.archiva.configuration.Configuration)2 RepositoryGroupConfiguration (org.apache.archiva.configuration.RepositoryGroupConfiguration)2 Artifact (org.apache.archiva.maven2.model.Artifact)2 SearchRequest (org.apache.archiva.rest.api.model.SearchRequest)2 ProxyConnectorService (org.apache.archiva.rest.api.services.ProxyConnectorService)2 RepositoriesService (org.apache.archiva.rest.api.services.RepositoriesService)2 SearchService (org.apache.archiva.rest.api.services.SearchService)2