private void handleDiscoveryStrategies(DiscoveryConfig discoveryConfig, Node node) { for (Node child : childElements(node)) { String name = cleanNodeName(child); if ("discovery-strategy".equals(name)) { handleDiscoveryStrategy(child, discoveryConfig); } else if ("node-filter".equals(name)) { handleDiscoveryNodeFilter(child, discoveryConfig); } } }
private void handleSecurityPermissionActions(Node node, PermissionConfig permConfig) { for (Node child : childElements(node)) { String nodeName = cleanNodeName(child); if ("action".equals(nodeName)) { permConfig.addAction(getTextContent(child).trim()); } } } }
private void handleSecurityPermissionEndpoints(Node node, PermissionConfig permConfig) { for (Node child : childElements(node)) { String nodeName = cleanNodeName(child); if ("endpoint".equals(nodeName)) { permConfig.addEndpoint(getTextContent(child).trim()); } } }
private void handleWanFilters(Node wanChild, WanReplicationRef wanReplicationRef) { for (Node filter : childElements(wanChild)) { if ("filter-impl".equals(cleanNodeName(filter))) { wanReplicationRef.addFilter(getTextContent(filter)); } } }
private void handleSecurityInterceptors(Node node) { SecurityConfig cfg = config.getSecurityConfig(); for (Node child : childElements(node)) { String nodeName = cleanNodeName(child); if ("interceptor".equals(nodeName)) { NamedNodeMap attrs = child.getAttributes(); Node classNameNode = attrs.getNamedItem("class-name"); String className = getTextContent(classNameNode); cfg.addSecurityInterceptorConfig(new SecurityInterceptorConfig(className)); } } }
private void mapAttributesHandle(Node n, MapConfig mapConfig) { for (Node extractorNode : childElements(n)) { if ("attribute".equals(cleanNodeName(extractorNode))) { NamedNodeMap attrs = extractorNode.getAttributes(); String extractor = getTextContent(attrs.getNamedItem("extractor")); String name = getTextContent(extractorNode); mapConfig.addMapAttributeConfig(new MapAttributeConfig(name, extractor)); } } }
private void handleCountDownLatchConfig(Node node) { Node attName = node.getAttributes().getNamedItem("name"); String name = getTextContent(attName); CountDownLatchConfig countDownLatchConfig = new CountDownLatchConfig(name); for (Node n : childElements(node)) { String nodeName = cleanNodeName(n); String value = getTextContent(n).trim(); if ("quorum-ref".equals(nodeName)) { countDownLatchConfig.setQuorumName(value); } } config.addCountDownLatchConfig(countDownLatchConfig); }
private void handleGroup(Node node) { for (Node n : childElements(node)) { String value = getTextContent(n).trim(); String nodeName = cleanNodeName(n); if ("name".equals(nodeName)) { config.getGroupConfig().setName(value); } else if ("password".equals(nodeName)) { config.getGroupConfig().setPassword(value); } } }
private void handleListeners(Node node) { for (Node child : childElements(node)) { if ("listener".equals(cleanNodeName(child))) { String listenerClass = getTextContent(child); config.addListenerConfig(new ListenerConfig(listenerClass)); } } }
private void queryCacheIndexesHandle(Node n, QueryCacheConfig queryCacheConfig) { for (Node indexNode : childElements(n)) { if ("index".equals(cleanNodeName(indexNode))) { NamedNodeMap attrs = indexNode.getAttributes(); boolean ordered = getBooleanValue(getTextContent(attrs.getNamedItem("ordered"))); String attribute = getTextContent(indexNode); queryCacheConfig.addIndexConfig(new MapIndexConfig(attribute, ordered)); } } }
private void mapPartitionLostListenerHandle(Node n, MapConfig mapConfig) { for (Node listenerNode : childElements(n)) { if ("partition-lost-listener".equals(cleanNodeName(listenerNode))) { String listenerClass = getTextContent(listenerNode); mapConfig.addMapPartitionLostListenerConfig(new MapPartitionLostListenerConfig(listenerClass)); } } }
private void handleOutboundPorts(Node child) { NetworkConfig networkConfig = config.getNetworkConfig(); for (Node n : childElements(child)) { String nodeName = cleanNodeName(n); if ("ports".equals(nodeName)) { String value = getTextContent(n); networkConfig.addOutboundPortDefinition(value); } } }
private void cachePartitionLostListenerHandle(Node n, CacheSimpleConfig cacheConfig) { for (Node listenerNode : childElements(n)) { if ("partition-lost-listener".equals(cleanNodeName(listenerNode))) { String listenerClass = getTextContent(listenerNode); cacheConfig.addCachePartitionLostListenerConfig( new CachePartitionLostListenerConfig(listenerClass)); } } }
private void mapIndexesHandle(Node n, MapConfig mapConfig) { for (Node indexNode : childElements(n)) { if ("index".equals(cleanNodeName(indexNode))) { NamedNodeMap attrs = indexNode.getAttributes(); boolean ordered = getBooleanValue(getTextContent(attrs.getNamedItem("ordered"))); String attribute = getTextContent(indexNode); mapConfig.addMapIndexConfig(new MapIndexConfig(attribute, ordered)); } } }
private void handleWanConsumerConfig(WanConsumerConfig consumerConfig, Node targetChild) { String targetChildName = cleanNodeName(targetChild); if ("class-name".equals(targetChildName)) { consumerConfig.setClassName(getTextContent(targetChild)); } else if ("properties".equals(targetChildName)) { fillProperties(targetChild, consumerConfig.getProperties()); } else if ("persist-wan-replicated-data".equals(targetChildName)) { consumerConfig.setPersistWanReplicatedData(getBooleanValue(getTextContent(targetChild))); } }
private void mapEntryListenerHandle(Node n, MapConfig mapConfig) { for (Node listenerNode : childElements(n)) { if ("entry-listener".equals(cleanNodeName(listenerNode))) { NamedNodeMap attrs = listenerNode.getAttributes(); boolean incValue = getBooleanValue(getTextContent(attrs.getNamedItem("include-value"))); boolean local = getBooleanValue(getTextContent(attrs.getNamedItem("local"))); String listenerClass = getTextContent(listenerNode); mapConfig.addEntryListenerConfig(new EntryListenerConfig(listenerClass, local, incValue)); } } }
private void handleMemberList(Node node) { JoinConfig join = config.getNetworkConfig().getJoin(); TcpIpConfig tcpIpConfig = join.getTcpIpConfig(); for (Node n : childElements(node)) { String nodeName = cleanNodeName(n); if ("member".equals(nodeName)) { String value = getTextContent(n).trim(); tcpIpConfig.addMember(value); } } }
private void handleWanSync(WanSyncConfig wanSyncConfig, Node node) { for (Node child : childElements(node)) { String nodeName = cleanNodeName(child); if ("consistency-check-strategy".equals(nodeName)) { String strategy = getTextContent(child); wanSyncConfig.setConsistencyCheckStrategy( ConsistencyCheckStrategy.valueOf(upperCaseInternal(strategy))); } } }
private HotRestartConfig createHotRestartConfig(Node node) { HotRestartConfig hotRestartConfig = new HotRestartConfig(); Node attrEnabled = node.getAttributes().getNamedItem("enabled"); boolean enabled = getBooleanValue(getTextContent(attrEnabled)); hotRestartConfig.setEnabled(enabled); for (Node n : childElements(node)) { String name = cleanNodeName(n); if ("fsync".equals(name)) { hotRestartConfig.setFsync(getBooleanValue(getTextContent(n))); } } return hotRestartConfig; }
private void handleMemberGroup(Node node) { MemberGroupConfig memberGroupConfig = new MemberGroupConfig(); for (Node child : childElements(node)) { if ("interface".equals(cleanNodeName(child))) { String value = getTextContent(child); memberGroupConfig.addInterface(value); } } config.getPartitionGroupConfig().addMemberGroupConfig(memberGroupConfig); }