org.openstreetmap.osmosis.core.mysql.v0_5.impl
Class SchemaVersionValidator

java.lang.Object
  extended by org.openstreetmap.osmosis.core.mysql.v0_5.impl.SchemaVersionValidator

public class SchemaVersionValidator
extends java.lang.Object

Reads the version number stored in the schema_info table and verifies that it matches the expected version.

Author:
Brett Henderson

Constructor Summary
SchemaVersionValidator(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences)
          Creates a new instance.
 
Method Summary
 void validateVersion(int expectedVersion)
          Validates that the version number of the schema matches the expected version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaVersionValidator

public SchemaVersionValidator(DatabaseLoginCredentials loginCredentials,
                              DatabasePreferences preferences)
Creates a new instance.

Parameters:
loginCredentials - Contains all information required to connect to the database.
preferences - The database preferences.
Method Detail

validateVersion

public void validateVersion(int expectedVersion)
Validates that the version number of the schema matches the expected version. This method caches the result allowing it to be called multiple times without a performance penalty.

Parameters:
expectedVersion - The expected version number.