本文整理了Java中org.apache.karaf.features.Feature.getId()
方法的一些代码示例,展示了Feature.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feature.getId()
方法的具体详情如下:
包路径:org.apache.karaf.features.Feature
类名称:Feature
方法名:getId
暂无
代码示例来源:origin: org.opendaylight.controller/config-persister-feature-adapter
/**
* @return
* @see org.apache.karaf.features.Feature#getId()
*/
@Override
public String getId() {
return feature.getId();
}
代码示例来源:origin: apache/karaf
@Override
public String getId() {
return this.feature.getId();
}
代码示例来源:origin: org.onosproject/onos-core-net
private boolean needToCheck(Feature feature) {
// We only need to check core ONOS features, not external ones.
return feature.getId().startsWith("onos-") &&
!feature.getId().contains("thirdparty");
}
代码示例来源:origin: apache/karaf
protected void add(SortedSet<String> candidates, Feature feature) {
candidates.add(feature.getId());
}
代码示例来源:origin: apache/karaf
protected void add(SortedSet<String> candidates, Feature feature) {
candidates.add(feature.getId());
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
protected void add(SortedSet<String> candidates, Feature feature) {
candidates.add(feature.getId());
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
protected void add(SortedSet<String> candidates, Feature feature) {
candidates.add(feature.getId());
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
@Override
protected boolean acceptsFeature(Feature feature) {
return featuresService.getState(feature.getId()) == FeatureState.Resolved;
}
代码示例来源:origin: apache/karaf
@Override
protected boolean acceptsFeature(Feature feature) {
return featuresService.getState(feature.getId()) == FeatureState.Resolved;
}
代码示例来源:origin: apache/karaf
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();
}
代码示例来源:origin: apache/karaf
@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);
}
}
代码示例来源:origin: apache/karaf
@Override
public void installFeature(Feature feature, EnumSet<Option> options) throws Exception {
installFeature(feature.getId(), options);
}
代码示例来源:origin: apache/karaf
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;
}
}
代码示例来源:origin: apache/karaf
@Override
protected boolean acceptsFeature(Feature feature) {
return featuresService.getState(feature.getId()) == FeatureState.Started;
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
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;
}
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
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();
}
代码示例来源:origin: apache/karaf
/**
* 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);
}
}
}
代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command
@Override
protected boolean acceptsFeature(Feature feature) {
return featuresService.getState(feature.getId()) == FeatureState.Started;
}
代码示例来源:origin: apache/karaf
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");
}
}
}
代码示例来源:origin: org.apache.karaf.profile/org.apache.karaf.profile.core
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");
}
}
}
内容来源于网络,如有侵权,请联系作者删除!