Class DefaultConfigEnvironmentCommand<T extends io.dropwizard.core.Configuration>

java.lang.Object
io.dropwizard.core.cli.Command
io.dropwizard.core.cli.ConfiguredCommand<T>
io.dropwizard.core.cli.EnvironmentCommand<T>
nl.knaw.dans.lib.util.DefaultConfigEnvironmentCommand<T>
Type Parameters:
T - the application's configuration class

@Deprecated public abstract class DefaultConfigEnvironmentCommand<T extends io.dropwizard.core.Configuration> extends io.dropwizard.core.cli.EnvironmentCommand<T>
Deprecated.
A DropWizard EnvironmentCommand that configures the value of system property `dans.default.config` as the default for the `file` parameter. This can be used to create a start-up script for the application that does not require the user to explicitly provide the `config.yml` location with every invocation, .e.g.,

```bash ARGS=$@

java -Ddans.config.default=/etc/opt/dans.knaw.nl/my-app/config.yml my-app.jar $ARGS ```

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DefaultConfigEnvironmentCommand(io.dropwizard.core.Application<T> application, String name, String description)
    Deprecated.
    Creates a new environment command.
    protected
    DefaultConfigEnvironmentCommand(io.dropwizard.core.Application<T> application, String name, String description, boolean configFileAsOption)
    Deprecated.
    Creates a new environment command.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected net.sourceforge.argparse4j.inf.Argument
    addFileArgument(net.sourceforge.argparse4j.inf.Subparser subparser)
    Deprecated.
     

    Methods inherited from class io.dropwizard.core.cli.EnvironmentCommand

    getEnvironment, run, run

    Methods inherited from class io.dropwizard.core.cli.ConfiguredCommand

    cleanup, cleanupAsynchronously, configure, getConfiguration, getConfigurationClass, run

    Methods inherited from class io.dropwizard.core.cli.Command

    getDescription, getName, onError

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultConfigEnvironmentCommand

      protected DefaultConfigEnvironmentCommand(io.dropwizard.core.Application<T> application, String name, String description, boolean configFileAsOption)
      Deprecated.
      Creates a new environment command.
      Parameters:
      application - the application providing this command
      name - the name of the command, used for command line invocation
      description - a description of the command's purpose
      configFileAsOption - if true, the configuration file is set via an option --config, otherwise, as a positional argument
    • DefaultConfigEnvironmentCommand

      protected DefaultConfigEnvironmentCommand(io.dropwizard.core.Application<T> application, String name, String description)
      Deprecated.
      Creates a new environment command.
      Parameters:
      application - the application providing this command
      name - the name of the command, used for command line invocation
      description - a description of the command's purpose
  • Method Details

    • addFileArgument

      protected net.sourceforge.argparse4j.inf.Argument addFileArgument(net.sourceforge.argparse4j.inf.Subparser subparser)
      Deprecated.
      Overrides:
      addFileArgument in class io.dropwizard.core.cli.ConfiguredCommand<T extends io.dropwizard.core.Configuration>