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

org.postgresql.hostchooser.HostChooserFactory Maven / Gradle / Ivy

There is a newer version: 5.0.0.9.pg
Show newest version
/*
 * Copyright (c) 2014, PostgreSQL Global Development Group
 * See the LICENSE file in the project root for more information.
 */

package io.mogdb.hostchooser;

import io.mogdb.util.HostSpec;

import java.util.Properties;

/**
 * Chooses a {@link HostChooser} instance based on the number of hosts and properties.
 */
public class HostChooserFactory {

    public static HostChooser createHostChooser(HostSpec[] hostSpecs,
                                                HostRequirement targetServerType, Properties info) {
        if (hostSpecs.length == 1) {
            return new SingleHostChooser(hostSpecs[0], targetServerType);
        }
        return new MultiHostChooser(hostSpecs, targetServerType, info);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy