com.googlecode.flyway.core.migration
Class MigrationProvider

java.lang.Object
  extended by com.googlecode.flyway.core.migration.MigrationProvider

public class MigrationProvider
extends java.lang.Object

Facility for retrieving and sorting the available migrations from the classpath through the various migration resolvers.


Constructor Summary
MigrationProvider(java.lang.String basePackage, java.lang.String baseDir, java.lang.String encoding, java.lang.String sqlMigrationPrefix, java.lang.String sqlMigrationSuffix, java.util.Map<java.lang.String,java.lang.String> placeholders, java.lang.String placeholderPrefix, java.lang.String placeholderSuffix)
          Creates a new MigrationProvider.
 
Method Summary
 java.util.List<Migration> findAvailableMigrations()
          Finds all available migrations using all migration resolvers (sql, java, ...).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MigrationProvider

public MigrationProvider(java.lang.String basePackage,
                         java.lang.String baseDir,
                         java.lang.String encoding,
                         java.lang.String sqlMigrationPrefix,
                         java.lang.String sqlMigrationSuffix,
                         java.util.Map<java.lang.String,java.lang.String> placeholders,
                         java.lang.String placeholderPrefix,
                         java.lang.String placeholderSuffix)
Creates a new MigrationProvider.

Parameters:
basePackage - The base package where the Java migrations are located.
baseDir - The base directory on the classpath where the Sql migrations are located.
encoding - The encoding of Sql migrations.
sqlMigrationPrefix - The file name prefix for sql migrations.
sqlMigrationSuffix - The file name suffix for sql migrations.
placeholders - A map of to apply to sql migration scripts.
placeholderPrefix - The prefix of every placeholder.
placeholderSuffix - The suffix of every placeholder.
Method Detail

findAvailableMigrations

public java.util.List<Migration> findAvailableMigrations()
                                                  throws FlywayException
Finds all available migrations using all migration resolvers (sql, java, ...).

Returns:
The available migrations, sorted by version, newest first. An empty list is returned when no migrations can be found.
Throws:
FlywayException - when the available migrations have overlapping versions.


Copyright © 2011. All Rights Reserved.