@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ProvisioningConfig other = (ProvisioningConfig) obj; if (options == null) { if (other.options != null) return false; } else if (!options.equals(other.options)) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((options == null) ? 0 : options.hashCode()); return result; }
private void layout(FeaturePackDepsConfig config, Map<ProducerSpec, FPID> branch, int type) throws ProvisioningException { if(!config.hasFeaturePackDeps()) { return; if(config.hasTransitiveDeps()) { if(transitiveDeps == null) { transitiveDeps = new HashSet<>(); for(FeaturePackConfig transitiveConfig : config.getTransitiveDeps()) { final FeaturePackLocation fpl = transitiveConfig.getLocation(); transitiveDeps.add(fpl.getProducer()); final Collection<FeaturePackConfig> fpDeps = config.getFeaturePackDeps(); List<F> queue = new ArrayList<>(fpDeps.size()); for(FeaturePackConfig fpConfig : fpDeps) {
static void writeUniverseSpecs(FeaturePackDepsConfig fpDeps, final ElementNode parent) { ElementNode universesEl = null; UniverseSpec universeSpec = fpDeps.getDefaultUniverse(); if(universeSpec != null) { universesEl = addElement(parent, Element.UNIVERSES.getLocalName(), parent.getNamespace()); writeUniverseConfig(universesEl, null, universeSpec.getFactory(), universeSpec.getLocation()); } if(fpDeps.hasUniverseNamedSpecs()) { if(universesEl == null) { universesEl = addElement(parent, Element.UNIVERSES.getLocalName(), parent.getNamespace()); } for(Map.Entry<String, UniverseSpec> universe : fpDeps.getUniverseNamedSpecs().entrySet()) { writeUniverseConfig(universesEl, universe.getKey(), universe.getValue().getFactory(), universe.getValue().getLocation()); } } }
private boolean resolvePackage(FeaturePackRuntimeBuilder origin, String name, PackageRuntime.Builder parent, int type) throws ProvisioningException { final FeaturePackDepsConfig fpDeps; if (origin != null) { if(origin.resolvePackage(name, this, parent, type)) { return true; } fpDeps = origin.getSpec(); } else { fpDeps = config; } if (!fpDeps.hasFeaturePackDeps()) { return false; } for (FeaturePackConfig fpDep : fpDeps.getFeaturePackDeps()) { final FeaturePackRuntimeBuilder fpDepBuilder = layout.getFeaturePack(fpDep.getLocation().getProducer()); if (setVisited(fpDepBuilder) && resolvePackage(fpDepBuilder, name, parent, type)) { return true; } } return false; }
private FeatureGroup getFeatureGroupSpec(FeaturePackRuntimeBuilder origin, String name) throws ProvisioningException { final FeaturePackDepsConfig fpDeps; if(origin != null) { if(origin.isVisited()) { return null; } final FeatureGroup fg = origin.getFeatureGroupSpec(name); if(fg != null) { currentOrigin = origin; return fg; } fpDeps = origin.getSpec(); setVisited(origin); } else { fpDeps = config; } if (!fpDeps.hasFeaturePackDeps()) { return null; } for (FeaturePackConfig fpDep : fpDeps.getFeaturePackDeps()) { final FeatureGroup fg = getFeatureGroupSpec(layout.getFeaturePack(fpDep.getLocation().getProducer()), name); if (fg != null) { return fg; } } return null; }
private ResolvedFeatureSpec findFeatureSpec(FeaturePackRuntimeBuilder origin, String name, boolean switchOrigin) throws ProvisioningException { final FeaturePackDepsConfig fpDeps; if (origin != null) { if(origin.isVisited()) { return null; } final ResolvedFeatureSpec fs = origin.getFeatureSpec(name); if (fs != null) { if (switchOrigin) { currentOrigin = origin; } return fs; } fpDeps = origin.getSpec(); setVisited(origin); } else { fpDeps = config; } if (!fpDeps.hasFeaturePackDeps()) { return null; } for (FeaturePackConfig fpDep : fpDeps.getFeaturePackDeps()) { final ResolvedFeatureSpec fs = findFeatureSpec(layout.getFeaturePack(fpDep.getLocation().getProducer()), name, switchOrigin); if (fs != null) { return fs; } } return null; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((defPackages == null) ? 0 : defPackages.hashCode()); result = prime * result + ((fpid == null) ? 0 : fpid.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; FeaturePackSpec other = (FeaturePackSpec) obj; if (defPackages == null) { if (other.defPackages != null) return false; } else if (!defPackages.equals(other.defPackages)) return false; if (fpid == null) { if (other.fpid != null) return false; } else if (!fpid.equals(other.fpid)) return false; return true; }