Class DatabaseConfigPanel

java.lang.Object
com.atlassian.jira.configurator.db.DatabaseConfigPanel
Direct Known Subclasses:
CommonConfigPanel, H2ConfigPanel, MySql8ConfigPanel, OracleConfigPanel

public abstract class DatabaseConfigPanel extends Object
An abstract class that represents the GUI Config panel for a particular DB type. Each DB type will require a separate subclass with DB-specific operations.
  • Field Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validate

      public abstract void validate() throws ValidationException
      Verify that the settings are valid.
      Throws:
      ValidationException - if any config is invalid.
    • getDisplayName

      public String getDisplayName()
    • getClassName

      public String getClassName()
    • getUrl

      public abstract String getUrl(String jiraHome) throws ValidationException
      Returns the JDBC URL for this DB config.

      The current jira-home is passed because it used by H2.

      Parameters:
      jiraHome - The current configured jira-home
      Returns:
      the JDBC URL for this DB config.
      Throws:
      ValidationException - If the underlying configuration is invalid for this DB type. eg for Postgres, "Database" (instance) is a required field
    • getUsername

      public abstract String getUsername()
    • getPassword

      public abstract String getPassword()
    • getSchemaName

      public abstract String getSchemaName()
      For DB's that want to allow entity-engine to set a schema-name, this will return the user's selected Schema-name
      Returns:
      the user's selected Schema-name
    • getDatabaseType

      public DatabaseType getDatabaseType()
    • getPanel

      public abstract JPanel getPanel()
    • setSettings

      public abstract void setSettings(Settings settings) throws ParseException
      Throws:
      ParseException
    • saveSettings

      public void saveSettings(Settings newSettings, String jiraHome) throws ValidationException
      Apply the current user entered settings into the given Settings object.
      Parameters:
      newSettings - The Settings object to set the values in.
      jiraHome - the jira home where the settings should be saved
      Throws:
      ValidationException - if any of the new settings are Invalid
    • testConnection

      public void testConnection(String jiraHome) throws ClassNotFoundException, SQLException, ValidationException
      Throws:
      ClassNotFoundException
      SQLException
      ValidationException