use of org.eclipse.equinox.p2.repository.metadata.IMetadataRepository in project knime-core by knime.
the class InstallMissingNodesJob method findExtensions.
private IStatus findExtensions(final IProgressMonitor monitor, final List<NodeAndBundleInformation> missingNodes, final Set<IInstallableUnit> featuresToInstall) {
ProvisioningSession session = ProvisioningUI.getDefaultUI().getSession();
Bundle myself = FrameworkUtil.getBundle(getClass());
try {
IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) session.getProvisioningAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
for (URI uri : metadataManager.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL)) {
if (!missingNodes.isEmpty()) {
IMetadataRepository repo = metadataManager.loadRepository(uri, monitor);
for (Iterator<NodeAndBundleInformation> it = missingNodes.iterator(); it.hasNext(); ) {
NodeAndBundleInformation info = it.next();
if (searchInRepository(repo, info, metadataManager, monitor, featuresToInstall)) {
it.remove();
}
}
}
}
return Status.OK_STATUS;
} catch (ProvisionException ex) {
NodeLogger.getLogger(getClass()).error("Could not create provisioning agent: " + ex.getMessage(), ex);
return new Status(IStatus.ERROR, myself.getSymbolicName(), "Could not query updates site for missing extensions", ex);
}
}
Aggregations