com.googlecode.flyway.ant
Class AbstractFlywayTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.googlecode.flyway.ant.AbstractFlywayTask
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- AbstractMigrationLoadingTask, CleanTask, HistoryTask, InitTask, StatusTask
public abstract class AbstractFlywayTask
- extends org.apache.tools.ant.Task
Base class for all Flyway Ant tasks.
| Fields inherited from class org.apache.tools.ant.Task |
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
description, location, project |
|
Method Summary |
protected abstract void |
doExecute(Flyway flyway)
Executes this task. |
void |
execute()
|
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
|
void |
setClasspathref(org.apache.tools.ant.types.Reference classpathref)
|
void |
setDriver(java.lang.String driver)
|
void |
setPassword(java.lang.String password)
|
void |
setSchemas(java.lang.String schemas)
|
void |
setTable(java.lang.String table)
|
void |
setUrl(java.lang.String url)
|
void |
setUser(java.lang.String user)
|
protected java.lang.String |
useValueIfPropertyNotSet(java.lang.String value,
java.lang.String flywayProperty)
Retrieves a value either from an Ant property or if not set, directly. |
| Methods inherited from class org.apache.tools.ant.Task |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFlywayTask
public AbstractFlywayTask()
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classpath)
- Parameters:
classpath - The classpath used to load the JDBC driver and the migrations.
Also configurable with Ant
Property: ${flyway.classpath}
setClasspathref
public void setClasspathref(org.apache.tools.ant.types.Reference classpathref)
- Parameters:
classpathref - The reference to the classpath used to load the JDBC driver and the migrations.
Also
configurable with Ant Property: ${flyway.classpathref}
setDriver
public void setDriver(java.lang.String driver)
- Parameters:
driver - The fully qualified classname of the jdbc driver to use to connect to the database.
Also configurable with Ant Property:
${flyway.driver}
setUrl
public void setUrl(java.lang.String url)
- Parameters:
url - The jdbc url to use to connect to the database.
Also configurable with Ant Property: ${flyway.url}
setUser
public void setUser(java.lang.String user)
- Parameters:
user - The user to use to connect to the database.
Also configurable with Ant Property: ${flyway.user}
setPassword
public void setPassword(java.lang.String password)
- Parameters:
password - The password to use to connect to the database. (default: blank)
Also configurable with Ant Property: ${flyway.password}
setSchemas
public void setSchemas(java.lang.String schemas)
- Parameters:
schemas - Comma-separated list of the schemas managed by Flyway. The first schema in the list will be the one containing
the metadata table. (default: The default schema for the datasource connection)
Also configurable with Ant Property:
${flyway.schemas}
setTable
public void setTable(java.lang.String table)
- Parameters:
table - The name of the schema metadata table that will be used by Flyway.
By default (single-schema mode) the
metadata table is placed in the default schema for the connection provided by the datasource.
When the
flyway.schemas property is set (multi-schema mode), the metadata table is placed in the first schema of
the list.
(default: schema_version)
Also configurable with Ant Property: ${flyway.table}
useValueIfPropertyNotSet
protected java.lang.String useValueIfPropertyNotSet(java.lang.String value,
java.lang.String flywayProperty)
- Retrieves a value either from an Ant property or if not set, directly.
- Parameters:
value - The value to check.flywayProperty - The flyway Ant property. Ex. 'url' for 'flyway.url'
- Returns:
- The value.
execute
public void execute()
throws org.apache.tools.ant.BuildException
- Overrides:
execute in class org.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
doExecute
protected abstract void doExecute(Flyway flyway)
throws java.lang.Exception
- Executes this task.
- Parameters:
flyway - The flyway instance to operate on.
- Throws:
java.lang.Exception - any exception
Copyright © 2011. All Rights Reserved.