Class CmdLineTool

java.lang.Object
org.graylog2.bootstrap.CmdLineTool
All Implemented Interfaces:
Runnable, CliCommand
Direct Known Subclasses:
AbstractJournalCommand, ServerBootstrap

public abstract class CmdLineTool extends Object implements CliCommand
  • Field Details

    • GRAYLOG_ENVIRONMENT_VAR_PREFIX

      public static final String GRAYLOG_ENVIRONMENT_VAR_PREFIX
      See Also:
    • GRAYLOG_SYSTEM_PROP_PREFIX

      public static final String GRAYLOG_SYSTEM_PROP_PREFIX
      See Also:
    • version

      protected static final Version version
    • FILE_SEPARATOR

      protected static final String FILE_SEPARATOR
    • TMPDIR

      protected static final String TMPDIR
    • jadConfig

      protected final com.github.joschi.jadconfig.JadConfig jadConfig
    • configuration

      protected final Configuration configuration
    • chainingClassLoader

      protected final ChainingClassLoader chainingClassLoader
    • dumpConfig

      @Option(name="--dump-config", description="Show the effective Graylog configuration and exit") protected boolean dumpConfig
    • dumpDefaultConfig

      @Option(name="--dump-default-config", description="Show the default configuration and exit") protected boolean dumpDefaultConfig
    • commandName

      protected String commandName
    • injector

      protected com.google.inject.Injector injector
    • coreConfigInjector

      protected com.google.inject.Injector coreConfigInjector
    • featureFlags

      protected FeatureFlags featureFlags
  • Constructor Details

  • Method Details

    • validateConfiguration

      protected boolean validateConfiguration()
      Validate the given configuration for this command.
      Returns:
      true if the configuration is valid, false.
    • isDumpConfig

      public boolean isDumpConfig()
    • isDumpDefaultConfig

      public boolean isDumpDefaultConfig()
    • isDebug

      public boolean isDebug()
    • getCommandBindings

      protected abstract List<com.google.inject.Module> getCommandBindings(FeatureFlags featureFlags)
    • getCommandConfigurationBeans

      protected abstract List<Object> getCommandConfigurationBeans()
    • isMigrationCommand

      public boolean isMigrationCommand()
    • beforeStart

      protected void beforeStart()
      Things that have to run before the startCommand() method is being called. Please note that this happens *before* the configuration file has been parsed.
    • beforeStart

      protected void beforeStart(TLSProtocolsConfiguration configuration, PathConfiguration pathConfiguration)
      Things that have to run before the startCommand() method is being called. Please note that this happens *before* the configuration file has been parsed.
    • beforeInjectorCreation

      protected void beforeInjectorCreation(Set<Plugin> plugins)
      Things that have to run before the guice injector is created. This call happens *after* the configuration file has been parsed.
      Parameters:
      plugins - The already loaded plugins
    • applySecuritySettings

      protected static void applySecuritySettings(TLSProtocolsConfiguration configuration)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • doRun

      public void doRun(org.apache.logging.log4j.Level logLevel)
    • startCommand

      protected abstract void startCommand()
    • setupLogger

      protected org.apache.logging.log4j.Level setupLogger()
    • onlyLogErrors

      protected boolean onlyLogErrors()
    • loadPlugins

      protected Set<Plugin> loadPlugins(Path pluginPath, ChainingClassLoader chainingClassLoader)
    • getConfigRepositories

      protected Collection<com.github.joschi.jadconfig.Repository> getConfigRepositories(String configFile)
    • installConfigRepositories

      protected void installConfigRepositories(com.github.joschi.jadconfig.JadConfig jadConfig)
    • processConfiguration

      protected void processConfiguration(com.github.joschi.jadconfig.JadConfig jadConfig)
    • getSharedBindingsModules

      protected List<com.google.inject.Module> getSharedBindingsModules()
    • setupInjector

      protected com.google.inject.Injector setupInjector(com.google.inject.Module... modules)
    • setupCoreConfigInjector

      protected com.google.inject.Injector setupCoreConfigInjector()
      Set up a separate injector, containing only the core configuration bindings. It can be used to look up configuration values in modules at binding time.
    • annotateInjectorCreationException

      protected void annotateInjectorCreationException(com.google.inject.CreationException e)
    • annotateInjectorExceptions

      protected void annotateInjectorExceptions(Collection<com.google.inject.spi.Message> messages)
    • capabilities

      protected Set<ServerStatus.Capability> capabilities()