All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.despegar.jdbc.galera.settings.ClientSettings Maven / Gradle / Ivy

Go to download

A simple Java client for MariaDB Galera Cluster and Percona XtraDB Cluster. It is designed to be an alternative to connect JVM app to MariaDB/Percona galera nodes without HAProxy

There is a newer version: 1.0.20
Show newest version
package com.despegar.jdbc.galera.settings;

import com.despegar.jdbc.galera.listener.GaleraClientListener;
import com.despegar.jdbc.galera.policies.ElectionNodePolicy;
import com.google.common.base.MoreObjects;

import java.util.List;

public class ClientSettings {
    public final List seeds;
    public final int retriesToGetConnection;
    public final GaleraClientListener galeraClientListener;
    public final ElectionNodePolicy defaultNodeSelectionPolicy;

    /**
     * Onyl enabled this feature for test purpouses. It disables discovery capabilities and checks for status nodes too.
     */
    public final boolean testMode;

    public ClientSettings(List seeds, int retriesToGetConnection, GaleraClientListener galeraClientListener,
                          ElectionNodePolicy defaultNodeSelectionPolicy, boolean testMode) {
        this.seeds = seeds;
        this.retriesToGetConnection = retriesToGetConnection;
        this.galeraClientListener = galeraClientListener;
        this.defaultNodeSelectionPolicy = defaultNodeSelectionPolicy;
        this.testMode = testMode;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .omitNullValues()
                .add("seeds", seeds)
                .add("retriesToGetConnection", retriesToGetConnection)
                .add("galeraClientListener", galeraClientListener)
                .add("defaultNodeSelectionPolicy", defaultNodeSelectionPolicy)
                .add("testMode", testMode)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy