org.liquibase.maven.plugins
Class LiquibaseRollback

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.liquibase.maven.plugins.AbstractLiquibaseMojo
          extended by org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
              extended by org.liquibase.maven.plugins.LiquibaseRollback
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
LiquibaseFutureRollbackSQL, LiquibaseRollbackSQL

public class LiquibaseRollback
extends AbstractLiquibaseChangeLogMojo

Invokes Liquibase rollbacks on a database.

Author:
Peter Murray

Nested Class Summary
protected static class LiquibaseRollback.RollbackType
           
 
Field Summary
protected  int rollbackCount
          The number of change sets to rollback.
protected  String rollbackDate
          The date to rollback the database to.
protected  String rollbackScript
          External script containing rollback logic.
protected  String rollbackTag
          The tag to roll the database back to.
protected  LiquibaseRollback.RollbackType type
          The type of the rollback that is being performed.
 
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
changeLogFile, contexts, labels
 
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
changelogCatalogName, changelogSchemaName, clearCheckSums, databaseChangeLogLockTableName, databaseChangeLogTableName, databaseClass, defaultCatalogName, defaultSchemaName, driver, emptyPassword, includeArtifact, includeTestOutputDirectory, liquibaseShouldRun, logging, outputDefaultCatalog, outputDefaultSchema, outputFileEncoding, password, project, promptOnNonLocalDatabase, propertyFile, propertyFileWillOverride, propertyProviderClass, systemProperties, url, username, verbose, wagonManager
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
LiquibaseRollback()
           
 
Method Summary
protected  void checkRequiredParametersAreSpecified()
          Performs some validation after the properties file has been loaded checking that all properties required have been specified.
protected  void checkRequiredRollbackParameters()
           
protected  void performLiquibaseTask(Liquibase liquibase)
          Performs the actual Liquibase task on the database using the fully configured Liquibase.
protected  void printSettings(String indent)
          Prints the settings that have been set of defaulted for the plugin.
 
Methods inherited from class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
createLiquibase, getFileOpener
 
Methods inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
cleanup, configureFieldsAndValues, execute, getClassLoaderIncludingProjectClasspath, getLiquibase, getMavenArtifactClassLoader, getOutputWriter, isPromptOnNonLocalDatabase, parsePropertiesFile
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rollbackTag

protected String rollbackTag
The tag to roll the database back to.


rollbackCount

protected int rollbackCount
The number of change sets to rollback.


rollbackDate

protected String rollbackDate
The date to rollback the database to. The format of the date must match that of the DateFormat.getDateInstance() for the platform the plugin is executing on.


type

protected LiquibaseRollback.RollbackType type
The type of the rollback that is being performed.


rollbackScript

protected String rollbackScript
External script containing rollback logic. Set to override the rollback logic contained in the changelog

Constructor Detail

LiquibaseRollback

public LiquibaseRollback()
Method Detail

checkRequiredParametersAreSpecified

protected void checkRequiredParametersAreSpecified()
                                            throws org.apache.maven.plugin.MojoFailureException
Description copied from class: AbstractLiquibaseMojo
Performs some validation after the properties file has been loaded checking that all properties required have been specified.

Overrides:
checkRequiredParametersAreSpecified in class AbstractLiquibaseChangeLogMojo
Throws:
org.apache.maven.plugin.MojoFailureException - If any property that is required has not been specified.

checkRequiredRollbackParameters

protected void checkRequiredRollbackParameters()
                                        throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

printSettings

protected void printSettings(String indent)
Description copied from class: AbstractLiquibaseMojo
Prints the settings that have been set of defaulted for the plugin. These will only be shown in verbose mode.

Overrides:
printSettings in class AbstractLiquibaseChangeLogMojo
Parameters:
indent - The indent string to use when printing the settings.

performLiquibaseTask

protected void performLiquibaseTask(Liquibase liquibase)
                             throws LiquibaseException
Description copied from class: AbstractLiquibaseChangeLogMojo
Performs the actual Liquibase task on the database using the fully configured Liquibase.

Overrides:
performLiquibaseTask in class AbstractLiquibaseChangeLogMojo
Parameters:
liquibase - The Liquibase that has been fully configured to run the desired database task.
Throws:
LiquibaseException


Copyright © 2015 Liquibase.org. All rights reserved.