Package liquibase.command.core
Class AbstractUpdateCommandStep
- java.lang.Object
-
- liquibase.command.AbstractCommandStep
-
- liquibase.command.core.AbstractUpdateCommandStep
-
- All Implemented Interfaces:
CleanUpCommandStep
,CommandStep
- Direct Known Subclasses:
UpdateCommandStep
,UpdateCountCommandStep
,UpdateSqlCommandStep
,UpdateToTagCommandStep
public abstract class AbstractUpdateCommandStep extends AbstractCommandStep implements CleanUpCommandStep
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY
-
Fields inherited from class liquibase.command.AbstractCommandStep
coreBundle
-
Fields inherited from interface liquibase.command.CommandStep
ORDER_DEFAULT, ORDER_NOT_APPLICABLE
-
-
Constructor Summary
Constructors Constructor Description AbstractUpdateCommandStep()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp(CommandResultsBuilder resultsBuilder)
Method invoked to execute the cleanup action.protected void
customMdcLogging(CommandScope commandScope)
abstract String
getChangelogFileArg(CommandScope commandScope)
abstract String[]
getCommandName()
abstract String
getContextsArg(CommandScope commandScope)
abstract String
getLabelFilterArg(CommandScope commandScope)
abstract UpdateSummaryEnum
getShowSummary(CommandScope commandScope)
UpdateSummaryOutputEnum
getShowSummaryOutput(CommandScope commandScope)
ChangeLogIterator
getStandardChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog)
protected List<ChangeSetFilter>
getStandardChangelogIteratorFilters(Database database, Contexts contexts, LabelExpression labelExpression)
ChangeLogIterator
getStatusChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog)
boolean
isUpToDate(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, OutputStream outputStream)
Checks if the database is up-to-date.boolean
isUpToDateFastCheck(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression)
void
postUpdateLog(int rowsAffected)
Logprotected void
preRun(CommandScope commandScope, ChangeLogIterator runChangeLogIterator, ChangeLogParameters changeLogParameters)
Executed before running any updates against the database.List<Class<?>>
requiredDependencies()
Return a list of configured Classes that this command requires to be passed as a dependency.void
run(CommandResultsBuilder resultsBuilder)
Performs the business logic.protected void
setDBLock(boolean locked)
void
setFastCheckEnabled(boolean fastCheckEnabled)
-
Methods inherited from class liquibase.command.AbstractCommandStep
adjustCommandDefinition, getOrder, providedDependencies, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.command.CommandStep
defineCommandNames
-
-
-
-
Field Detail
-
DEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY
public static final String DEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChangelogFileArg
public abstract String getChangelogFileArg(CommandScope commandScope)
-
getContextsArg
public abstract String getContextsArg(CommandScope commandScope)
-
getLabelFilterArg
public abstract String getLabelFilterArg(CommandScope commandScope)
-
getCommandName
public abstract String[] getCommandName()
-
getShowSummary
public abstract UpdateSummaryEnum getShowSummary(CommandScope commandScope)
-
getShowSummaryOutput
public UpdateSummaryOutputEnum getShowSummaryOutput(CommandScope commandScope)
-
requiredDependencies
public List<Class<?>> requiredDependencies()
Description copied from interface:CommandStep
Return a list of configured Classes that this command requires to be passed as a dependency.- Specified by:
requiredDependencies
in interfaceCommandStep
- Overrides:
requiredDependencies
in classAbstractCommandStep
- Returns:
- list with the required classes types
-
run
public void run(CommandResultsBuilder resultsBuilder) throws Exception
Description copied from interface:CommandStep
Performs the business logic. This method should not be called directly. It is called by the overall pipeline logic in theCommandScope.execute()
order.- Specified by:
run
in interfaceCommandStep
- Throws:
Exception
-
preRun
protected void preRun(CommandScope commandScope, ChangeLogIterator runChangeLogIterator, ChangeLogParameters changeLogParameters) throws LiquibaseException
Executed before running any updates against the database.- Throws:
LiquibaseException
-
customMdcLogging
protected void customMdcLogging(CommandScope commandScope)
-
cleanUp
public void cleanUp(CommandResultsBuilder resultsBuilder)
Description copied from interface:CleanUpCommandStep
Method invoked to execute the cleanup action.- Specified by:
cleanUp
in interfaceCleanUpCommandStep
- Parameters:
resultsBuilder
- builder used in this pipeline
-
getStandardChangelogIterator
@Beta public ChangeLogIterator getStandardChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog) throws LiquibaseException
- Throws:
LiquibaseException
-
getStatusChangelogIterator
@Beta public ChangeLogIterator getStatusChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog) throws LiquibaseException
- Throws:
LiquibaseException
-
getStandardChangelogIteratorFilters
protected List<ChangeSetFilter> getStandardChangelogIteratorFilters(Database database, Contexts contexts, LabelExpression labelExpression)
-
isUpToDateFastCheck
public boolean isUpToDateFastCheck(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression) throws LiquibaseException
- Throws:
LiquibaseException
-
isUpToDate
@Beta public boolean isUpToDate(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, OutputStream outputStream) throws LiquibaseException, IOException
Checks if the database is up-to-date.- Parameters:
commandScope
-database
- the database to checkdatabaseChangeLog
- the databaseChangeLog of the databasecontexts
- the command contextslabelExpression
- the command label expressionsoutputStream
- the current global OutputStream- Returns:
- true if there are no additional changes to execute, otherwise false
- Throws:
LiquibaseException
- if there was a problem running any queriesIOException
- if there was a problem handling the update summary
-
setFastCheckEnabled
public void setFastCheckEnabled(boolean fastCheckEnabled)
-
postUpdateLog
@Beta public void postUpdateLog(int rowsAffected)
Log
-
setDBLock
protected void setDBLock(boolean locked)
-
-