public interface CommandStep
defineCommandNames()
matches the command
and run them in getOrder(CommandDefinition)
order.CommandScope.execute()
Modifier and Type | Field and Description |
---|---|
static int |
ORDER_DEFAULT
Returned by
getOrder(CommandDefinition) if you are unsure where in the pipeline your step should go, use this value. |
static int |
ORDER_NOT_APPLICABLE
Returned by
getOrder(CommandDefinition) if this step should not be a part of the pipeline. |
Modifier and Type | Method and Description |
---|---|
void |
adjustCommandDefinition(CommandDefinition commandDefinition)
Called by the command pipeline setup to adjust the
CommandDefinition metadata about the overall command. |
String[][] |
defineCommandNames()
Defines new command names
For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}.
|
int |
getOrder(CommandDefinition commandDefinition)
The order in the pipeline that this step should be executed in.
|
void |
run(CommandResultsBuilder resultsBuilder)
Performs the business logic.
|
void |
validate(CommandScope commandScope)
Validates that the
CommandScope is correctly set up for this step to run. |
static final int ORDER_DEFAULT
getOrder(CommandDefinition)
if you are unsure where in the pipeline your step should go, use this value.static final int ORDER_NOT_APPLICABLE
getOrder(CommandDefinition)
if this step should not be a part of the pipeline.String[][] defineCommandNames()
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.
int getOrder(CommandDefinition commandDefinition)
CommandDefinition.getName()
but it can check other things in the definition such as arguments.void adjustCommandDefinition(CommandDefinition commandDefinition)
CommandDefinition
metadata about the overall command.
This method should not be called directly. It is called by the overall pipeline logic in the getOrder(CommandDefinition)
order.void validate(CommandScope commandScope) throws CommandValidationException
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.
This method should not be called directly. It is called by the overall pipeline logic in the getOrder(CommandDefinition)
order.CommandValidationException
void run(CommandResultsBuilder resultsBuilder) throws Exception
getOrder(CommandDefinition)
order.Exception
Copyright © 2022 Liquibase.org. All rights reserved.