com.atlassian.jira.appconsistency.db
Class DatabaseConsistencyCheck

java.lang.Object
  extended bycom.atlassian.jira.appconsistency.db.DatabaseConsistencyCheck
All Implemented Interfaces:
DatabaseCheck

public class DatabaseConsistencyCheck
extends Object
implements DatabaseCheck


Constructor Summary
DatabaseConsistencyCheck()
           
DatabaseConsistencyCheck(Map fieldTypeToDriverMapping, JiraConnectionFactory jiraConnectionFactory)
           
 
Method Summary
(package private) static boolean containsIgnoreCase(String str, String searchString)
           
(package private)  void detectCorrectDatabase(String fieldTypeName, String databaseProductName, String driverName)
          If the database type is incorrect, set the fault description.
 String getFaultDescription()
          Implement this method to return the description of the fault.
 String getHTMLFaultDescription()
          Implement this method to return the error message of the fault.
 String getName()
          Implement this method to return the name of this check
(package private)  boolean isJdbcDriverCorrectTypeForEntityEngine(String fieldTypeName)
           
 boolean isOk()
          Implement this method to return true if the check is positive and false in the case of negarive result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseConsistencyCheck

public DatabaseConsistencyCheck()

DatabaseConsistencyCheck

public DatabaseConsistencyCheck(Map fieldTypeToDriverMapping,
                                JiraConnectionFactory jiraConnectionFactory)
Method Detail

getName

public String getName()
Description copied from interface: DatabaseCheck
Implement this method to return the name of this check

Specified by:
getName in interface DatabaseCheck
Returns:
name

isOk

public boolean isOk()
Description copied from interface: DatabaseCheck
Implement this method to return true if the check is positive and false in the case of negarive result.

Specified by:
isOk in interface DatabaseCheck
Returns:
true if positive

getFaultDescription

public String getFaultDescription()
Description copied from interface: DatabaseCheck
Implement this method to return the description of the fault. This method should return null in the case the check was positive. This message is used to present the user with a message to the console

Specified by:
getFaultDescription in interface DatabaseCheck
Returns:
fault description

getHTMLFaultDescription

public String getHTMLFaultDescription()
Description copied from interface: DatabaseCheck
Implement this method to return the error message of the fault. This method should return null in the case the check was positive. This message is used to present the user with a message viewable in a web browser.

Specified by:
getHTMLFaultDescription in interface DatabaseCheck
Returns:
HTML formatted fault description

isJdbcDriverCorrectTypeForEntityEngine

boolean isJdbcDriverCorrectTypeForEntityEngine(String fieldTypeName)

detectCorrectDatabase

void detectCorrectDatabase(String fieldTypeName,
                           String databaseProductName,
                           String driverName)
If the database type is incorrect, set the fault description. If either the driverName or databaseProductName contain the expected substring as configured in the fieldTypeToDriverMapping for the given fieldTypeName, then there is no fault. . If this is not so

Parameters:
fieldTypeName - The @field-type-name value in entityengine.xml
databaseProductName - In-use database's name, eg. 'MySQL'
driverName - In-use JDBC driver name, eg. 'MySQL-AB JDBC Driver'

containsIgnoreCase

static boolean containsIgnoreCase(String str,
                                  String searchString)


Copyright © 2002-2007 Atlassian. All Rights Reserved.