public void addFeaturesRepository(String featuresRepository) throws Exception { featureService.addRepository(new URI(featuresRepository)); }
protected void addFeaturesUrl(String url) { try { featuresService.addRepository(URI.create(url)); } catch (Exception e) { throw new RuntimeException(e); } }
private boolean addRepository(String url) { boolean success = false; if (featuresService == null) { this.log.error("Features service is not available"); } try { featuresService.addRepository(new URI(url)); success = true; } catch (Exception e) { this.log.error("Can't add features repository {}", url, e); } return success; }
public void addRepository(String uri, boolean install) throws Exception { URI repoUri = new URI(uri); if (featuresService.isRepositoryUriBlacklisted(repoUri)) { throw new RuntimeException("Feature URL " + uri + " is blacklisted"); } featuresService.addRepository(repoUri, install); }
public void addRepository(String uri) throws Exception { URI repoUri = new URI(uri); if (featuresService.isRepositoryUriBlacklisted(repoUri)) { throw new RuntimeException("Feature URL " + uri + " is blacklisted"); } featuresService.addRepository(repoUri); }
/** * Add an URI to the list of features repositories. * * @param uri the URI to add. * @throws Exception in case of add failure. */ private void addToFeaturesRepositories(URI uri) throws Exception { try { featuresService.removeRepository(uri); featuresService.addRepository(uri, false); LOGGER.info("Added feature repository '{}'", uri); } catch (Exception e) { LOGGER.warn("Unable to add repository '{}'", uri, e); } }
@Override protected void doExecute(FeaturesService featuresService) throws Exception { URI uri = featuresService.getRepositoryUriFor(nameOrUrl, version); if (uri == null) { uri = new URI(nameOrUrl); } if (featuresService.isRepositoryUriBlacklisted(uri)) { System.out.println("Feature URL " + uri + " is blacklisted"); return; } System.out.println("Adding feature url " + uri); featuresService.addRepository(uri, install); }
@Override protected void doExecute(FeaturesService featuresService) throws Exception { URI uri = featuresService.getRepositoryUriFor(nameOrUrl, version); if (uri == null) { uri = new URI(nameOrUrl); } if (featuresService.isRepositoryUriBlacklisted(uri)) { System.out.println("Feature URL " + uri + " is blacklisted"); return; } System.out.println("Adding feature url " + uri); featuresService.addRepository(uri, install); }
private void setLegacyExtensions(FeaturesService service, Map<String, Object> config) { if (legacy_addons_url != null) { if (config.get(CFG_LEGACY) != null && "true".equals(config.get(CFG_LEGACY).toString())) { try { service.addRepository(legacy_addons_url); } catch (Exception e) { logger.debug("Failed adding feature repo for legacy features - we might be offline: {}", e.getMessage()); } } else { try { service.removeRepository(legacy_addons_url); } catch (Exception e) { // This usually throws an error like // "Feature named 'openhab-binding-homematic1/1.9.0.SNAPSHOT' is not installed" // as Karaf seems to try to uninstall all features for whatever reason // the repo is removed nonetheless in such a case logger.debug("Failed removing feature repo of legacy features: {}", e.getMessage()); } } } }
private void reloadAllRepos(FeaturesService featuresService) throws Exception { System.out.println("Reloading all repositories from their urls"); System.out.println(); List<Exception> exceptions = new ArrayList<>(); for (Repository repo : featuresService.listRepositories()) { try { featuresService.addRepository(repo.getURI()); } catch (Exception e) { exceptions.add(e); } } MultiException.throwIf("Unable to reload repositories", exceptions); }
private void reloadAllRepos(FeaturesService featuresService) throws Exception { System.out.println("Reloading all repositories from their urls"); System.out.println(); List<Exception> exceptions = new ArrayList<>(); for (Repository repo : featuresService.listRepositories()) { try { featuresService.addRepository(repo.getURI()); } catch (Exception e) { exceptions.add(e); } } MultiException.throwIf("Unable to reload repositories", exceptions); }
/** * Sets the repository up. * * @throws Exception if an error occurs. */ @Before public void installRepo() throws Exception { final URI repoUri = getRepoUri(); LOG.info("Attempting to add repository {}", repoUri); featuresService.addRepository(repoUri); checkRepository(repoUri); LOG.info("Successfully loaded repository {}", repoUri); }
private synchronized boolean installAppArtifacts(Application app) throws Exception { if (app.featuresRepo().isPresent() && featuresService.getRepository(app.featuresRepo().get()) == null) { featuresService.addRepository(app.featuresRepo().get()); return true; } return false; }
private void installMissingFeatures(FabBundleInfo info) { ServiceReference reference = bundleContext.getServiceReference(FeaturesService.class.getName()); try { final FeaturesService service = (FeaturesService) bundleContext.getService(reference); for (URI uri : info.getFeatureURLs()) { try { service.addRepository(uri); } catch (Exception e) { LOG.warn("Unable to add feature repository URL {} - FAB {} may not get installed properly", uri, url); } } for (String feature : info.getFeatures()) { try { installMissingFeature(service, feature); } catch (Exception e) { LOG.warn(String.format("Unable to install missing feature %s - FAB %s may not get installed properly", feature, url), e); } } } finally { bundleContext.ungetService(reference); } }
private void installMissingFeatures(FabBundleInfo info) { ServiceReference reference = bundleContext.getServiceReference(FeaturesService.class.getName()); try { final FeaturesService service = (FeaturesService) bundleContext.getService(reference); for (URI uri : info.getFeatureURLs()) { try { service.addRepository(uri); } catch (Exception e) { LOG.warn("Unable to add feature repository URL {} - FAB {} may not get installed properly", uri, url); } } for (String feature : info.getFeatures()) { try { installMissingFeature(service, feature); } catch (Exception e) { LOG.warn(String.format("Unable to install missing feature %s - FAB %s may not get installed properly", feature, url), e); } } } finally { bundleContext.ungetService(reference); } }
for (URI featureUri : missingFeatureUris) { try { featuresService.addRepository(featureUri); } catch (Exception e) { LOG.error("Failed to install feature repository: {}", featureUri, e);
@Before public void installRepo() throws Exception { LOG.info("Attempting to add repository {}", getRepoURI()); featuresService.addRepository(getRepoURI()); checkRepository(getRepoURI()); LOG.info("Successfully loaded repository {}", getRepoURI()); }
@Override protected void doExecute(FeaturesService admin) throws Exception { Feature auxiliaryStoreServerFeature = admin.getFeature(FEATURE_NAME); if (auxiliaryStoreServerFeature == null ) { admin.addRepository(URI.create("mvn:org.talend.esb.auxiliary.storage/auxiliary-storage-features/" + getProjectVersion() + "/xml")); auxiliaryStoreServerFeature = admin.getFeature(FEATURE_NAME); if (auxiliaryStoreServerFeature == null) { String errorMessage = "Failed to start auxiliary storage repository: feature " + FEATURE_NAME + " is missed"; System.out.println(errorMessage); // log.error(errorMessage); return; } } if (!admin.isInstalled(auxiliaryStoreServerFeature)) { admin.installFeature(FEATURE_NAME); } }
if (!isRepositoryRegisteredLocally(uri)) { LOGGER.debug("CELLAR FEATURE: adding repository URI {}", uri); featuresService.addRepository(new URI(uri), event.getInstall()); } else { LOGGER.debug("CELLAR FEATURE: repository URI {} is already registered locally", uri);
if (!isRepositoryRegisteredLocally(uri)) { LOGGER.debug("CELLAR FEATURE: adding repository URI {}", uri); featuresService.addRepository(new URI(uri), event.getInstall()); } else { LOGGER.debug("CELLAR FEATURE: repository URI {} is already registered locally", uri);