void pushConfig(ConfigModel model) throws ProvisioningException { lastConfig = new ConfigScope(model); configs.add(lastConfig); }
ConfigModel popConfig() throws ProvisioningException { lastProcessedScope = lastConfig; final int poppedIndex = configs.size() - 1; configs.remove(poppedIndex); lastConfig = configs.get(poppedIndex - 1); lastProcessedScope.complete(); return lastProcessedScope.config; }
SpecFeatures specFeatures = null; for (ResolvedFeature feature : otherSpecFeatures.getFeatures()) { if(lastProcessedScope.isFilteredOut(feature.getSpecId(), feature.id)) { continue;
boolean isLayerExcluded(String layerName) { if(lastConfig.isLayerExcluded(layerName)) { return true; } if(configs.size() > 1) { for (int i = configs.size() - 2; i >= 0; --i) { if (configs.get(i).isLayerExcluded(layerName)) { return true; } } } return false; }
void popGroup() throws ProvisioningException { mergeFgScope(); lastConfig.pop(); }
boolean pushGroup(FeatureGroupSupport fg) throws ProvisioningException { if(!lastConfig.push(fg)) { return false; } newFgScope(); return true; }
boolean isLayerFilteredOut(String layerName) { if(lastConfig.isLayerFilteredOut(layerName)) { return true; } if(configs.size() > 1) { for (int i = configs.size() - 2; i >= 0; --i) { if (configs.get(i).isLayerFilteredOut(layerName)) { return true; } } } return false; }
boolean push(FeatureGroupSupport fg) throws ProvisioningException { final ResolvedFeatureGroupConfig resolvedFg = rt.resolveFeatureGroupConfig(ConfigModelStack.this, fg); if (!fg.isConfig() && !ConfigModelStack.this.isRelevant(resolvedFg)) { return false; } groupStack.add(resolvedFg); return true; }
boolean isFilteredOut(ResolvedSpecId specId, final ResolvedFeatureId id) { if(lastConfig.isFilteredOut(specId, id)) { return true; } if(configs.size() > 1) { for (int i = configs.size() - 2; i >= 0; --i) { if (configs.get(i).isFilteredOut(specId, id)) { return true; } } } return false; }
ConfigModelStack(ConfigId configId, ProvisioningRuntimeBuilder rt) throws ProvisioningException { this.id = configId; this.rt = rt; lastConfig = new ConfigScope(null); configs.add(lastConfig); newFgScope(); }
ConfigScope(ConfigModel config) throws ProvisioningException { this.config = config; if(config != null) { pushedFgScope = push(config); if(pushedFgScope) { newFgScope(); } } else { pushedFgScope = false; } }