<commit_before>package org.wildfly.swarm.clustering.runtime;

import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ValueExpression;
import org.wildfly.swarm.clustering.*;
import org.wildfly.swarm.container.runtime.AbstractServerConfiguration;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;

/**
 * @author <NAME>
 */
public class ClusteringConfiguration extends AbstractServerConfiguration<ClusteringFraction> {

    public ClusteringConfiguration() {
        super(ClusteringFraction.class);
    }

    @Override
    public ClusteringFraction defaultFraction() {
        return new ClusteringFraction()
                .defaultChannel(new Channel("ee"))
                .defaultStack(Stack.defaultUDPStack());
    }

    @Override
    public List<ModelNode> getList(ClusteringFraction fraction) {
        List<ModelNode> list = new ArrayList<>();

        ModelNode node = new ModelNode();
        node.get(OP_ADDR).set(EXTENSION, "org.jboss.as.clustering.jgroups");
        node.get(OP).set(ADD);
        list.add(node);

        PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, "jgroups"));

        node = new ModelNode();
        node.get(OP_ADDR).set(address.toModelNode());
        node.get(OP).set(ADD);
        if (fraction.defaultChannel() != null) {
            node.get("default-channel").set(fraction.defaultChannel().name());
        }
        if (fraction.defaultStack() != null) {
            node.get("default-stack").set(fraction.defaultStack().name());
        }<commit_msg>Pick a better name for the default clustering channel.<commit_after>package org.wildfly.swarm.clustering.runtime;

import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ValueExpression;
import org.wildfly.swarm.clustering.*;
import org.wildfly.swarm.container.runtime.AbstractServerConfiguration;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;

/**
 * @author <NAME>
 */
public class ClusteringConfiguration extends AbstractServerConfiguration<ClusteringFraction> {

    public ClusteringConfiguration() {
        super(ClusteringFraction.class);
    }

    @Override
    public ClusteringFraction defaultFraction() {
        return new ClusteringFraction()
                .defaultChannel(new Channel("swarm-clustering"))
                .defaultStack(Stack.defaultUDPStack());
    }

    @Override
    public List<ModelNode> getList(ClusteringFraction fraction) {
        List<ModelNode> list = new ArrayList<>();

        ModelNode node = new ModelNode();
        node.get(OP_ADDR).set(EXTENSION, "org.jboss.as.clustering.jgroups");
        node.get(OP).set(ADD);
        list.add(node);

        PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, "jgroups"));

        node = new ModelNode();
        node.get(OP_ADDR).set(address.toModelNode());
        node.get(OP).set(ADD);
        if (fraction.defaultChannel() != null) {
            node.get("default-channel").set(fraction.defaultChannel().name());
        }
        if (fraction.defaultStack() != null) {
            node.get("default-stack").set(fraction.defaultStack().name());
        }
{'fraction_non_alphanumeric': 0.12696597083214184, 'fraction_numerical': 0.0, 'mean_word_length': 3.490372272143774, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3639086', 'n_tokens_mistral': 1045, 'n_tokens_neox': 981, 'n_words': 162}