scheme://authority/path?query#fragment
This results in splitting the connection string URL and processing its internal parts:
| Modifier and Type | Class and Description |
|---|---|
| public static class | ConnectionUrlParser.
left part type T, right part type U>This class is a simple container for two elements. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final Pattern | |
| private String | |
| private final String | |
| private static final Pattern | |
| private static final String | |
| private static final Pattern | |
| private static final Pattern | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final Pattern | |
| private List | |
| private Map | |
| private String | |
| private static final Pattern | |
| private String | |
| private String | |
| private static final Pattern | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private | ConnectionUrlParser(String
the connection string to parse connString)Constructs a connection string parser for the given connection string. |
| Modifier and Type | Method and Description |
|---|---|
| private HostInfo | Returns: theHostInfo instance containing the parsed information or null if the host part is not emptythe user to include in the final user, String HostInfothe password to include in the final password, String HostInfothe string containing the host information part hostInfo)Builds an |
| private HostInfo | Returns: theHostInfo instance containing the parsed information or null if unable to parse the host informationthe user to include in the resulting user, String HostInfothe password to include in the resulting password, String HostInfothe string containing the host information part hostInfo)Parses the host information using the alternate syntax "address=(key1=value1)(key2=value2)...". |
| private HostInfo | Returns: theHostInfo instance containing the parsed information or null if unable to parse the host informationthe user to include in the resulting user, String HostInfothe password to include in the resulting password, String HostInfothe string containing the host information part hostInfo)Parses the host information using the generic syntax "host:port". |
| private HostInfo | Returns: theHostInfo instance containing the parsed information or null if unable to parse the host informationthe user to include in the resulting user, String HostInfothe password to include in the resulting password, String HostInfothe string containing the host information part hostInfo)Parses the host information using the alternate syntax "(key1=value1, key2=value2, ...)". |
| private List | Returns: a list with allHostInfo instances containing the parsed information or null if unable to parse the host informationthe user to include in all the resulting user, String HostInfothe password to include in all the resulting password, String HostInfothe string containing the host information part hostInfo)Parses the host information using the alternate sub hosts lists syntax "[host1, host2, ...]". |
| private HostInfo | Returns: theHostInfo instance containing the parsed information or null if unable to parse the host informationthe user to include in the final user, String HostInfothe password to include in the final password, String HostInfothe string containing the host information part hostInfo)Parses the host information resorting to a URI object. |
| private static String | |
| private static String | Returns: the decoded stringthe string to decode text)URL-decode the given string skipping all occurrences of the plus sign. |
| public String | |
| public String | Returns: the original database URLImplements com. Returns the original database URL that produced this connection string parser. |
| public List | |
| public String | |
| public Map | Returns: the properties mapReturns the properties map contained in this connection string. |
| public String | |
| public String | |
| public static boolean | Returns: true if supportedconnection string connString)Checks if the scheme part of given connection string matches one of the |
| private void | parseAuthoritySection()
Parses the authority section (user and/or host identification) of the connection string URI. |
| private void | parseAuthoritySegment(String
the string containing the authority segment authSegment)Parses the given sub authority segment, which can take one of the following syntaxes:
|
| public static ConnectionUrlParser | Returns: an instance ofConnectionUrlParserThe connection string to parse. connString)Static factory method for constructing instances of this class. |
| private void | |
| public static ConnectionUrlParser. | Returns: aPair containing the host and port information or null if the host information can't be parsedthe host:pair to parse hostInfo)Parses a host:port pair and returns the two elements in a |
| private void | parseQuerySection()
Parses the connection properties section and stores the extracted key/value pairs into a local map. |
| public static ConnectionUrlParser. | Returns: aPair containing the user and password information or null if the user information can't be parsedthe string containing the user information userInfo)Parses the given user information which is formed by the parts [user][:password]. |
| private Map | Returns: a key/value map containing the matched valuesthe regular expression pattern to match against to pattern, String the input string input)Takes a two-matching-groups (respectively named "key" and "value") pattern which is successively tested against the given string and produces a key/value map with the matched values. |
| private ConnectionUrlParser. | Returns: aPair containing the user information in the left side and the host information in the rightthe string containing the authority segment, i.e., the user and host information parts authSegment)Splits the given authority segment in the user information part and the host part. |
| public String | Returns: a string representation of this objectOverrides java. Returns a string representation of this object. |
| ADDRESS_EQUALS_HOST_INFO_PREFIX | back to summary |
|---|---|
| private static final String ADDRESS_EQUALS_HOST_INFO_PREFIX | |
| ADDRESS_EQUALS_HOST_PTRN | back to summary |
|---|---|
| private static final Pattern ADDRESS_EQUALS_HOST_PTRN | |
| authority | back to summary |
|---|---|
| private String authority | |
| baseConnectionString | back to summary |
|---|---|
| private final String baseConnectionString | |
| CONNECTION_STRING_PTRN | back to summary |
|---|---|
| private static final Pattern CONNECTION_STRING_PTRN | |
| DUMMY_SCHEMA | back to summary |
|---|---|
| private static final String DUMMY_SCHEMA | |
| GENERIC_HOST_PTRN | back to summary |
|---|---|
| private static final Pattern GENERIC_HOST_PTRN | |
| HOST_LIST_PTRN | back to summary |
|---|---|
| private static final Pattern HOST_LIST_PTRN | |
| HOSTS_LIST_CLOSING_MARKERS | back to summary |
|---|---|
| private static final String HOSTS_LIST_CLOSING_MARKERS | |
| HOSTS_LIST_OPENING_MARKERS | back to summary |
|---|---|
| private static final String HOSTS_LIST_OPENING_MARKERS | |
| HOSTS_SEPARATOR | back to summary |
|---|---|
| private static final String HOSTS_SEPARATOR | |
| KEY_VALUE_HOST_INFO_CLOSING_MARKER | back to summary |
|---|---|
| private static final String KEY_VALUE_HOST_INFO_CLOSING_MARKER | |
| KEY_VALUE_HOST_INFO_OPENING_MARKER | back to summary |
|---|---|
| private static final String KEY_VALUE_HOST_INFO_OPENING_MARKER | |
| KEY_VALUE_HOST_PTRN | back to summary |
|---|---|
| private static final Pattern KEY_VALUE_HOST_PTRN | |
| parsedHosts | back to summary |
|---|---|
| private List<HostInfo> parsedHosts | |
| parsedProperties | back to summary |
|---|---|
| private Map<String, String> parsedProperties | |
| path | back to summary |
|---|---|
| private String path | |
| PROPERTIES_PTRN | back to summary |
|---|---|
| private static final Pattern PROPERTIES_PTRN | |
| query | back to summary |
|---|---|
| private String query | |
| scheme | back to summary |
|---|---|
| private String scheme | |
| SCHEME_PTRN | back to summary |
|---|---|
| private static final Pattern SCHEME_PTRN | |
| USER_HOST_SEPARATOR | back to summary |
|---|---|
| private static final String USER_HOST_SEPARATOR | |
| USER_PASS_SEPARATOR | back to summary |
|---|---|
| private static final String USER_PASS_SEPARATOR | |
| ConnectionUrlParser | back to summary |
|---|---|
| private ConnectionUrlParser(String connString) Constructs a connection string parser for the given connection string.
| |
| buildHostInfoForEmptyHost | back to summary |
|---|---|
| private HostInfo buildHostInfoForEmptyHost(String user, String password, String hostInfo) Builds an | |
| buildHostInfoResortingToAddressEqualsSyntaxParser | back to summary |
|---|---|
| private HostInfo buildHostInfoResortingToAddressEqualsSyntaxParser(String user, String password, String hostInfo) Parses the host information using the alternate syntax "address=(key1=value1)(key2=value2)...". | |
| buildHostInfoResortingToGenericSyntaxParser | back to summary |
|---|---|
| private HostInfo buildHostInfoResortingToGenericSyntaxParser(String user, String password, String hostInfo) Parses the host information using the generic syntax "host:port". | |
| buildHostInfoResortingToKeyValueSyntaxParser | back to summary |
|---|---|
| private HostInfo buildHostInfoResortingToKeyValueSyntaxParser(String user, String password, String hostInfo) Parses the host information using the alternate syntax "(key1=value1, key2=value2, ...)". | |
| buildHostInfoResortingToSubHostsListParser | back to summary |
|---|---|
| private List Parses the host information using the alternate sub hosts lists syntax "[host1, host2, ...]". | |
| buildHostInfoResortingToUriParser | back to summary |
|---|---|
| private HostInfo buildHostInfoResortingToUriParser(String user, String password, String hostInfo) Parses the host information resorting to a URI object. This process handles most single-host well formed addresses. | |
| decode | back to summary |
|---|---|
| private static String decode(String text) URL-decode the given string. | |
| decodeSkippingPlusSign | back to summary |
|---|---|
| private static String decodeSkippingPlusSign(String text) URL-decode the given string skipping all occurrences of the plus sign. | |
| getAuthority | back to summary |
|---|---|
| public String getAuthority() Returns the authority section.
| |
| getDatabaseUrl | back to summary |
|---|---|
| public String getDatabaseUrl() Implements com. Returns the original database URL that produced this connection string parser. | |
| getHosts | back to summary |
|---|---|
| public List Returns the hosts information. | |
| getPath | back to summary |
|---|---|
| public String getPath() Returns the path section.
| |
| getProperties | back to summary |
|---|---|
| public Map Returns the properties map contained in this connection string. | |
| getQuery | back to summary |
|---|---|
| public String getQuery() Returns the query section.
| |
| getScheme | back to summary |
|---|---|
| public String getScheme() Returns the scheme section.
| |
| isConnectionStringSupported | back to summary |
|---|---|
| public static boolean isConnectionStringSupported(String connString) Checks if the scheme part of given connection string matches one of the
| |
| parseAuthoritySection | back to summary |
|---|---|
| private void parseAuthoritySection() Parses the authority section (user and/or host identification) of the connection string URI. | |
| parseAuthoritySegment | back to summary |
|---|---|
| private void parseAuthoritySegment(String authSegment) Parses the given sub authority segment, which can take one of the following syntaxes:
| |
| parseConnectionString | back to summary |
|---|---|
| public static ConnectionUrlParser parseConnectionString(String connString) Static factory method for constructing instances of this class.
| |
| parseConnectionString | back to summary |
|---|---|
| private void parseConnectionString() Splits the connection string in its main sections. | |
| parseHostPortPair | back to summary |
|---|---|
| public static ConnectionUrlParser. Parses a host:port pair and returns the two elements in a | |
| parseQuerySection | back to summary |
|---|---|
| private void parseQuerySection() Parses the connection properties section and stores the extracted key/value pairs into a local map. | |
| parseUserInfo | back to summary |
|---|---|
| public static ConnectionUrlParser. Parses the given user information which is formed by the parts [user][:password]. | |
| processKeyValuePattern | back to summary |
|---|---|
| private Map Takes a two-matching-groups (respectively named "key" and "value") pattern which is successively tested against the given string and produces a key/value map with the matched values. The given pattern must ensure that there are no leftovers between successive tests, i.e., the end of the previous match must coincide with the beginning of the next. | |
| splitByUserInfoAndHostInfo | back to summary |
|---|---|
| private ConnectionUrlParser. Splits the given authority segment in the user information part and the host part. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this object. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| Pair | back to summary |
|---|---|
| public Pair(T left, U right) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |