Search in sources :

Example 1 with AddAdminRepoConsumerClosure

use of org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure in project archiva by apache.

the class DefaultArchivaAdministrationService method getInvalidContentAdminRepositoryConsumers.

@Override
public List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers() throws ArchivaRestServiceException {
    try {
        AddAdminRepoConsumerClosure addAdminRepoConsumer = new AddAdminRepoConsumerClosure(archivaAdministration.getInvalidContentConsumers());
        IterableUtils.forEach(repoConsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer);
        List<AdminRepositoryConsumer> invalidContentConsumers = addAdminRepoConsumer.getList();
        invalidContentConsumers.sort(AdminRepositoryConsumerComparator.getInstance());
        return invalidContentConsumers;
    } catch (RepositoryAdminException e) {
        throw new ArchivaRestServiceException(e.getMessage(), e);
    }
}
Also used : AddAdminRepoConsumerClosure(org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure) ArchivaRestServiceException(org.apache.archiva.rest.api.services.ArchivaRestServiceException) AdminRepositoryConsumer(org.apache.archiva.rest.api.model.AdminRepositoryConsumer) RepositoryAdminException(org.apache.archiva.admin.model.RepositoryAdminException)

Example 2 with AddAdminRepoConsumerClosure

use of org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure in project archiva by apache.

the class DefaultArchivaAdministrationService method getKnownContentAdminRepositoryConsumers.

@Override
public List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers() throws ArchivaRestServiceException {
    try {
        AddAdminRepoConsumerClosure addAdminRepoConsumer = new AddAdminRepoConsumerClosure(archivaAdministration.getKnownContentConsumers());
        IterableUtils.forEach(repoConsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer);
        List<AdminRepositoryConsumer> knownContentConsumers = addAdminRepoConsumer.getList();
        knownContentConsumers.sort(AdminRepositoryConsumerComparator.getInstance());
        return knownContentConsumers;
    } catch (RepositoryAdminException e) {
        throw new ArchivaRestServiceException(e.getMessage(), e);
    }
}
Also used : AddAdminRepoConsumerClosure(org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure) ArchivaRestServiceException(org.apache.archiva.rest.api.services.ArchivaRestServiceException) AdminRepositoryConsumer(org.apache.archiva.rest.api.model.AdminRepositoryConsumer) RepositoryAdminException(org.apache.archiva.admin.model.RepositoryAdminException)

Aggregations

RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)2 AdminRepositoryConsumer (org.apache.archiva.rest.api.model.AdminRepositoryConsumer)2 ArchivaRestServiceException (org.apache.archiva.rest.api.services.ArchivaRestServiceException)2 AddAdminRepoConsumerClosure (org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure)2