com.amazon.redshift.hostchooser.HostChooserFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift-jdbc42 Show documentation
Show all versions of redshift-jdbc42 Show documentation
Java JDBC 4.2 (JRE 8+) driver for Redshift database
/*
* Copyright (c) 2014, PostgreSQL Global Development Group
* See the LICENSE file in the project root for more information.
*/
package com.amazon.redshift.hostchooser;
import com.amazon.redshift.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);
}
}