Package liquibase.integration.ant
Class BaseLiquibaseTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
liquibase.integration.ant.BaseLiquibaseTask
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstractChangeLogBasedTask
,AbstractDatabaseDiffTask
,DBDocTask
,DropAllTask
,GenerateChangeLogTask
,TagDatabaseTask
public abstract class BaseLiquibaseTask
extends org.apache.tools.ant.Task
Base class for all Ant Liquibase tasks. This class sets up Liquibase and defines parameters
that are common to all tasks.
-
Field Summary
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeLogParameters
(ChangeLogParametersType changeLogParameters) void
addDatabase
(DatabaseType databaseType) protected void
closeDatabase
(Database database) Convenience method to safely close the database connection.org.apache.tools.ant.types.Path
protected Database
protected Database
createDatabaseFromType
(DatabaseType databaseType, ResourceAccessor resourceAccessor) final void
execute()
protected abstract void
This method is designed to be overridden by subclasses when a change log is needed.protected String
This method is designed to be overridden by subclasses when a change log is needed.protected String
protected Liquibase
protected ResourceAccessor
This method is designed to be overridden by subclasses when a change log is needed.void
init()
boolean
Deprecated.no longer promptsvoid
setChangeLogParametersRef
(org.apache.tools.ant.types.Reference changeLogParametersRef) void
setClasspathRef
(org.apache.tools.ant.types.Reference r) void
setDatabaseRef
(org.apache.tools.ant.types.Reference databaseRef) void
setPromptOnNonLocalDatabase
(boolean promptOnNonLocalDatabase) Deprecated.no longer promptsprotected boolean
protected void
Subclasses that override this method must always callsuper.validateParameters()
method.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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
-
Constructor Details
-
BaseLiquibaseTask
public BaseLiquibaseTask()
-
-
Method Details
-
init
public void init() throws org.apache.tools.ant.BuildException- Overrides:
init
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
execute
public final void execute() throws org.apache.tools.ant.BuildException- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
executeWithLiquibaseClassloader
protected abstract void executeWithLiquibaseClassloader() throws org.apache.tools.ant.BuildException- Throws:
org.apache.tools.ant.BuildException
-
createDatabaseFromConfiguredDatabaseType
-
createDatabaseFromType
protected Database createDatabaseFromType(DatabaseType databaseType, ResourceAccessor resourceAccessor) -
getLiquibase
-
getResourceAccessor
-
getChangeLogDirectory
This method is designed to be overridden by subclasses when a change log is needed. By default it returns null.- Returns:
- Returns null in this implementation. Subclasses that need a change log should implement.
- See Also:
-
getSearchPath
This method is designed to be overridden by subclasses when a change log is needed. By default it returns null.- Returns:
- Returns null in this implementation. Subclasses that need a change log should implement.
-
getChangeLogFile
This method is designed to be overridden by subclasses when a change log is needed. By default it returns null.- Returns:
- Returns null in this implementation. Subclasses that need a change log should implement.
- See Also:
-
shouldRun
protected boolean shouldRun() -
getDefaultOutputEncoding
-
validateParameters
protected void validateParameters()Subclasses that override this method must always callsuper.validateParameters()
method. -
closeDatabase
Convenience method to safely close the database connection.- Parameters:
database
- The database to close.
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath() -
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference r) -
addDatabase
-
setDatabaseRef
public void setDatabaseRef(org.apache.tools.ant.types.Reference databaseRef) -
addChangeLogParameters
-
setChangeLogParametersRef
public void setChangeLogParametersRef(org.apache.tools.ant.types.Reference changeLogParametersRef) -
isPromptOnNonLocalDatabase
public boolean isPromptOnNonLocalDatabase()Deprecated.no longer prompts -
setPromptOnNonLocalDatabase
public void setPromptOnNonLocalDatabase(boolean promptOnNonLocalDatabase) Deprecated.no longer prompts
-