/** * Create an instance of {@link Feature} * * @return the feature. */ public Feature createFeature() { return new Feature(); }
public static org.apache.karaf.features.Feature valueOf(String str) { int idx = str.indexOf(VERSION_SEPARATOR); if (idx >= 0) { String strName = str.substring(0, idx); String strVersion = str.substring(idx + 1, str.length()); return new Feature(strName, strVersion); } else { return new Feature(str); } }
private Feature mergeFeature(Set<Feature> featuresSet) throws MojoExecutionException { Feature merged = new Feature("merged"); Set<String> bundleIds = new HashSet<>(); for (Feature feature : featuresSet) { for (Bundle bundle : feature.getBundle()) { String symbolicName = getBundleSymbolicName(bundle); if (symbolicName == null) { logIgnored(bundle); continue; } String bundleId = symbolicName + ":" + getBundleVersion(bundle); if (!bundleIds.contains(bundleId)) { bundleIds.add(bundleId); merged.getBundle().add(bundle); } } } return merged; }
private Feature mergeFeature(Set<Feature> featuresSet) throws MojoExecutionException { Feature merged = new Feature("merged"); Set<String> bundleIds = new HashSet<>(); for (Feature feature : featuresSet) { for (Bundle bundle : feature.getBundle()) { String symbolicName = getBundleSymbolicName(bundle); if (symbolicName == null) { logIgnored(bundle); continue; } String bundleId = symbolicName + ":" + getBundleVersion(bundle); if (!bundleIds.contains(bundleId)) { bundleIds.add(bundleId); merged.getBundle().add(bundle); } } } return merged; }
@Override public Feature asFeature() { if (owner == null) { throw new IllegalStateException("No owner set for conditional"); } String name = owner.getName(); String version = owner.getVersion(); String conditionName = name + "-condition-" + getConditionId().replaceAll("[^A-Za-z0-9 ]", "_"); org.apache.karaf.features.internal.model.Feature f = new org.apache.karaf.features.internal.model.Feature(conditionName, version); f.getBundle().addAll(getBundle()); f.getConfig().addAll(getConfig()); f.getConfigfile().addAll(getConfigfile()); f.getFeature().addAll(getFeature()); return f; }
private Feature mergeFeatureOneVersion(Set<Feature> featuresSet) throws MojoExecutionException { Feature merged = new Feature("merged"); Map<String, Bundle> bundleVersions = new HashMap<>(); for (Feature feature : featuresSet) { for (Bundle bundle : feature.getBundle()) { String symbolicName = getBundleSymbolicName(bundle); if (symbolicName == null) { logIgnored(bundle); continue; } Bundle existingBundle = bundleVersions.get(symbolicName); if (existingBundle != null) { Version existingVersion = new Version(getBundleVersion(existingBundle)); Version newVersion = new Version(getBundleVersion(bundle)); if (newVersion.compareTo(existingVersion) > 0) { bundleVersions.put(symbolicName, bundle); } } else { bundleVersions.put(symbolicName, bundle); } } } for (Bundle bundle : bundleVersions.values()) { merged.getBundle().add(bundle); } return merged; }
private Feature mergeFeatureOneVersion(Set<Feature> featuresSet) throws MojoExecutionException { Feature merged = new Feature("merged"); Map<String, Bundle> bundleVersions = new HashMap<>(); for (Feature feature : featuresSet) { for (Bundle bundle : feature.getBundle()) { String symbolicName = getBundleSymbolicName(bundle); if (symbolicName == null) { logIgnored(bundle); continue; } Bundle existingBundle = bundleVersions.get(symbolicName); if (existingBundle != null) { Version existingVersion = new Version(getBundleVersion(existingBundle)); Version newVersion = new Version(getBundleVersion(bundle)); if (newVersion.compareTo(existingVersion) > 0) { bundleVersions.put(symbolicName, bundle); } } else { bundleVersions.put(symbolicName, bundle); } } } for (Bundle bundle : bundleVersions.values()) { merged.getBundle().add(bundle); } return merged; }
Feature wrapFeature = new Feature(); wrapFeature.setName(feature); wrapFeature.setVersion(version);
Feature generated = new Feature(); generated.setName(generatedBootFeatureName);
Feature generated = new Feature(); generated.setName(UUID.randomUUID().toString());