Package io.dropwizard.migrations
Class AbstractLiquibaseCommand<T extends Configuration>
- java.lang.Object
-
- io.dropwizard.core.cli.Command
-
- io.dropwizard.core.cli.ConfiguredCommand<T>
-
- io.dropwizard.migrations.AbstractLiquibaseCommand<T>
-
- Direct Known Subclasses:
DbCalculateChecksumCommand
,DbClearChecksumsCommand
,DbCommand
,DbDropAllCommand
,DbDumpCommand
,DbFastForwardCommand
,DbGenerateDocsCommand
,DbLocksCommand
,DbMigrateCommand
,DbPrepareRollbackCommand
,DbRollbackCommand
,DbStatusCommand
,DbTagCommand
,DbTestCommand
public abstract class AbstractLiquibaseCommand<T extends Configuration> extends ConfiguredCommand<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLiquibaseCommand(String name, String description, DatabaseConfiguration<T> strategy, Class<T> configurationClass, String migrationsFileName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
configure(net.sourceforge.argparse4j.inf.Subparser subparser)
Configure the command'sSubparser
.protected Class<T>
getConfigurationClass()
Returns theClass
of the configuration type.protected void
run(@Nullable Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration)
Runs the command with the givenBootstrap
andConfiguration
.protected abstract void
run(net.sourceforge.argparse4j.inf.Namespace namespace, liquibase.Liquibase liquibase)
-
Methods inherited from class io.dropwizard.core.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, getConfiguration, run
-
Methods inherited from class io.dropwizard.core.cli.Command
getDescription, getName, onError
-
-
-
-
Method Detail
-
getConfigurationClass
protected Class<T> getConfigurationClass()
Description copied from class:ConfiguredCommand
Returns theClass
of the configuration type.- Overrides:
getConfigurationClass
in classConfiguredCommand<T extends Configuration>
- Returns:
- the
Class
of the configuration type
-
configure
public void configure(net.sourceforge.argparse4j.inf.Subparser subparser)
Description copied from class:ConfiguredCommand
Configure the command'sSubparser
.N.B.: if you override this method, you must call
super.override(subparser)
in order to preserve the configuration file parameter in the subparser.- Overrides:
configure
in classConfiguredCommand<T extends Configuration>
- Parameters:
subparser
- theSubparser
specific to the command
-
run
protected void run(@Nullable Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception
Description copied from class:ConfiguredCommand
Runs the command with the givenBootstrap
andConfiguration
.- Specified by:
run
in classConfiguredCommand<T extends Configuration>
- Parameters:
bootstrap
- the bootstrap bootstrapnamespace
- the parsed command line namespaceconfiguration
- the configuration object- Throws:
Exception
- if something goes wrong
-
-