com.atlassian.jira.config.database
Class DatabaseDriverRegisterer

java.lang.Object
  extended by com.atlassian.jira.config.database.DatabaseDriverRegisterer

@Internal
public class DatabaseDriverRegisterer
extends Object

Registers required DB drivers and provides db-specific error messages when things go wrong.

Since:
v5.2

Method Summary
 DatabaseType databaseType()
           
static DatabaseDriverRegisterer forDriverClass(String className)
           
static DatabaseDriverRegisterer forType(DatabaseType type)
           
 HelpUtil.HelpPath getDbConfigLink()
          Get link to DB configuration page for given database.
static HelpUtil.HelpPath getDbConfigLink(DatabaseType type)
           
static HelpUtil.HelpPath getDbConfigLink(String key)
           
 Iterable<String> getErrorMessage()
          Get error message (for failed registration) specific to the database type.
static boolean hasDbconfigLink(String key)
           
 boolean isDriverRegistered()
           
 void registerDriver()
          Registers the driver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forType

public static DatabaseDriverRegisterer forType(DatabaseType type)

forDriverClass

public static DatabaseDriverRegisterer forDriverClass(String className)

databaseType

public DatabaseType databaseType()

registerDriver

public void registerDriver()
Registers the driver. If the driver is not found on the classpath, prints an error message in the logs and throws IllegalStateException (yes, it does both things! log it and throw it FTW:)

Throws:
InvalidDatabaseDriverException - if the driver is not found

getErrorMessage

public Iterable<String> getErrorMessage()
Get error message (for failed registration) specific to the database type.

Returns:
message as a list of strings (non-i18ned)

isDriverRegistered

public boolean isDriverRegistered()

getDbConfigLink

public HelpUtil.HelpPath getDbConfigLink()
Get link to DB configuration page for given database.

Returns:
link to DB configuration page. null if no such link exists.

getDbConfigLink

public static HelpUtil.HelpPath getDbConfigLink(DatabaseType type)

getDbConfigLink

public static HelpUtil.HelpPath getDbConfigLink(String key)

hasDbconfigLink

public static boolean hasDbconfigLink(String key)


Copyright © 2002-2014 Atlassian. All Rights Reserved.