com.atlassian.crowd.migration.verify
Class DatabaseVerifier

java.lang.Object
  extended by com.atlassian.crowd.migration.verify.DatabaseVerifier
Direct Known Subclasses:
LegacyDatabaseVerifier, SupportedDatabaseVerifier

public abstract class DatabaseVerifier
extends Object

Responsible for verifying the correctness/compatibility of pre 2.0 database to 2.0+ database


Field Summary
protected  List<String> errors
           
protected  LegacyTableQueries legacyTableQueries
           
 
Constructor Summary
DatabaseVerifier()
           
 
Method Summary
 void clearState()
          This method will be called between runs of the verifier to make sure that state can be purged between runs if required.
 List<String> getErrors()
           
 boolean hasErrors()
          Checks if there are any errors as a result of the verification
 void setLegacyTableQueries(LegacyTableQueries legacyTableQueries)
          Provides the appropriate legacy table querier to the verifier if it needs to query the database.
abstract  void verify()
          This method will verify if the correctness/compatibility of the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errors

protected final List<String> errors

legacyTableQueries

protected LegacyTableQueries legacyTableQueries
Constructor Detail

DatabaseVerifier

public DatabaseVerifier()
Method Detail

verify

public abstract void verify()
This method will verify if the correctness/compatibility of the database. If an error is detected, the error will be added to the errors list.


clearState

public void clearState()
This method will be called between runs of the verifier to make sure that state can be purged between runs if required.


hasErrors

public boolean hasErrors()
Checks if there are any errors as a result of the verification

Returns:
true if there are no errors (errors list is empty), false otherwise

getErrors

public List<String> getErrors()
Returns:
the list of error messages during verification

setLegacyTableQueries

public void setLegacyTableQueries(LegacyTableQueries legacyTableQueries)
Provides the appropriate legacy table querier to the verifier if it needs to query the database.

Parameters:
legacyTableQueries - The appropriate table querier (eg. MySQL, Postgres)


Copyright © 2013 Atlassian. All Rights Reserved.