Package liquibase.changelog.visitor
Class DefaultChangeExecListener
java.lang.Object
liquibase.changelog.visitor.DefaultChangeExecListener
- All Implemented Interfaces:
ChangeExecListener
,ChangeLogSyncListener
public class DefaultChangeExecListener
extends Object
implements ChangeExecListener, ChangeLogSyncListener
A wrapper ChangeExecListener who keeps track of deployed and failed ChangeSets,
while also delegating listener actions to any other ChangeExecListener included
when the object is constructed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ChangeExecListener listener) getDeployedChanges
(ChangeSet changeSet) Gets list of Changes deployed during the current ChangeSet execution.void
markedRan
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) void
void
void
ran
(Change change, ChangeSet changeSet, DatabaseChangeLog changeLog, Database database) void
ran
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, ChangeSet.ExecType execType) Called after the given changeset is run.void
reset()
void
rollbackFailed
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception exception) void
rolledBack
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) Called after a change is rolled back.void
runFailed
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception exception) void
willRollback
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) Called before a change is rolled back.void
willRun
(Change change, ChangeSet changeSet, DatabaseChangeLog changeLog, Database database) void
willRun
(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, ChangeSet.RunStatus runStatus) Called just before a given changeset is run.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface liquibase.changelog.visitor.ChangeLogSyncListener
markedRanFailed
-
Constructor Details
-
DefaultChangeExecListener
-
-
Method Details
-
willRun
public void willRun(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, ChangeSet.RunStatus runStatus) Description copied from interface:ChangeExecListener
Called just before a given changeset is run.- Specified by:
willRun
in interfaceChangeExecListener
- Parameters:
changeSet
- that will be rundatabaseChangeLog
- parent changelogdatabase
- the database the change will be run againstrunStatus
- of the current change from the database
-
ran
public void ran(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, ChangeSet.ExecType execType) Description copied from interface:ChangeExecListener
Called after the given changeset is run.- Specified by:
ran
in interfaceChangeExecListener
- Parameters:
changeSet
- changeSet that was rundatabaseChangeLog
- the parent changelogdatabase
- the database the change was run againstexecType
- is the result
-
willRollback
public void willRollback(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) Description copied from interface:ChangeExecListener
Called before a change is rolled back.- Specified by:
willRollback
in interfaceChangeExecListener
- Parameters:
changeSet
- changeSet that was rolled backdatabaseChangeLog
- parent change logdatabase
- the database the rollback was executed on.
-
rolledBack
Description copied from interface:ChangeExecListener
Called after a change is rolled back.- Specified by:
rolledBack
in interfaceChangeExecListener
- Parameters:
changeSet
- changeSet that was rolled backdatabaseChangeLog
- parent change logdatabase
- the database the rollback was executed on.
-
preconditionFailed
public void preconditionFailed(PreconditionFailedException error, PreconditionContainer.FailOption onFail) - Specified by:
preconditionFailed
in interfaceChangeExecListener
-
preconditionErrored
public void preconditionErrored(PreconditionErrorException error, PreconditionContainer.ErrorOption onError) - Specified by:
preconditionErrored
in interfaceChangeExecListener
-
willRun
public void willRun(Change change, ChangeSet changeSet, DatabaseChangeLog changeLog, Database database) - Specified by:
willRun
in interfaceChangeExecListener
-
ran
- Specified by:
ran
in interfaceChangeExecListener
-
runFailed
public void runFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception exception) - Specified by:
runFailed
in interfaceChangeExecListener
-
rollbackFailed
public void rollbackFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception exception) - Specified by:
rollbackFailed
in interfaceChangeExecListener
-
getDeployedChanges
Gets list of Changes deployed during the current ChangeSet execution. This list is dynamic and will update depending on where in the lifecycle this is being called.- Parameters:
changeSet
- the ChangeSet to find deployed changes from.- Returns:
- the list of Changes which have deployed from the given ChangeSet. List will be empty if changes have not deployed from requested ChangeSet.
-
addListener
-
markedRan
- Specified by:
markedRan
in interfaceChangeLogSyncListener
-
reset
public void reset()
-