Search in sources :

Example 6 with ProvisionedConfig

use of org.jboss.galleon.state.ProvisionedConfig in project galleon by wildfly.

the class ProvisionedStateXmlWriter method toElement.

@Override
protected ElementNode toElement(FeaturePackSet<?> provisionedState) throws XMLStreamException {
    final ElementNode pkg = addElement(null, Element.INSTALLATION);
    if (provisionedState.hasFeaturePacks()) {
        for (FeaturePack<?> fp : provisionedState.getFeaturePacks()) {
            final ElementNode fpElement = addElement(pkg, Element.FEATURE_PACK);
            writeFeaturePack(fpElement, fp);
        }
    }
    if (provisionedState.hasConfigs()) {
        for (ProvisionedConfig config : provisionedState.getConfigs()) {
            pkg.addChild(ProvisionedConfigXmlWriter.getInstance().toElement(config, Element.CONFIG.getNamespace()));
        }
    }
    return pkg;
}
Also used : ElementNode(org.jboss.galleon.xml.util.ElementNode) ProvisionedConfig(org.jboss.galleon.state.ProvisionedConfig)

Example 7 with ProvisionedConfig

use of org.jboss.galleon.state.ProvisionedConfig in project galleon by wildfly.

the class PersistChangesTestBase method addConfigFiles.

private void addConfigFiles(DirBuilder builder) throws ProvisioningException {
    final ProvisionedConfig[] configs = provisionedConfigModels();
    if (configs == null || configs.length == 0) {
        return;
    }
    final StringBuilder buf = new StringBuilder();
    for (ProvisionedConfig config : configs) {
        buf.append(Constants.CONFIGS).append('/');
        if (config.getModel() != null) {
            buf.append(config.getModel()).append('/');
        }
        buf.append(config.getName());
        builder.addFile(buf.toString(), toXmlString(config));
        buf.setLength(0);
    }
}
Also used : ProvisionedConfig(org.jboss.galleon.state.ProvisionedConfig)

Aggregations

ProvisionedConfig (org.jboss.galleon.state.ProvisionedConfig)7 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 ProvisioningException (org.jboss.galleon.ProvisioningException)2 ConfigId (org.jboss.galleon.config.ConfigId)2 ProvisioningRuntime (org.jboss.galleon.runtime.ProvisioningRuntime)2 Path (java.nio.file.Path)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 ConfigInfo (org.jboss.galleon.cli.model.ConfigInfo)1 ConfigModel (org.jboss.galleon.config.ConfigModel)1 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)1 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)1 FeaturePackPluginVisitor (org.jboss.galleon.layout.FeaturePackPluginVisitor)1 CliPlugin (org.jboss.galleon.plugin.CliPlugin)1 ProvisionedConfigHandler (org.jboss.galleon.plugin.ProvisionedConfigHandler)1 FeaturePackRuntime (org.jboss.galleon.runtime.FeaturePackRuntime)1 PackageRuntime (org.jboss.galleon.runtime.PackageRuntime)1