Top Description Fields Methods
liquibase.command

public Interface CommandStep

Known Direct Implementers
liquibase.command.AbstractCommandStep
Imports
liquibase.exception.CommandValidationException, java.util.List

Defines a particular step in a command pipeline. When a command is executed, Liquibase will find all the step whose defineCommandNames() matches the command, add the dependencies and run the pipeline.
See Also
CommandScope#execute()

Field Summary

Modifier and TypeField and Description
public static final int
ORDER_DEFAULT

Deprecated
Returned by getOrder(CommandDefinition) if you are unsure where in the pipeline your step should go, use this value.
public static final int
ORDER_NOT_APPLICABLE

Deprecated
Returned by getOrder(CommandDefinition) if this step should not be a part of the pipeline.

Method Summary

Modifier and TypeMethod and Description
public void
adjustCommandDefinition(CommandDefinition commandDefinition)

Called by the command pipeline setup to adjust the CommandDefinition metadata about the overall command.

public String[][]
defineCommandNames()

Defines new command names For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}.

public int

Returns:

-1 if this step does not apply to the given command
getOrder
(CommandDefinition commandDefinition)
Deprecated

The order in the pipeline that this step should be executed in. Logic is generally based off CommandDefinition#getName() but it can check other things in the definition such as arguments.

public List<Class<?>>

Returns:

list with the provided classes types
providedDependencies
()

Returns a list of all the dependency Classes that this step provides

public List<Class<?>>

Returns:

list with the required classes types
requiredDependencies
()

Return a list of configured Classes that this command requires to be passed as a dependency.

public void
run(CommandResultsBuilder resultsBuilder)

Performs the business logic.

public void
validate(CommandScope commandScope)

Validates that the CommandScope is correctly set up for this step to run.

Field Detail

ORDER_DEFAULTback to summary
public static final int ORDER_DEFAULT

Deprecated

Returned by getOrder(CommandDefinition) if you are unsure where in the pipeline your step should go, use this value.

Annotations
@Deprecated
ORDER_NOT_APPLICABLEback to summary
public static final int ORDER_NOT_APPLICABLE

Deprecated

Returned by getOrder(CommandDefinition) if this step should not be a part of the pipeline.

Annotations
@Deprecated

Method Detail

adjustCommandDefinitionback to summary
public void adjustCommandDefinition(CommandDefinition commandDefinition)

Called by the command pipeline setup to adjust the CommandDefinition metadata about the overall command. This method should not be called directly. It is called by the overall pipeline logic in the CommandFactory#getCommandDefinition(String...).

defineCommandNamesback to summary
public String[][] defineCommandNames()

Defines new command names For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}. If it is a part of `liquibase example init`, this should return {"example", "init"}.

This is used to determine the available command names.

This can return null if this step is not defining a new command but "cross-cutting" existing commands

getOrderback to summary
public int getOrder(CommandDefinition commandDefinition)

Deprecated

The order in the pipeline that this step should be executed in. Logic is generally based off CommandDefinition#getName() but it can check other things in the definition such as arguments.

Returns:int

-1 if this step does not apply to the given command

Annotations
@Deprecated
providedDependenciesback to summary
public List<Class<?>> providedDependencies()

Returns a list of all the dependency Classes that this step provides

Returns:List<Class<?>>

list with the provided classes types

requiredDependenciesback to summary
public List<Class<?>> requiredDependencies()

Return a list of configured Classes that this command requires to be passed as a dependency.

Returns:List<Class<?>>

list with the required classes types

runback to summary
public void run(CommandResultsBuilder resultsBuilder) throws Exception

Performs the business logic. This method should not be called directly. It is called by the overall pipeline logic in the CommandScope#execute() order.

validateback to summary
public void validate(CommandScope commandScope) throws CommandValidationException

Validates that the CommandScope is correctly set up for this step to run. Any validation in CommandArgumentDefinition#validate(CommandScope) will be checked previous to this method being called.