Search in sources :

Example 1 with YamlClientFailoverDomConfigProcessor

use of com.hazelcast.client.config.impl.YamlClientFailoverDomConfigProcessor in project hazelcast by hazelcast.

the class YamlClientFailoverConfigBuilder method parseAndBuildConfig.

private void parseAndBuildConfig(ClientFailoverConfig config) throws Exception {
    YamlMapping yamlRootNode;
    try {
        yamlRootNode = ((YamlMapping) YamlLoader.load(in));
    } catch (Exception ex) {
        throw new InvalidConfigurationException("Invalid YAML configuration", ex);
    }
    String configRoot = getConfigRoot();
    YamlNode clientFailoverRoot = yamlRootNode.childAsMapping(configRoot);
    if (clientFailoverRoot == null) {
        clientFailoverRoot = yamlRootNode;
    }
    YamlDomChecker.check(clientFailoverRoot);
    Node w3cRootNode = asW3cNode(clientFailoverRoot);
    replaceVariables(w3cRootNode);
    importDocuments(clientFailoverRoot);
    if (shouldValidateTheSchema()) {
        new YamlConfigSchemaValidator().validate(yamlRootNode);
    }
    new YamlClientFailoverDomConfigProcessor(true, config).buildConfig(w3cRootNode);
}
Also used : YamlConfigSchemaValidator(com.hazelcast.internal.config.YamlConfigSchemaValidator) YamlNode(com.hazelcast.internal.yaml.YamlNode) W3cDomUtil.asW3cNode(com.hazelcast.internal.config.yaml.W3cDomUtil.asW3cNode) Node(org.w3c.dom.Node) YamlNode(com.hazelcast.internal.yaml.YamlNode) YamlClientFailoverDomConfigProcessor(com.hazelcast.client.config.impl.YamlClientFailoverDomConfigProcessor) YamlMapping(com.hazelcast.internal.yaml.YamlMapping) InvalidConfigurationException(com.hazelcast.config.InvalidConfigurationException) HazelcastException(com.hazelcast.core.HazelcastException) IOException(java.io.IOException) InvalidConfigurationException(com.hazelcast.config.InvalidConfigurationException)

Aggregations

YamlClientFailoverDomConfigProcessor (com.hazelcast.client.config.impl.YamlClientFailoverDomConfigProcessor)1 InvalidConfigurationException (com.hazelcast.config.InvalidConfigurationException)1 HazelcastException (com.hazelcast.core.HazelcastException)1 YamlConfigSchemaValidator (com.hazelcast.internal.config.YamlConfigSchemaValidator)1 W3cDomUtil.asW3cNode (com.hazelcast.internal.config.yaml.W3cDomUtil.asW3cNode)1 YamlMapping (com.hazelcast.internal.yaml.YamlMapping)1 YamlNode (com.hazelcast.internal.yaml.YamlNode)1 IOException (java.io.IOException)1 Node (org.w3c.dom.Node)1