Class MySqlUrlParser

java.lang.Object
com.atlassian.jira.config.database.jdbcurlparser.MySqlUrlParser
All Implemented Interfaces:
JdbcUrlParser

public class MySqlUrlParser extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getUrl(String hostname, String port, String instance)
    Returns the JDBC URL for this DB config.
    parseUrl(String jdbcUrl)
    Parses JDBC URL for MySql Supports Standard and Alternate URL formats Standard format: jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]][?propertyName1=propertyValue1[invalid input: '&propertyName2'=propertyValue2]...] Alternate format: jdbc:mysql://address=(key1=value)[(key2=value)]...[,address=(key3=value)[(key4=value)]...]...[/[database]][?propertyName1=propertyValue1[invalid input: '&propertyName2'=propertyValue2]...]

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MySqlUrlParser

      public MySqlUrlParser()
  • Method Details

    • getUrl

      public String getUrl(String hostname, String port, String instance)
      Description copied from interface: JdbcUrlParser
      Returns the JDBC URL for this DB config.
      Specified by:
      getUrl in interface JdbcUrlParser
      Parameters:
      hostname - the hostname
      port - the TCP/IP port number
      instance - the DB "instance"
      Returns:
      the JDBC URL for this DB config.
    • parseUrl

      public DatabaseInstance parseUrl(String jdbcUrl) throws ParseException
      Parses JDBC URL for MySql Supports Standard and Alternate URL formats Standard format: jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]][?propertyName1=propertyValue1[invalid input: '&propertyName2'=propertyValue2]...] Alternate format: jdbc:mysql://address=(key1=value)[(key2=value)]...[,address=(key3=value)[(key4=value)]...]...[/[database]][?propertyName1=propertyValue1[invalid input: '&propertyName2'=propertyValue2]...]
      Specified by:
      parseUrl in interface JdbcUrlParser
      Parameters:
      jdbcUrl - - JDBC URL in standard or alternate format
      Returns:
      a DatabaseInstance containing extracted hostname, port and instance name.
      Throws:
      ParseException