Search in sources :

Example 1 with AdminRepositoryConsumer

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

the class AddAdminRepoConsumerClosure method execute.

@Override
public void execute(RepositoryContentConsumer input) {
    RepositoryContentConsumer consumer = (RepositoryContentConsumer) input;
    boolean enabled = this.selectedIds.contains(consumer.getId());
    AdminRepositoryConsumer adminconsumer = new AdminRepositoryConsumer();
    adminconsumer.setEnabled(enabled);
    adminconsumer.setId(consumer.getId());
    adminconsumer.setDescription(consumer.getDescription());
    list.add(adminconsumer);
}
Also used : AdminRepositoryConsumer(org.apache.archiva.rest.api.model.AdminRepositoryConsumer) RepositoryContentConsumer(org.apache.archiva.consumers.RepositoryContentConsumer)

Example 2 with AdminRepositoryConsumer

use of org.apache.archiva.rest.api.model.AdminRepositoryConsumer 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 3 with AdminRepositoryConsumer

use of org.apache.archiva.rest.api.model.AdminRepositoryConsumer 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

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