use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.
the class ProvisioningManager method apply.
/**
* Apply provisioning plan to the currently provisioned installation
*
* @param plan provisioning plan
* @param options provisioning plugin options
* @throws ProvisioningException in case of a failure
*/
public void apply(ProvisioningPlan plan, Map<String, String> options) throws ProvisioningException {
ProvisioningConfig config = getProvisioningConfig();
if (config == null) {
config = ProvisioningConfig.builder().build();
}
try (ProvisioningLayout<FeaturePackRuntimeBuilder> layout = getLayoutFactory().newConfigLayout(config, ProvisioningRuntimeBuilder.FP_RT_FACTORY, false)) {
layout.apply(plan, options);
doProvision(layout, getFsDiff(), false);
}
}
use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.
the class ProvisioningManager method getUpdates.
/**
* Query for available updates and patches for specific producers.
* If no producer is passed as an argument, the method will return
* the update plan for only the feature-packs installed directly by the user.
*
* @param producers producers to include into the update plan
* @return update plan
* @throws ProvisioningException in case of a failure
*/
public ProvisioningPlan getUpdates(ProducerSpec... producers) throws ProvisioningException {
final ProvisioningConfig config = getProvisioningConfig();
ProvisioningPlan plan;
if (config == null) {
plan = ProvisioningPlan.builder();
} else {
try (ProvisioningLayout<?> layout = getLayoutFactory().newConfigLayout(config)) {
plan = layout.getUpdates(producers);
}
}
return plan;
}
use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.
the class ProvisioningManager method addUniverse.
/**
* Add named universe spec to the provisioning configuration
*
* @param name universe name
* @param universeSpec universe spec
* @throws ProvisioningException in case of an error
*/
public void addUniverse(String name, UniverseSpec universeSpec) throws ProvisioningException {
final ProvisioningConfig config = ProvisioningConfig.builder(getProvisioningConfig()).addUniverse(name, universeSpec).build();
try {
ProvisioningXmlWriter.getInstance().write(config, PathsUtils.getProvisioningXml(home));
} catch (Exception e) {
throw new ProvisioningException(Errors.writeFile(PathsUtils.getProvisioningXml(home)), e);
}
this.provisioningConfig = config;
}
use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.
the class ProvisioningManager method getUpdates.
/**
* Query for available updates and patches for feature-packs in this layout.
*
* @param includeTransitive whether to include transitive dependencies into the result
* @return available updates
* @throws ProvisioningException in case of a failure
*/
public ProvisioningPlan getUpdates(boolean includeTransitive) throws ProvisioningException {
final ProvisioningConfig config = getProvisioningConfig();
ProvisioningPlan plan;
if (config == null) {
plan = ProvisioningPlan.builder();
} else {
try (ProvisioningLayout<?> layout = getLayoutFactory().newConfigLayout(config)) {
plan = layout.getUpdates(includeTransitive);
}
}
return plan;
}
use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.
the class ProvisioningManager method removeUniverse.
/**
* Removes universe spec associated with the name from the provisioning configuration
* @param name name of the universe spec or null for the default universe spec
* @throws ProvisioningException in case of an error
*/
public void removeUniverse(String name) throws ProvisioningException {
ProvisioningConfig config = getProvisioningConfig();
if (config == null || !config.hasUniverse(name)) {
return;
}
config = ProvisioningConfig.builder(config).removeUniverse(name).build();
try {
ProvisioningXmlWriter.getInstance().write(config, PathsUtils.getProvisioningXml(home));
} catch (Exception e) {
throw new ProvisioningException(Errors.writeFile(PathsUtils.getProvisioningXml(home)), e);
}
this.provisioningConfig = config;
}
Aggregations