Package com.mysql.cj.conf.url
Class LoadBalanceDnsSrvConnectionUrl
java.lang.Object
com.mysql.cj.conf.ConnectionUrl
com.mysql.cj.conf.url.LoadBalanceDnsSrvConnectionUrl
- All Implemented Interfaces:
DatabaseUrlContainer
public class LoadBalanceDnsSrvConnectionUrl extends ConnectionUrl
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mysql.cj.conf.ConnectionUrl
ConnectionUrl.HostsCardinality, ConnectionUrl.Type -
Field Summary
Fields inherited from class com.mysql.cj.conf.ConnectionUrl
hosts, originalConnStr, originalDatabase, properties, type -
Constructor Summary
Constructors Constructor Description LoadBalanceDnsSrvConnectionUrl(ConnectionUrlParser connStrParser, java.util.Properties info)Constructs an instance ofLoadBalanceDnsSrvConnectionUrl, performing all the required initializations and validations. -
Method Summary
Modifier and Type Method Description java.lang.StringgetDefaultHost()Returns the default host.intgetDefaultPort()Returns the default port.java.util.List<HostInfo>getHostsList(HostsListView view)Returns a hosts list built from the result of the DNS SRV lookup for the original host name.protected voidinjectPerTypeProperties(java.util.Map<java.lang.String,java.lang.String> props)Injects additional properties into the connection arguments while the connection arguments map is being constructed.Methods inherited from class com.mysql.cj.conf.ConnectionUrl
acceptsUrl, buildHostInfo, collectHostsInfo, collectProperties, expandPropertiesFromConfigFiles, fixHostInfo, fixProtocolDependencies, getConnectionArgumentsAsProperties, getConnectionUrlInstance, getDatabase, getDatabaseUrl, getDefaultPassword, getDefaultUser, getHostOrSpawnIsolated, getHostOrSpawnIsolated, getHostsList, getHostsListFromDnsSrv, getMainHost, getOriginalProperties, getPropertiesFromConfigFiles, getType, hostsCount, preprocessPerTypeHostProperties, replaceLegacyPropertyValues, setupPropertiesTransformer, toString
-
Constructor Details
-
LoadBalanceDnsSrvConnectionUrl
public LoadBalanceDnsSrvConnectionUrl(ConnectionUrlParser connStrParser, java.util.Properties info)Constructs an instance ofLoadBalanceDnsSrvConnectionUrl, performing all the required initializations and validations.- Parameters:
connStrParser- aConnectionUrlParserinstance containing the parsed version of the original connection stringinfo- the connection arguments map
-
-
Method Details
-
injectPerTypeProperties
protected void injectPerTypeProperties(java.util.Map<java.lang.String,java.lang.String> props)Injects additional properties into the connection arguments while the connection arguments map is being constructed.- Overrides:
injectPerTypePropertiesin classConnectionUrl- Parameters:
props- the properties already containing all known connection arguments
-
getDefaultHost
public java.lang.String getDefaultHost()Description copied from class:ConnectionUrlReturns the default host. Subclasses must override this method if they have different default host value.- Overrides:
getDefaultHostin classConnectionUrl- Returns:
- the default host
-
getDefaultPort
public int getDefaultPort()Description copied from class:ConnectionUrlReturns the default port. Subclasses must override this method if they have different default port value.- Overrides:
getDefaultPortin classConnectionUrl- Returns:
- the default port
-
getHostsList
Returns a hosts list built from the result of the DNS SRV lookup for the original host name.- Overrides:
getHostsListin classConnectionUrl- Parameters:
view- the type of the view to use in the returned list of hosts. This argument is ignored in this implementation.- Returns:
- the hosts list from the result of the DNS SRV lookup, filtered for the given view.
-