Search in sources :

Example 6 with ConfigId

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

the class TestConfigsPersistingPlugin method postInstall.

@Override
public void postInstall(ProvisioningRuntime runtime) throws ProvisioningException {
    final Path configsDir = runtime.getStagedDir().resolve(Constants.CONFIGS);
    for (ProvisionedConfig config : runtime.getConfigs()) {
        Path configPath = configsDir;
        if (config.getModel() != null) {
            configPath = configPath.resolve(config.getModel());
        }
        configPath = configPath.resolve(config.getName());
        try {
            ProvisionedConfigXmlWriter.getInstance().write(config, configPath);
        } catch (Exception e) {
            throw new ProvisioningException("Failed to persist config " + new ConfigId(config.getModel(), config.getName()), e);
        }
    }
}
Also used : Path(java.nio.file.Path) ProvisioningException(org.jboss.galleon.ProvisioningException) ConfigId(org.jboss.galleon.config.ConfigId) ProvisionedConfig(org.jboss.galleon.state.ProvisionedConfig) ProvisioningException(org.jboss.galleon.ProvisioningException)

Example 7 with ConfigId

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

the class State method excludeLayersConfiguration.

public void excludeLayersConfiguration(PmSession pmSession, ConfigInfo configuration, String[] layers) throws ProvisioningException, IOException {
    ConfigId id = new ConfigId(configuration.getModel(), configuration.getName());
    Action action = configProvisioning.excludeLayersConfiguration(id, layers, this);
    config = pushState(action, pmSession);
}
Also used : ConfigId(org.jboss.galleon.config.ConfigId)

Example 8 with ConfigId

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

the class State method removeFeature.

public void removeFeature(PmSession pmSession, ConfigInfo ci, FeatureInfo fi) throws ProvisioningException, IOException {
    ConfigId id = new ConfigId(ci.getModel(), ci.getName());
    Action action = configProvisioning.removeFeature(id, fi);
    config = pushState(action, pmSession);
}
Also used : ConfigId(org.jboss.galleon.config.ConfigId)

Example 9 with ConfigId

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

the class State method removeIncludedLayersConfiguration.

public void removeIncludedLayersConfiguration(PmSession pmSession, ConfigInfo configuration, String[] layers) throws ProvisioningException, IOException {
    ConfigId id = new ConfigId(configuration.getModel(), configuration.getName());
    Action action = configProvisioning.removeIncludedLayersConfiguration(id, layers);
    config = pushState(action, pmSession);
}
Also used : ConfigId(org.jboss.galleon.config.ConfigId)

Example 10 with ConfigId

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

the class State method includeLayersConfiguration.

public void includeLayersConfiguration(PmSession pmSession, ConfigInfo configuration, String[] layers) throws ProvisioningException, IOException {
    ConfigId id = new ConfigId(configuration.getModel(), configuration.getName());
    Action action = configProvisioning.includeLayersConfiguration(id, layers, this);
    config = pushState(action, pmSession);
}
Also used : ConfigId(org.jboss.galleon.config.ConfigId)

Aggregations

ConfigId (org.jboss.galleon.config.ConfigId)39 ConfigModel (org.jboss.galleon.config.ConfigModel)12 Path (java.nio.file.Path)11 Map (java.util.Map)10 ProvisioningException (org.jboss.galleon.ProvisioningException)9 IOException (java.io.IOException)7 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)6 HashMap (java.util.HashMap)5 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)5 ArrayList (java.util.ArrayList)4 LinkedHashMap (java.util.LinkedHashMap)4 XMLStreamException (javax.xml.stream.XMLStreamException)4 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)4 Test (org.junit.Test)4 HashSet (java.util.HashSet)3 Set (java.util.Set)3 ProvisioningDescriptionException (org.jboss.galleon.ProvisioningDescriptionException)3 ElementNode (org.jboss.galleon.xml.util.ElementNode)3 BufferedWriter (java.io.BufferedWriter)2 FileVisitResult (java.nio.file.FileVisitResult)2