liquibase.integration.ant
Class BaseLiquibaseTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by liquibase.integration.ant.BaseLiquibaseTask
Direct Known Subclasses:
ChangeLogSyncTask, DatabaseRollbackFutureTask, DatabaseRollbackTask, DatabaseUpdateTask, DatabaseUpdateTestingRollbackTask, DBDocTask, DiffDatabaseTask, DropAllTask, GenerateChangeLogTask, MarkNextChangeSetRanTask, TagDatabaseTask

public 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.


Nested Class Summary
static class BaseLiquibaseTask.ChangeLogProperty
           
protected static class BaseLiquibaseTask.LogRedirector
          Redirector of logs from java.util.logging to ANT's loggging
 
Field Summary
protected  org.apache.tools.ant.types.Path classpath
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
BaseLiquibaseTask()
           
 
Method Summary
 void addConfiguredChangeLogProperty(BaseLiquibaseTask.ChangeLogProperty changeLogProperty)
           
protected  void closeDatabase(Liquibase liquibase)
           
 org.apache.tools.ant.types.Path createClasspath()
           
protected  Database createDatabaseObject(String driverClassName, String databaseUrl, String username, String password, String defaultSchemaName, String databaseClass)
           
protected  Liquibase createLiquibase()
           
 Writer createOutputWriter()
           
 PrintStream createPrintStream()
           
 void execute()
           
 String getChangeLogFile()
           
 String getContexts()
           
 String getCurrentDateTimeFunction()
           
 String getDatabaseChangeLogLockTableName()
           
 String getDatabaseChangeLogTableName()
           
 String getDatabaseClass()
           
 String getDefaultSchemaName()
           
 String getDriver()
           
 String getLogLevel()
           
 String getOutputFile()
           
 String getPassword()
           
 String getUrl()
           
 String getUsername()
           
 boolean isPromptOnNonLocalDatabase()
           
 void setChangeLogFile(String changeLogFile)
           
 void setClasspathRef(org.apache.tools.ant.types.Reference r)
           
 void setContexts(String cntx)
           
 void setCurrentDateTimeFunction(String currentDateTimeFunction)
           
 void setDatabaseChangeLogLockTableName(String tableName)
           
 void setDatabaseChangeLogTableName(String tableName)
           
 void setDatabaseClass(String databaseClass)
           
 void setDefaultSchemaName(String defaultSchemaName)
           
 void setDriver(String driver)
           
 void setLogLevel(String level)
           
 void setOutputFile(String outputFile)
           
 void setPassword(String password)
           
 void setPromptOnNonLocalDatabase(boolean promptOnNonLocalDatabase)
           
 void setUrl(String url)
           
 void setUsername(String username)
           
protected  boolean shouldRun()
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classpath

protected org.apache.tools.ant.types.Path classpath
Constructor Detail

BaseLiquibaseTask

public BaseLiquibaseTask()
Method Detail

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

isPromptOnNonLocalDatabase

public boolean isPromptOnNonLocalDatabase()

setPromptOnNonLocalDatabase

public void setPromptOnNonLocalDatabase(boolean promptOnNonLocalDatabase)

getDriver

public String getDriver()

setDriver

public void setDriver(String driver)

getUrl

public String getUrl()

setUrl

public void setUrl(String url)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getChangeLogFile

public String getChangeLogFile()

setChangeLogFile

public void setChangeLogFile(String changeLogFile)

createClasspath

public org.apache.tools.ant.types.Path createClasspath()

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference r)

getCurrentDateTimeFunction

public String getCurrentDateTimeFunction()

setCurrentDateTimeFunction

public void setCurrentDateTimeFunction(String currentDateTimeFunction)

getOutputFile

public String getOutputFile()

setOutputFile

public void setOutputFile(String outputFile)

createOutputWriter

public Writer createOutputWriter()
                          throws IOException
Throws:
IOException

createPrintStream

public PrintStream createPrintStream()
                              throws IOException
Throws:
IOException

getDefaultSchemaName

public String getDefaultSchemaName()

setDefaultSchemaName

public void setDefaultSchemaName(String defaultSchemaName)

addConfiguredChangeLogProperty

public void addConfiguredChangeLogProperty(BaseLiquibaseTask.ChangeLogProperty changeLogProperty)

createLiquibase

protected Liquibase createLiquibase()
                             throws Exception
Throws:
Exception

createDatabaseObject

protected Database createDatabaseObject(String driverClassName,
                                        String databaseUrl,
                                        String username,
                                        String password,
                                        String defaultSchemaName,
                                        String databaseClass)
                                 throws Exception
Throws:
Exception

getContexts

public String getContexts()

setContexts

public void setContexts(String cntx)

shouldRun

protected boolean shouldRun()

closeDatabase

protected void closeDatabase(Liquibase liquibase)

getDatabaseClass

public String getDatabaseClass()

setDatabaseClass

public void setDatabaseClass(String databaseClass)

getDatabaseChangeLogTableName

public String getDatabaseChangeLogTableName()

setDatabaseChangeLogTableName

public void setDatabaseChangeLogTableName(String tableName)

getDatabaseChangeLogLockTableName

public String getDatabaseChangeLogLockTableName()

setDatabaseChangeLogLockTableName

public void setDatabaseChangeLogLockTableName(String tableName)

getLogLevel

public String getLogLevel()

setLogLevel

public void setLogLevel(String level)


Copyright © 2004-2011 Liquibase.org. All Rights Reserved.