use of org.apache.archiva.rest.api.model.RepositoryScannerStatistics in project archiva by apache.
the class DefaultSystemStatusService method getRepositoryScannerStatistics.
@Override
public List<RepositoryScannerStatistics> getRepositoryScannerStatistics() throws ArchivaRestServiceException {
Set<RepositoryScannerInstance> repositoryScannerInstances = scanner.getInProgressScans();
if (repositoryScannerInstances.isEmpty()) {
return Collections.emptyList();
}
List<RepositoryScannerStatistics> repositoryScannerStatisticsList = new ArrayList<RepositoryScannerStatistics>(repositoryScannerInstances.size());
for (RepositoryScannerInstance instance : repositoryScannerInstances) {
RepositoryScannerStatistics repositoryScannerStatistics = new RepositoryScannerStatistics();
repositoryScannerStatisticsList.add(repositoryScannerStatistics);
try {
repositoryScannerStatistics.setManagedRepository(managedRepositoryAdmin.getManagedRepository(instance.getRepository().getId()));
} catch (RepositoryAdminException e) {
log.error("Could not retrieve repository '{}'", instance.getRepository().getId());
}
repositoryScannerStatistics.setNewFileCount(instance.getStats().getNewFileCount());
repositoryScannerStatistics.setTotalFileCount(instance.getStats().getTotalFileCount());
repositoryScannerStatistics.setConsumerScanningStatistics(mapConsumerScanningStatistics(instance));
}
return repositoryScannerStatisticsList;
}
Aggregations