Search in sources :

Example 6 with ConfigInfo

use of org.jboss.galleon.cli.model.ConfigInfo in project galleon by wildfly.

the class AbstractLayersCommand method getConfiguration.

protected ConfigInfo getConfiguration(State state) throws PathParserException, PathConsumerException, ProvisioningException, Exception {
    String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
    FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(state.getContainer(), false);
    PathParser.parse(path, consumer);
    ConfigInfo ci = consumer.getConfig();
    if (ci == null) {
        throw new ProvisioningException("Not a valid config " + configuration);
    }
    return ci;
}
Also used : FeatureContainerPathConsumer(org.jboss.galleon.cli.path.FeatureContainerPathConsumer) ProvisioningException(org.jboss.galleon.ProvisioningException) ConfigInfo(org.jboss.galleon.cli.model.ConfigInfo)

Example 7 with ConfigInfo

use of org.jboss.galleon.cli.model.ConfigInfo in project galleon by wildfly.

the class ConfigurationUtil method getConfig.

private static ConfigInfo getConfig(PmSession session, FPID fpid, String configuration) throws ProvisioningException, IOException, PathParserException, PathConsumerException {
    String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
    FeatureContainer full = FeatureContainers.fromFeaturePackId(session, fpid, null);
    ConfigInfo ci = null;
    try {
        FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(full, false);
        PathParser.parse(path, consumer);
        ci = consumer.getConfig();
    } catch (PathParserException | PathConsumerException ex) {
    // XXX OK, return null
    }
    return ci;
}
Also used : FeatureContainerPathConsumer(org.jboss.galleon.cli.path.FeatureContainerPathConsumer) FeatureContainer(org.jboss.galleon.cli.model.FeatureContainer) PathParserException(org.jboss.galleon.cli.path.PathParserException) ConfigInfo(org.jboss.galleon.cli.model.ConfigInfo) PathConsumerException(org.jboss.galleon.cli.path.PathConsumerException)

Example 8 with ConfigInfo

use of org.jboss.galleon.cli.model.ConfigInfo in project galleon by wildfly.

the class StateResetConfigCommand method getConfiguration.

protected ConfigInfo getConfiguration(State state) throws PathParserException, PathConsumerException, ProvisioningException, Exception {
    String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
    FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(state.getContainer(), false);
    PathParser.parse(path, consumer);
    ConfigInfo ci = consumer.getConfig();
    if (ci == null) {
        throw new ProvisioningException("Not a valid config " + configuration);
    }
    return ci;
}
Also used : FeatureContainerPathConsumer(org.jboss.galleon.cli.path.FeatureContainerPathConsumer) ProvisioningException(org.jboss.galleon.ProvisioningException) ConfigInfo(org.jboss.galleon.cli.model.ConfigInfo)

Aggregations

ConfigInfo (org.jboss.galleon.cli.model.ConfigInfo)8 FeatureContainerPathConsumer (org.jboss.galleon.cli.path.FeatureContainerPathConsumer)5 ProvisioningException (org.jboss.galleon.ProvisioningException)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 HashMap (java.util.HashMap)2 IOException (java.io.IOException)1 Map (java.util.Map)1 Set (java.util.Set)1 CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)1 Table (org.jboss.galleon.cli.cmd.Table)1 FeatureContainer (org.jboss.galleon.cli.model.FeatureContainer)1 FeatureInfo (org.jboss.galleon.cli.model.FeatureInfo)1 Group (org.jboss.galleon.cli.model.Group)1 PathConsumerException (org.jboss.galleon.cli.path.PathConsumerException)1 PathParserException (org.jboss.galleon.cli.path.PathParserException)1 ConfigId (org.jboss.galleon.config.ConfigId)1 ConfigModel (org.jboss.galleon.config.ConfigModel)1 ProvisioningRuntime (org.jboss.galleon.runtime.ProvisioningRuntime)1 ProvisionedConfig (org.jboss.galleon.state.ProvisionedConfig)1