| Modifier and Type | Class and Description |
|---|---|
| public static enum | ConnectionUrl.
The rules describing the number of hosts a database URL may contain. |
| public static enum | ConnectionUrl.
The database URL type which is determined by the scheme section of the connection string. |
| Modifier and Type | Field and Description |
|---|---|
| private static final LRUCache | |
| public static final String | |
| public static final int | |
| protected List | |
| protected String | |
| protected String | |
| protected Map | |
| pack-priv ConnectionPropertiesTransform | |
| private static final ReadWriteLock | |
| protected ConnectionUrl. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| protected | ConnectionUrl(ConnectionUrlParser
a connStrParser, Properties ConnectionUrlParser instance containing the parsed version of the original connection stringthe connection arguments map info)Constructs an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if this class is able to process the given URL, false otherwisethe connection string connString)Checks if this |
| private static String | Returns: a connection string cache map keythe connection string connString, Properties the connection arguments map info)Builds a connection URL cache map key based on the connection string itself plus the string representation of the given connection properties. |
| protected HostInfo | Returns: a new instance ofHostInfothe host host, int the port port, String the user name user, String the password password, Map<String, String> the host properties map hostProps)Creates a new |
| protected void | collectHostsInfo(ConnectionUrlParser
the connStrParser)ConnectionUrlParser from where to collect the hosts informationCollects the hosts information from the |
| protected void | collectProperties(ConnectionUrlParser
the connStrParser, Properties ConnectionUrlParser from where to collect the propertiesthe connection arguments map info)Joins the connection arguments from the connection string with the ones from the given connection arguments map collecting them in a single map. |
| protected void | expandPropertiesFromConfigFiles(Map<String, String>
a connection arguments map from where to read the "useConfig" property and where to save the loaded properties. props)Expands the connection argument "useConfig" by reading the mentioned configuration files. |
| protected HostInfo | Returns: a newHostInfo with all required datathe host information data to fix hi)Fixes the host information by moving data around and filling in missing data. |
| protected void | fixProtocolDependencies(Map<String, String>
the host properties map to fix hostProps)Fixes the protocol (TCP vs PIPE) dependencies for the given host properties map. |
| public Properties | Returns: aProperties instance containing the common connection arguments.Returns a |
| public static ConnectionUrl | Returns: an instance of aConnectionUrl or "null" if isn't able to handle the connection stringthe connection string connString, Properties the connection arguments map info)Static factory method that returns either a new instance of a |
| public String | |
| public String | Returns: the original database URLImplements com. Returns the original database URL that produced this connection string. |
| public String | |
| public String | |
| public int | |
| public String | |
| public HostInfo | Returns: the existing host info or a new independent onethe host:port part to search for hostPortPair)Returns an existing host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found. |
| public HostInfo | Returns: the existing host info or a new independent onethe host:port part to search for hostPortPair, List<HostInfo> the hosts list from where to search the host list hostsList)Returns an existing host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found. |
| public List | Returns: the hosts list from this connection URLReturns a list of the hosts in this connection URL. |
| public List | Returns: the hosts list from this connection URL, filtered for the given view.the type of the view to use in the returned list of hosts. This argument is ignored in this implementation. view)Returns a list of the hosts in this connection URL, filtered for the given view. |
| public List | Returns: the hosts list from the result of the DNS SRV lookup, filtered for the given view.the srvHost)HostInfo from where to get the DNS SRV service name to lookup.Returns a hosts list built from the result of the DNS SRV lookup for the original host name. |
| public HostInfo | |
| public Map | Returns: the original (common to all hosts) connection argumentsReturns the original (common to all hosts) connection arguments as provided in the connection string query section. |
| public static Properties | Returns: the map containing all the properties readthe list of the configuration files to read configFiles)Returns a map containing the properties read from the given configuration files. |
| public ConnectionUrl. | |
| public int | |
| protected void | injectPerTypeProperties(Map<String, String>
the properties already containing all known connection arguments props)Subclasses must override this method if they need to inject additional properties in the connection arguments map while it's being constructed. |
| protected void | preprocessPerTypeHostProperties(Map<String, String>
the host properties map to process hostProps)Subclasses should override this to perform any required pre-processing on the host information properties. |
| protected void | replaceLegacyPropertyValues(Map<String, String>
the host properties map to fix props)Some acceptable property values have changed in c/J 8.0 but old values remain hard-coded in widely used software. |
| protected void | |
| private List | |
| public String | Returns: a string representation of this objectOverrides java. Returns a string representation of this object. |
| connectionUrlCache | back to summary |
|---|---|
| private static final LRUCache<String, ConnectionUrl> connectionUrlCache | |
| DEFAULT_HOST | back to summary |
|---|---|
| public static final String DEFAULT_HOST | |
| DEFAULT_PORT | back to summary |
|---|---|
| public static final int DEFAULT_PORT | |
| hosts | back to summary |
|---|---|
| protected List<HostInfo> hosts | |
| originalConnStr | back to summary |
|---|---|
| protected String originalConnStr | |
| originalDatabase | back to summary |
|---|---|
| protected String originalDatabase | |
| properties | back to summary |
|---|---|
| protected Map<String, String> properties | |
| propertiesTransformer | back to summary |
|---|---|
| pack-priv ConnectionPropertiesTransform propertiesTransformer | |
| rwLock | back to summary |
|---|---|
| private static final ReadWriteLock rwLock | |
| type | back to summary |
|---|---|
| protected ConnectionUrl. | |
| ConnectionUrl | back to summary |
|---|---|
| protected ConnectionUrl() Empty constructor. Required for subclasses initialization. | |
| ConnectionUrl | back to summary |
|---|---|
| public ConnectionUrl(String origUrl) Constructor for unsupported URLs
| |
| ConnectionUrl | back to summary |
|---|---|
| protected ConnectionUrl(ConnectionUrlParser connStrParser, Properties info) Constructs an instance of
| |
| acceptsUrl | back to summary |
|---|---|
| public static boolean acceptsUrl(String connString) Checks if this
| |
| buildConnectionStringCacheKey | back to summary |
|---|---|
| private static String buildConnectionStringCacheKey(String connString, Properties info) Builds a connection URL cache map key based on the connection string itself plus the string representation of the given connection properties.
| |
| buildHostInfo | back to summary |
|---|---|
| protected HostInfo buildHostInfo(String host, int port, String user, String password, Map<String, String> hostProps) Creates a new | |
| collectHostsInfo | back to summary |
|---|---|
| protected void collectHostsInfo(ConnectionUrlParser connStrParser) Collects the hosts information from the
| |
| collectProperties | back to summary |
|---|---|
| protected void collectProperties(ConnectionUrlParser connStrParser, Properties info) Joins the connection arguments from the connection string with the ones from the given connection arguments map collecting them in a single map. Additionally may also collect other connection arguments from configuration files.
| |
| expandPropertiesFromConfigFiles | back to summary |
|---|---|
| protected void expandPropertiesFromConfigFiles(Map<String, String> props) Expands the connection argument "useConfig" by reading the mentioned configuration files. | |
| fixHostInfo | back to summary |
|---|---|
| protected HostInfo fixHostInfo(HostInfo hi) Fixes the host information by moving data around and filling in missing data.
Applies properties transformations to the collected properties if | |
| fixProtocolDependencies | back to summary |
|---|---|
| protected void fixProtocolDependencies(Map<String, String> hostProps) Fixes the protocol (TCP vs PIPE) dependencies for the given host properties map. | |
| getConnectionArgumentsAsProperties | back to summary |
|---|---|
| public Properties getConnectionArgumentsAsProperties() Returns a
| |
| getConnectionUrlInstance | back to summary |
|---|---|
| public static ConnectionUrl getConnectionUrlInstance(String connString, Properties info) Static factory method that returns either a new instance of a
| |
| getDatabase | back to summary |
|---|---|
| public String getDatabase() Returns the database from this connection URL. Note that a "DBNAME" property overrides the database identified in the connection string.
| |
| getDatabaseUrl | back to summary |
|---|---|
| public String getDatabaseUrl() Implements com. Returns the original database URL that produced this connection string. | |
| getDefaultHost | back to summary |
|---|---|
| public String getDefaultHost() Returns the default host. Subclasses must override this method if they have different default host value.
| |
| getDefaultPassword | back to summary |
|---|---|
| public String getDefaultPassword() Returns the default password. Usually the one provided in the method
| |
| getDefaultPort | back to summary |
|---|---|
| public int getDefaultPort() Returns the default port. Subclasses must override this method if they have different default port value.
| |
| getDefaultUser | back to summary |
|---|---|
| public String getDefaultUser() Returns the default user. Usually the one provided in the method
| |
| getHostOrSpawnIsolated | back to summary |
|---|---|
| public HostInfo getHostOrSpawnIsolated(String hostPortPair) Returns an existing host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found. | |
| getHostOrSpawnIsolated | back to summary |
|---|---|
| public HostInfo getHostOrSpawnIsolated(String hostPortPair, List<HostInfo> hostsList) Returns an existing host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found. | |
| getHostsList | back to summary |
|---|---|
| public List Returns a list of the hosts in this connection URL. | |
| getHostsList | back to summary |
|---|---|
| public List Returns a list of the hosts in this connection URL, filtered for the given view. By default returns all hosts. Subclasses should override this method in order to implement support for different views, usually by splitting the global hosts into smaller sub-lists.
| |
| getHostsListFromDnsSrv | back to summary |
|---|---|
| public List Returns a hosts list built from the result of the DNS SRV lookup for the original host name. | |
| getMainHost | back to summary |
|---|---|
| public HostInfo getMainHost() Returns the single or first host info structure.
| |
| getOriginalProperties | back to summary |
|---|---|
| public Map Returns the original (common to all hosts) connection arguments as provided in the connection string query section. | |
| getPropertiesFromConfigFiles | back to summary |
|---|---|
| public static Properties getPropertiesFromConfigFiles(String configFiles) Returns a map containing the properties read from the given configuration files. Multiple files can be referenced using a comma as separator.
| |
| getType | back to summary |
|---|---|
| public ConnectionUrl. Returns this connection URL type.
| |
| hostsCount | back to summary |
|---|---|
| public int hostsCount() Returns the number of hosts in this connection URL.
| |
| injectPerTypeProperties | back to summary |
|---|---|
| protected void injectPerTypeProperties(Map<String, String> props) Subclasses must override this method if they need to inject additional properties in the connection arguments map while it's being constructed. | |
| preprocessPerTypeHostProperties | back to summary |
|---|---|
| protected void preprocessPerTypeHostProperties(Map<String, String> hostProps) Subclasses should override this to perform any required pre-processing on the host information properties. | |
| replaceLegacyPropertyValues | back to summary |
|---|---|
| protected void replaceLegacyPropertyValues(Map<String, String> props) Some acceptable property values have changed in c/J 8.0 but old values remain hard-coded in widely used software. So, old values must be accepted and translated to new ones. | |
| setupPropertiesTransformer | back to summary |
|---|---|
| protected void setupPropertiesTransformer() Sets up the | |
| srvRecordsToHostsList | back to summary |
|---|---|
| private List Converts a list of DNS SRV records into a hosts list. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this object. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | |
| public static ConnectionUrl. | |
| public static ConnectionUrl. |
| MULTIPLE | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| ONE_OR_MORE | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| SINGLE | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| HostsCardinality | back to summary |
|---|---|
| private HostsCardinality() | |
| assertSize | back to summary |
|---|---|
| public abstract boolean assertSize(int n) | |
| valueOf | back to summary |
|---|---|
| public static ConnectionUrl. | |
| values | back to summary |
|---|---|
| public static ConnectionUrl. | |
| Modifier and Type | Field and Description |
|---|---|
| private ConnectionUrl. | |
| private ConnectionUrl. | |
| private PropertyKey | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| private String | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| private String | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. | |
| public static final ConnectionUrl. |
| Access | Constructor and Description |
|---|---|
| private | |
| private | Type(String scheme, ConnectionUrl.
|
| Modifier and Type | Method and Description |
|---|---|
| public static ConnectionUrl. | |
| public ConnectionUrl. | |
| public ConnectionUrl. | |
| public static ConnectionUrl | Returns: an instance ofConnectionUrl.the parser, Properties ConnectionUrlParser containing the URL components.a connection properties map to add to the info)ConnectionUrl structure.Instantiates a class that implements the right type of connection URLs for the given |
| public PropertyKey | |
| public String | |
| private ConnectionUrl | Returns: an instance ofConnectionUrl.the parser, Properties ConnectionUrlParser containing the URL components.a connection properties map to add to the info)ConnectionUrl structure.Instantiates a class that implements this type of connection URLs with the given arguments. |
| public String | |
| public static boolean | Returns: true if the given scheme is supported by driverscheme part from connection string, like "jdbc:mysql:" scheme)Checks if the given scheme corresponds to one of the connection types the driver supports. |
| public static ConnectionUrl. | |
| public static ConnectionUrl. |
| alternateDnsSrvType | back to summary |
|---|---|
| private ConnectionUrl. | |
| cardinality | back to summary |
|---|---|
| private ConnectionUrl. | |
| dnsSrvPropertyKey | back to summary |
|---|---|
| private PropertyKey dnsSrvPropertyKey | |
| FAILOVER_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| FAILOVER_DNS_SRV_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| implementingClass | back to summary |
|---|---|
| private String implementingClass | |
| LOADBALANCE_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| LOADBALANCE_DNS_SRV_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| REPLICATION_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| REPLICATION_DNS_SRV_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| scheme | back to summary |
|---|---|
| private String scheme | |
| SINGLE_CONNECTION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| XDEVAPI_DNS_SRV_SESSION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| XDEVAPI_SESSION | back to summary |
|---|---|
| public static final ConnectionUrl. | |
| Type | back to summary |
|---|---|
| private Type(String scheme, ConnectionUrl. | |
| Type | back to summary |
|---|---|
| private Type(String scheme, ConnectionUrl. | |
| fromValue | back to summary |
|---|---|
| public static ConnectionUrl. Returns the
| |
| getAlternateDnsSrvType | back to summary |
|---|---|
| public ConnectionUrl. | |
| getCardinality | back to summary |
|---|---|
| public ConnectionUrl. | |
| getConnectionUrlInstance | back to summary |
|---|---|
| public static ConnectionUrl getConnectionUrlInstance(ConnectionUrlParser parser, Properties info) Instantiates a class that implements the right type of connection URLs for the given
| |
| getDnsSrvPropertyKey | back to summary |
|---|---|
| public PropertyKey getDnsSrvPropertyKey() | |
| getImplementingClass | back to summary |
|---|---|
| public String getImplementingClass() | |
| getImplementingInstance | back to summary |
|---|---|
| private ConnectionUrl getImplementingInstance(ConnectionUrlParser parser, Properties info) Instantiates a class that implements this type of connection URLs with the given arguments.
| |
| getScheme | back to summary |
|---|---|
| public String getScheme() | |
| isSupported | back to summary |
|---|---|
| public static boolean isSupported(String scheme) Checks if the given scheme corresponds to one of the connection types the driver supports.
| |
| valueOf | back to summary |
|---|---|
| public static ConnectionUrl. | |
| values | back to summary |
|---|---|
| public static ConnectionUrl. | |