private Set<ResolvedFeatureId> resolveExcludedIds(Set<ResolvedFeatureId> resolvedIds, Map<FeatureId, String> features) throws ProvisioningException { for (Map.Entry<FeatureId, String> excluded : features.entrySet()) { final FeatureId excludedId = excluded.getKey(); final ResolvedFeatureSpec resolvedSpec = getFeatureSpec(excludedId.getSpec().getName()); if(parentFeature != null) { resolvedIds = CollectionUtils.add(resolvedIds, resolvedSpec.resolveIdFromForeignKey(parentFeature.id, excluded.getValue(), excludedId.getParams())); } else { resolvedIds = CollectionUtils.add(resolvedIds, resolvedSpec.resolveFeatureId(excludedId.getParams())); } } return resolvedIds; }
private Map<ResolvedFeatureId, FeatureConfig> resolveIncludedIds(Map<ResolvedFeatureId, FeatureConfig> includedFeatures, Map<FeatureId, FeatureConfig> features) throws ProvisioningException { for (Map.Entry<FeatureId, FeatureConfig> included : features.entrySet()) { final FeatureConfig fc = new FeatureConfig(included.getValue()); final ResolvedFeatureSpec resolvedSpec = getFeatureSpec(fc.getSpecId().getName()); if (parentFeature != null) { includedFeatures = CollectionUtils.put(includedFeatures, resolvedSpec.resolveIdFromForeignKey(parentFeature.id, fc.getParentRef(), fc.getParams()), fc); } else { includedFeatures = CollectionUtils.put(includedFeatures, resolvedSpec.resolveFeatureId(fc.getParams()), fc); } } return includedFeatures; }
final FeaturePackRuntimeBuilder depFp = depSpec.getOrigin() == null ? rt.layout.getFeaturePack(id.producer) : rt.getOrigin(depSpec.getOrigin()); final ResolvedFeatureSpec depResolvedSpec = rt.getFeatureSpec(depFp, depSpec.getFeatureId().getSpec().getName()); return Collections.singletonMap(depResolvedSpec.resolveFeatureId(depSpec.getFeatureId().getParams()), depSpec); final FeaturePackRuntimeBuilder depFp = userDep.getOrigin() == null ? ownFp : rt.getOrigin(userDep.getOrigin()); final ResolvedFeatureSpec depResolvedSpec = rt.getFeatureSpec(depFp, userDep.getFeatureId().getSpec().getName()); final ResolvedFeatureId depId = depResolvedSpec.resolveFeatureId(userDep.getFeatureId().getParams()); final FeatureDependencySpec specDep = result.put(depId, userDep); if(specDep != null) {
private void resolveFeature(ConfigModelStack configStack, FeatureConfig fc) throws ProvisioningException { final FeaturePackRuntimeBuilder originalOrigin = currentOrigin; final ResolvedFeatureSpec spec = getFeatureSpec(fc.getSpecId().getName(), true); final ResolvedFeature originalParent = parentFeature; try { final ResolvedFeatureId resolvedId = parentFeature == null ? spec.resolveFeatureId(fc.getParams()) : spec.resolveIdFromForeignKey(parentFeature.id, fc.getParentRef(), fc.getParams()); if (configStack.isFilteredOut(spec.id, resolvedId)) { return; } parentFeature = resolveFeatureDepsAndRefs(configStack, spec, resolvedId, spec.resolveNonIdParams(parentFeature == null ? null : parentFeature.id, fc.getParentRef(), fc.getParams()), fc.getFeatureDeps()); if (fc.hasUnsetParams()) { parentFeature.unsetAllParams(fc.getUnsetParams(), true); } if (fc.hasResetParams()) { parentFeature.resetAllParams(fc.getResetParams()); } } finally { currentOrigin = originalOrigin; } processConfigItemContainer(fc); parentFeature = originalParent; }