public ProvisionedConfigBuilder setProperty(String name, String value) { props = CollectionUtils.put(props, name, value); return this; }
public Builder setProperty(String name, String value) { props = CollectionUtils.put(props, name, value); return this; }
public FeaturePackInstaller setPluginOption(String option, String value) { pluginOptions = CollectionUtils.put(pluginOptions, option, value); return this; }
public FeaturePackInstaller setPluginOption(String option, String value) { pluginOptions = CollectionUtils.put(pluginOptions, option, value); return this; }
public Builder addOption(String name, String value) { options = CollectionUtils.put(options, name, value); return this; }
public ExtendedContentHandlerFactory addContentHandler(String formatName, Class<? extends FormatContentHandler> cls) { chTypes = CollectionUtils.put(chTypes, formatName, cls); return this; }
@SuppressWarnings("unchecked") public B addUniverse(String name, UniverseSpec universe) throws ProvisioningDescriptionException { if(name == null) { defaultUniverse = universe; return (B) this; } universeSpecs = CollectionUtils.put(universeSpecs, name, universe); return (B) this; }
/** * Sets the parameter's configuration value * * @param name configuration parameter name * @param value configuration parameter value * @return this builder */ public ProvisionedFeatureBuilder setConfigParam(String name, String value) { configParams = CollectionUtils.put(configParams, name, value); return this; }
@SuppressWarnings("unchecked") public B excludeConfigModel(String model, boolean namedConfigsOnly) throws ProvisioningDescriptionException { if(includedModels.contains(model)) { throw new ProvisioningDescriptionException("Model " + model + " has been included"); } excludedModels = CollectionUtils.put(excludedModels, model, namedConfigsOnly); return (B) this; }
@Override public LegacyGalleon1Channel getChannel(String name) throws ProvisioningException { LegacyGalleon1Channel channel = channels.get(name); if(channel == null) { channel = new LegacyGalleon1Channel(universe, name); channels = CollectionUtils.put(channels, name, channel); } return channel; }
public Builder addPackage(PackageSpec pkg) { packages = CollectionUtils.put(packages, pkg.getName(), pkg); return this; }
@Override public LegacyGalleon1Producer getProducer(String producerName) throws ProvisioningException { LegacyGalleon1Producer producer = producers.get(producerName); if(producer == null) { producer = new LegacyGalleon1Producer(this, producerName); producers = CollectionUtils.put(producers, producerName, producer); } return producer; }
@SuppressWarnings("unchecked") public B excludeFeature(FeatureId featureId, String parentRef) throws ProvisioningDescriptionException { if(includedFeatures.containsKey(featureId)) { throw new ProvisioningDescriptionException(featureId + " has been explicitly included"); } excludedFeatures = CollectionUtils.put(excludedFeatures, featureId, parentRef); return (B) this; }
public String putParam(String name, String value) { final String prevValue = params.get(name); params = CollectionUtils.put(params, name, value); if(!unsetParams.isEmpty()) { unsetParams = CollectionUtils.remove(unsetParams, name); } if(!resetParams.isEmpty()) { resetParams = CollectionUtils.remove(resetParams, name); } return prevValue; }
private CapabilityProviders getProviders(String cap, boolean add) throws ProvisioningException { CapabilityProviders providers = capProviders.get(cap); if(providers != null) { return providers; } if(!add) { throw new ProvisioningException(Errors.noCapabilityProvider(cap)); } providers = new CapabilityProviders(); capProviders = CollectionUtils.put(capProviders, cap, providers); return providers; }
private CapabilityProviders getProviders(String cap, boolean add) throws ProvisioningException { CapabilityProviders providers = capProviders.get(cap); if(providers != null) { return providers; } if(!add) { throw new ProvisioningException(Errors.noCapabilityProvider(cap)); } providers = new CapabilityProviders(); capProviders = CollectionUtils.put(capProviders, cap, providers); return providers; }
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; }
private Builder includePackage(PackageConfig packageConfig) throws ProvisioningDescriptionException { if(excludedPackages.contains(packageConfig.getName())) { throw new ProvisioningDescriptionException(Errors.packageExcludeInclude(packageConfig.getName())); } includedPackages = CollectionUtils.put(includedPackages, packageConfig.getName(), packageConfig); return this; }
void addFpConfig(FeaturePackConfig fpConfig) { fpConfigs = CollectionUtils.add(fpConfigs, fpConfig); if(fpConfig.isTransitive()) { transitive = CollectionUtils.put(transitive, fpConfig.getLocation().getProducer(), fpConfig); } }
private ConfigModelStack resolveConfigLayer(ConfigId layerId) throws ProvisioningException { ConfigModelStack layerStack = layers.get(layerId); if(layerStack == null) { layerStack = new ConfigModelStack(layerId, this); for (FeaturePackConfig fpConfig : config.getFeaturePackDeps()) { resolveConfigLayer(layout.getFeaturePack(fpConfig.getLocation().getProducer()), layerStack, layerId); } layers = CollectionUtils.put(layers, layerId, layerStack); } return layerStack; }