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;
}
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);
}
}
Aggregations