Search in sources :

Example 46 with ProvisioningConfig

use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.

the class ProvisioningManager method uninstall.

/**
 * Uninstalls the specified feature-pack.
 *
 * @param fpid  feature-pack ID
 * @param pluginOptions  provisioning plugin options
 * @throws ProvisioningException  in case of a failure
 */
public void uninstall(FeaturePackLocation.FPID fpid, Map<String, String> pluginOptions) throws ProvisioningException {
    ProvisioningConfig config = getProvisioningConfig();
    if (config == null || !config.hasFeaturePackDeps()) {
        throw new ProvisioningException(Errors.unknownFeaturePack(fpid));
    }
    try (ProvisioningLayout<FeaturePackRuntimeBuilder> layout = getLayoutFactory().newConfigLayout(config, ProvisioningRuntimeBuilder.FP_RT_FACTORY, false)) {
        layout.uninstall(resolveUniverseSpec(fpid.getLocation()).getFPID(), pluginOptions);
        doProvision(layout, getFsDiff(), false);
    }
}
Also used : ProvisioningConfig(org.jboss.galleon.config.ProvisioningConfig) FeaturePackRuntimeBuilder(org.jboss.galleon.runtime.FeaturePackRuntimeBuilder)

Example 47 with ProvisioningConfig

use of org.jboss.galleon.config.ProvisioningConfig in project galleon by wildfly.

the class State method popState.

private ProvisioningConfig popState(Action action, PmSession pmSession) throws IOException, ProvisioningException {
    action.undoAction(builder);
    try {
        ProvisioningConfig newConfig = buildNewConfig(pmSession);
        stack.remove();
        return newConfig;
    } catch (IOException | ProvisioningException ex) {
        action.doAction(config, builder);
        throw ex;
    }
}
Also used : ProvisioningConfig(org.jboss.galleon.config.ProvisioningConfig) ProvisioningException(org.jboss.galleon.ProvisioningException) IOException(java.io.IOException)

Aggregations

ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)47 Test (org.junit.Test)16 Path (java.nio.file.Path)15 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)12 ProvisioningException (org.jboss.galleon.ProvisioningException)10 IOException (java.io.IOException)8 ArrayList (java.util.ArrayList)6 ProvisioningManager (org.jboss.galleon.ProvisioningManager)6 CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)6 ConfigId (org.jboss.galleon.config.ConfigId)6 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)6 CommandException (org.aesh.command.CommandException)5 ConfigModel (org.jboss.galleon.config.ConfigModel)5 HashMap (java.util.HashMap)4 FeaturePackLayout (org.jboss.galleon.layout.FeaturePackLayout)4 FeaturePackRuntimeBuilder (org.jboss.galleon.runtime.FeaturePackRuntimeBuilder)4 ProvisioningRuntime (org.jboss.galleon.runtime.ProvisioningRuntime)4 FPID (org.jboss.galleon.universe.FeaturePackLocation.FPID)4 UniverseSpec (org.jboss.galleon.universe.UniverseSpec)4 HashSet (java.util.HashSet)3