public class LoadBalanceConnectionUrl extends ConnectionUrl
ConnectionUrl.HostsCardinality, ConnectionUrl.TypeDEFAULT_HOST, DEFAULT_PORT, hosts, originalConnStr, originalDatabase, properties, type| Constructor and Description |
|---|
LoadBalanceConnectionUrl(ConnectionUrlParser connStrParser,
java.util.Properties info)
Constructs an instance of
LoadBalanceConnectionUrl, performing all the required initializations and validations. |
LoadBalanceConnectionUrl(java.util.List<HostInfo> hosts,
java.util.Map<java.lang.String,java.lang.String> properties)
Constructs an instance of a
LoadBalanceConnectionUrl based on a list of hosts and a global set of properties instead of connection string
parsing. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
getHostInfoListAsHostPortPairs()
Returns a list of this connection URL hosts in the form of host:port pairs.
|
java.util.List<HostInfo> |
getHostInfoListFromHostPortPairs(java.util.Collection<java.lang.String> hostPortPairs)
Returns the list of
HostInfo instances that matches the given collection of host:port pairs. |
protected void |
injectPerTypeProperties(java.util.Map<java.lang.String,java.lang.String> props)
Injects additional properties into the connection arguments while it's being constructed.
|
acceptsUrl, buildHostInfo, collectHostsInfo, collectProperties, expandPropertiesFromConfigFiles, fixHostInfo, fixProtocolDependencies, getConnectionArgumentsAsProperties, getConnectionUrlInstance, getDatabase, getDatabaseUrl, getDefaultHost, getDefaultPassword, getDefaultPort, getDefaultUser, getHostOrSpawnIsolated, getHostOrSpawnIsolated, getHostsList, getHostsList, getHostsListFromDnsSrv, getMainHost, getOriginalProperties, getPropertiesFromConfigFiles, getType, hostsCount, preprocessPerTypeHostProperties, replaceLegacyPropertyValues, setupPropertiesTransformer, toStringpublic LoadBalanceConnectionUrl(ConnectionUrlParser connStrParser, java.util.Properties info)
LoadBalanceConnectionUrl, performing all the required initializations and validations. A load-balanced connection
cannot deal with multiple hosts with same host:port.connStrParser - a ConnectionUrlParser instance containing the parsed version of the original connection stringinfo - the connection arguments mappublic LoadBalanceConnectionUrl(java.util.List<HostInfo> hosts, java.util.Map<java.lang.String,java.lang.String> properties)
LoadBalanceConnectionUrl based on a list of hosts and a global set of properties instead of connection string
parsing.
ConnectionUrl instances created by this process are not cached.hosts - the hosts list to use in this connection URLproperties - the properties common to all hostsprotected void injectPerTypeProperties(java.util.Map<java.lang.String,java.lang.String> props)
injectPerTypeProperties in class ConnectionUrlprops - the properties already containing all known connection argumentspublic java.util.List<java.lang.String> getHostInfoListAsHostPortPairs()
public java.util.List<HostInfo> getHostInfoListFromHostPortPairs(java.util.Collection<java.lang.String> hostPortPairs)
HostInfo instances that matches the given collection of host:port pairs. Isolated host info elements are spawned for the
missing elements.hostPortPairs - a list of host:port pairsHostInfo instances corresponding to the given host:port pairs