public B updateFeaturePackDep(FeaturePackLocation fpl) throws ProvisioningDescriptionException { return addFeaturePackDepResolved(null, FeaturePackConfig.forLocation(resolveUniverseSpec(fpl)), true); }
public B addFeaturePackDep(FeaturePackLocation fpl) throws ProvisioningDescriptionException { return addFeaturePackDepResolved(null, FeaturePackConfig.forLocation(resolveUniverseSpec(fpl)), false); }
public B addTransitiveDep(FeaturePackLocation fpl) throws ProvisioningDescriptionException { return addFeaturePackDepResolved(null, FeaturePackConfig.forTransitiveDep(resolveUniverseSpec(fpl)), false); }
public B updateTransitiveDep(FeaturePackLocation fpl) throws ProvisioningDescriptionException { return addFeaturePackDepResolved(null, FeaturePackConfig.forTransitiveDep(resolveUniverseSpec(fpl)), true); }
@SuppressWarnings("unchecked") public B removeTransitiveDep(FPID fpid) throws ProvisioningException { final FeaturePackLocation fpl = resolveUniverseSpec(fpid.getLocation()); final ProducerSpec producer = fpl.getProducer(); final FeaturePackConfig fpDep = transitiveDeps.get(producer); if(fpDep == null) { throw new ProvisioningException(Errors.unknownFeaturePack(fpid)); } if(!fpDep.getLocation().equals(fpl)) { throw new ProvisioningException(Errors.unknownFeaturePack(fpid)); } if(transitiveDeps.size() == 1) { transitiveDeps = Collections.emptyMap(); return (B) this; } else { transitiveDeps = CollectionUtils.remove(transitiveDeps, producer); } updateOriginMappings(producer); return (B) this; }
public int getFeaturePackDepIndex(FeaturePackLocation fpl) throws ProvisioningException { fpl = resolveUniverseSpec(fpl); final ProducerSpec producer = fpl.getProducer(); final FeaturePackConfig fpDep = fpDeps.get(producer); if (fpDep == null) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } if (!fpDep.getLocation().equals(fpl)) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } int i = 0; for (ProducerSpec depProducer : fpDeps.keySet()) { if (depProducer.equals(producer)) { break; } i += 1; } return i; }
@SuppressWarnings("unchecked") public B removeFeaturePackDep(FeaturePackLocation fpl) throws ProvisioningException { fpl = resolveUniverseSpec(fpl); final ProducerSpec producer = fpl.getProducer(); final FeaturePackConfig fpDep = fpDeps.get(producer); if(fpDep == null) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } if(!fpDep.getLocation().getFPID().equals(fpl.getFPID())) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } if(fpDeps.size() == 1) { fpDeps = Collections.emptyMap(); } else { fpDeps = CollectionUtils.remove(fpDeps, producer); } updateOriginMappings(producer); return (B) this; }