liquibase.command.core.CalculateChecksumCommandStep Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-core Show documentation
Show all versions of liquibase-core Show documentation
Liquibase is a tool for managing and executing database changes.
package liquibase.command.core;
import liquibase.command.*;
import liquibase.configuration.ConfigurationValueObfuscator;
import liquibase.exception.CommandExecutionException;
public class CalculateChecksumCommandStep extends AbstractCliWrapperCommandStep {
public static String[] COMMAND_NAME = {"calculateChecksum"};
public static final CommandArgumentDefinition CHANGELOG_FILE_ARG;
public static final CommandArgumentDefinition CHANGESET_IDENTIFIER_ARG;
public static final CommandArgumentDefinition URL_ARG;
public static final CommandArgumentDefinition DEFAULT_SCHEMA_NAME_ARG;
public static final CommandArgumentDefinition DEFAULT_CATALOG_NAME_ARG;
public static final CommandArgumentDefinition USERNAME_ARG;
public static final CommandArgumentDefinition PASSWORD_ARG;
public static final CommandArgumentDefinition DRIVER_ARG;
public static final CommandArgumentDefinition DRIVER_PROPERTIES_FILE_ARG;
static {
CommandBuilder builder = new CommandBuilder(COMMAND_NAME);
CHANGELOG_FILE_ARG = builder.argument(CommonArgumentNames.CHANGELOG_FILE, String.class).required()
.description("The root changelog file").build();
URL_ARG = builder.argument(CommonArgumentNames.URL, String.class).required()
.description("The JDBC database connection URL").build();
DEFAULT_SCHEMA_NAME_ARG = builder.argument("defaultSchemaName", String.class)
.description("The default schema name to use for the database connection").build();
DEFAULT_CATALOG_NAME_ARG = builder.argument("defaultCatalogName", String.class)
.description("The default catalog name to use for the database connection").build();
DRIVER_ARG = builder.argument("driver", String.class)
.description("The JDBC driver class").build();
DRIVER_PROPERTIES_FILE_ARG = builder.argument("driverPropertiesFile", String.class)
.description("The JDBC driver properties file").build();
USERNAME_ARG = builder.argument(CommonArgumentNames.USERNAME, String.class)
.description("The database username").build();
PASSWORD_ARG = builder.argument(CommonArgumentNames.PASSWORD, String.class)
.description("The database password")
.setValueObfuscator(ConfigurationValueObfuscator.STANDARD)
.build();
CHANGESET_IDENTIFIER_ARG = builder.argument("changesetIdentifier", String.class).required()
.description("Changeset ID identifier of form filepath::id::author").build();
}
@Override
public String[][] defineCommandNames() {
return new String[][] { COMMAND_NAME };
}
protected String[] collectArguments(CommandScope commandScope) throws CommandExecutionException {
return collectArguments(commandScope, null, CHANGESET_IDENTIFIER_ARG.getName());
}
@Override
public void adjustCommandDefinition(CommandDefinition commandDefinition) {
commandDefinition.setShortDescription("Calculates and prints a checksum for the changeset");
commandDefinition.setLongDescription("Calculates and prints a checksum for the changeset with the given id in the format filepath::id::author");
}
}