com.atlassian.jira.configurator.db
Class CommonConfigPanel

java.lang.Object
  extended by com.atlassian.jira.configurator.db.DatabaseConfigPanel
      extended by com.atlassian.jira.configurator.db.CommonConfigPanel
Direct Known Subclasses:
PostgresConfigPanel, SqlServerConfigPanel

public abstract class CommonConfigPanel
extends DatabaseConfigPanel

Holds config options like username and password that are common to most DB types.


Field Summary
protected  JTextField tfHostname
           
protected  JTextField tfPassword
           
protected  JTextField tfPort
           
protected  JTextField tfUsername
           
 
Fields inherited from class com.atlassian.jira.configurator.db.DatabaseConfigPanel
TEXT_FIELD_COLUMNS
 
Constructor Summary
CommonConfigPanel(DatabaseConfig databaseConfig)
           
 
Method Summary
protected abstract  JPanel buildConfigPanel()
           
 String getClassName()
           
protected abstract  String getHostname()
           
protected abstract  String getInstance()
           
 JPanel getPanel()
           
 String getPassword()
           
protected abstract  String getPort()
           
 String getUrl(String jiraHome)
          Returns the JDBC URL for this DB config.
 String getUsername()
           
protected abstract  void setSchemaName(String schemaName)
           
 void setSettings(Settings settings)
           
protected abstract  void setUrlSettings(DatabaseInstance connectionProperties)
           
 void validate()
          Verify that the settings are valid.
 
Methods inherited from class com.atlassian.jira.configurator.db.DatabaseConfigPanel
getDisplayName, getSchemaName, saveSettings, testConnection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tfHostname

protected JTextField tfHostname

tfPort

protected JTextField tfPort

tfUsername

protected JTextField tfUsername

tfPassword

protected JTextField tfPassword
Constructor Detail

CommonConfigPanel

public CommonConfigPanel(DatabaseConfig databaseConfig)
Method Detail

getUsername

public String getUsername()
Specified by:
getUsername in class DatabaseConfigPanel

getPassword

public String getPassword()
Specified by:
getPassword in class DatabaseConfigPanel

getClassName

public String getClassName()
Specified by:
getClassName in class DatabaseConfigPanel

getUrl

public String getUrl(String jiraHome)
              throws ValidationException
Description copied from class: DatabaseConfigPanel
Returns the JDBC URL for this DB config.

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

Specified by:
getUrl in class DatabaseConfigPanel
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

getHostname

protected abstract String getHostname()

getPort

protected abstract String getPort()

getInstance

protected abstract String getInstance()

getPanel

public final JPanel getPanel()
Specified by:
getPanel in class DatabaseConfigPanel

buildConfigPanel

protected abstract JPanel buildConfigPanel()

setSettings

public void setSettings(Settings settings)
                 throws ParseException
Specified by:
setSettings in class DatabaseConfigPanel
Throws:
ParseException

setUrlSettings

protected abstract void setUrlSettings(DatabaseInstance connectionProperties)
                                throws ParseException
Throws:
ParseException

setSchemaName

protected abstract void setSchemaName(String schemaName)

validate

public void validate()
              throws ValidationException
Description copied from class: DatabaseConfigPanel
Verify that the settings are valid.

Specified by:
validate in class DatabaseConfigPanel
Throws:
ValidationException - if any config is invalid.


Copyright © 2002-2012 Atlassian. All Rights Reserved.