use of com.hazelcast.client.config.impl.YamlClientDomConfigProcessor in project hazelcast by hazelcast.
the class YamlClientConfigBuilder method parseAndBuildConfig.
private void parseAndBuildConfig(ClientConfig config) throws Exception {
YamlMapping yamlRootNode;
try {
yamlRootNode = ((YamlMapping) YamlLoader.load(in));
} catch (Exception ex) {
throw new InvalidConfigurationException("Invalid YAML configuration", ex);
}
YamlNode clientRoot = yamlRootNode.childAsMapping(ClientConfigSections.HAZELCAST_CLIENT.getName());
if (clientRoot == null) {
clientRoot = yamlRootNode;
}
YamlDomChecker.check(clientRoot);
Node w3cRootNode = asW3cNode(clientRoot);
replaceVariables(w3cRootNode);
importDocuments(clientRoot);
if (shouldValidateTheSchema()) {
new YamlConfigSchemaValidator().validate((YamlMapping) clientRoot.parent());
}
new YamlClientDomConfigProcessor(true, config).buildConfig(w3cRootNode);
}
use of com.hazelcast.client.config.impl.YamlClientDomConfigProcessor in project hazelcast by hazelcast.
the class ConfigNodeStateTrackerTest method shouldDetectUnappliedClientConfigEntries.
@Test
public void shouldDetectUnappliedClientConfigEntries() {
Map<String, String> entries = new HashMap<>();
entries.put("HZCLIENT_FOO", "foo");
entries.put("HZCLIENT_NETWORK_SOCKETINTERCEPTOR_ENABLE", "true");
entries.put("HZCLIENT_NETWORK_SMARTROUTING", "true");
ConfigNode configNode = PropertiesToNodeConverter.propsToNode(EnvVariablesConfigParser.client().parse(entries));
new YamlClientDomConfigProcessor(true, new ClientConfig(), false).buildConfig(new ConfigOverrideElementAdapter(configNode));
Map<String, String> unprocessed = new ConfigNodeStateTracker().unprocessedNodes(configNode);
assertTrue(unprocessed.containsKey("hazelcast-client.foo"));
assertTrue(unprocessed.containsKey("hazelcast-client.network.socketinterceptor.enable"));
assertFalse(unprocessed.containsKey("hazelcast-client.network.smartrouting"));
}
Aggregations