com.atlassian.jira.configurator.db
Class DatabaseConfigPanel

java.lang.Object
  extended by com.atlassian.jira.configurator.db.DatabaseConfigPanel
Direct Known Subclasses:
CommonConfigPanel, HsqlConfigPanel, MySqlConfigPanel, 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 Summary
static int TEXT_FIELD_COLUMNS
           
 
Constructor Summary
DatabaseConfigPanel()
           
 
Method Summary
abstract  String getClassName()
           
abstract  String getDisplayName()
           
abstract  JPanel getPanel()
           
abstract  String getPassword()
           
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
abstract  String getUrl(String jiraHome)
          Returns the JDBC URL for this DB config.
abstract  String getUsername()
           
 void saveSettings(Settings newSettings, String jiraHome)
          Apply the current user entered settings into the given Settings object.
abstract  void setSettings(Settings settings)
           
 void testConnection(String jiraHome)
           
 String toString()
           
abstract  void validate()
          Verify that the settings are valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT_FIELD_COLUMNS

public static final int TEXT_FIELD_COLUMNS
See Also:
Constant Field Values
Constructor Detail

DatabaseConfigPanel

public DatabaseConfigPanel()
Method Detail

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 abstract String getDisplayName()

getClassName

public abstract 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 HSQL.

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

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.
Throws:
ValidationException - if any of the new settings are Invalid

testConnection

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


Copyright © 2002-2012 Atlassian. All Rights Reserved.