/** * @return * @see org.apache.karaf.features.Feature#getId() */ @Override public String getId() { return feature.getId(); }
@Override public String getId() { return this.feature.getId(); }
protected void add(SortedSet<String> candidates, Feature feature) { candidates.add(feature.getId()); }
protected void add(SortedSet<String> candidates, Feature feature) { candidates.add(feature.getId()); }
protected void add(SortedSet<String> candidates, Feature feature) { candidates.add(feature.getId()); }
protected void add(SortedSet<String> candidates, Feature feature) { candidates.add(feature.getId()); }
@Override protected boolean acceptsFeature(Feature feature) { return featuresService.getState(feature.getId()) == FeatureState.Resolved; }
@Override protected boolean acceptsFeature(Feature feature) { return featuresService.getState(feature.getId()) == FeatureState.Resolved; }
protected String getFeatureId(FeaturesService admin, String nameOrId) throws Exception { Feature[] matchingFeatures = admin.getFeatures(nameOrId); if (matchingFeatures.length == 0) { throw new IllegalArgumentException("No matching feature found for " + nameOrId); } if (matchingFeatures.length > 1) { throw new IllegalArgumentException("More than one matching feature found for " + nameOrId); } return matchingFeatures[0].getId(); }
@Override public boolean isInstalled(Feature f) { String id = normalize(f.getId()); synchronized (lock) { Set<String> installed = state.installedFeatures.get(ROOT_REGION); return installed != null && installed.contains(id); } }
@Override public void installFeature(Feature feature, EnumSet<Option> options) throws Exception { installFeature(feature.getId(), options); }
protected List<String> getFeatureIds(FeaturesService admin, List<String> nameOrIds) throws Exception { List<String> ids = new ArrayList<>(); for (String nameOrId : nameOrIds) { for (Feature f : admin.getFeatures(nameOrId)) { ids.add(f.getId()); } } if (ids.isEmpty()) { throw new IllegalArgumentException("No matching feature found for " + nameOrIds); } return ids; } }
@Override protected boolean acceptsFeature(Feature feature) { return featuresService.getState(feature.getId()) == FeatureState.Started; }
protected List<String> getFeatureIds(FeaturesService admin, List<String> nameOrIds) throws Exception { List<String> ids = new ArrayList<>(); for (String nameOrId : nameOrIds) { for (Feature f : admin.getFeatures(nameOrId)) { ids.add(f.getId()); } } if (ids.isEmpty()) { throw new IllegalArgumentException("No matching feature found for " + nameOrIds); } return ids; } }
protected String getFeatureId(FeaturesService admin, String nameOrId) throws Exception { Feature[] matchingFeatures = admin.getFeatures(nameOrId); if (matchingFeatures.length == 0) { throw new IllegalArgumentException("No matching feature found for " + nameOrId); } if (matchingFeatures.length > 1) { throw new IllegalArgumentException("More than one matching feature found for " + nameOrId); } return matchingFeatures[0].getId(); }
/** * Sets a list of features and stores it as map of features where the key is <code>name</code> and value is a * list of features with different versions. * @param featuresList */ public void partitionFeatures(Collection<Feature> featuresList) { features = new HashMap<>(); featuresById = new HashMap<>(); for (Feature feature : featuresList) { features.computeIfAbsent(feature.getName(), name -> new ArrayList<>()).add(feature); featuresById.put(feature.getId(), feature); } } }
@Override protected boolean acceptsFeature(Feature feature) { return featuresService.getState(feature.getId()) == FeatureState.Started; }
private void assertNotBlacklisted(org.apache.karaf.features.Feature feature) { if (feature.isBlacklisted()) { if (builder.getBlacklistPolicy() == Builder.BlacklistPolicy.Fail) { throw new RuntimeException("Feature " + feature.getId() + " is blacklisted"); } } }
private void assertNotBlacklisted(org.apache.karaf.features.Feature feature) { if (feature.isBlacklisted()) { if (builder.getBlacklistPolicy() == Builder.BlacklistPolicy.Fail) { throw new RuntimeException("Feature " + feature.getId() + " is blacklisted"); } } }