liquibase.change.custom
Interface CustomTaskChange


public interface CustomTaskChange

Interface to implement when creating a custom change that does not actually generate SQL. If you are updating a database through SQL, implementing CustomSqlChange is preferred because the SQL can either be executed directly or saved to a text file for later use depending on the migration mode used. To allow the change to be rolled back, also implement the CustomTaskRollback interface. If your change requires sql-based logic and non-sql-based logic, it is best to create a change set that contains a mix of CustomSqlChange and CustomTaskChange calls.

See Also:
CustomTaskRollback, CustomSqlChange

Method Summary
 void execute(Database database)
          Method called to run the change logic.
 java.lang.String getConfirmationMessage()
          Confirmation message to be displayed after the change is executed
 void setFileOpener(FileOpener fileOpener)
          Sets the fileOpener that should be used for any file loading and resource finding for files that are provided by the user.
 void setUp()
          This method will be called after the no arg constructor and all of the properties have been set to allow the task to do any heavy tasks or more importantly generate any exceptions to report to the user about the settings provided.
 void validate(Database database)
          Tests that the change is configured correctly before attempting to execute it.
 

Method Detail

execute

void execute(Database database)
             throws CustomChangeException,
                    UnsupportedChangeException
Method called to run the change logic.

Parameters:
database -
Throws:
CustomChangeException - an exception occurs while processing this change
UnsupportedChangeException - if this change is not supported by the Database passed as argument

getConfirmationMessage

java.lang.String getConfirmationMessage()
Confirmation message to be displayed after the change is executed

Returns:
a String containing the message after the change is executed

setUp

void setUp()
           throws SetupException
This method will be called after the no arg constructor and all of the properties have been set to allow the task to do any heavy tasks or more importantly generate any exceptions to report to the user about the settings provided.

Throws:
SetupException

setFileOpener

void setFileOpener(FileOpener fileOpener)
Sets the fileOpener that should be used for any file loading and resource finding for files that are provided by the user.


validate

void validate(Database database)
              throws InvalidChangeDefinitionException
Tests that the change is configured correctly before attempting to execute it.

Parameters:
database - The database the change will be ran against
Throws:
InvalidChangeDefinitionException