Package org.graylog2.bootstrap
Class CmdLineTool
java.lang.Object
org.graylog2.bootstrap.CmdLineTool
- All Implemented Interfaces:
Runnable,CliCommand
- Direct Known Subclasses:
AbstractJournalCommand,ServerBootstrap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChainingClassLoaderprotected Stringprotected final Configurationprotected com.google.inject.Injectorprotected booleanprotected booleanprotected FeatureFlagsprotected static final Stringstatic final Stringstatic final Stringprotected com.google.inject.Injectorprotected final com.github.joschi.jadconfig.JadConfigprotected static final Stringprotected static final Version -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCmdLineTool(String commandName, Configuration configuration) protectedCmdLineTool(Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidannotateInjectorCreationException(com.google.inject.CreationException e) protected voidannotateInjectorExceptions(Collection<com.google.inject.spi.Message> messages) protected static voidapplySecuritySettings(TLSProtocolsConfiguration configuration) protected voidbeforeInjectorCreation(Set<Plugin> plugins) Things that have to run before the guice injector is created.protected voidThings that have to run before thestartCommand()method is being called.protected voidbeforeStart(TLSProtocolsConfiguration configuration, PathConfiguration pathConfiguration) Things that have to run before thestartCommand()method is being called.protected Set<ServerStatus.Capability>voiddoRun(org.apache.logging.log4j.Level logLevel) protected abstract List<com.google.inject.Module>getCommandBindings(FeatureFlags featureFlags) protected Collection<com.github.joschi.jadconfig.Repository>getConfigRepositories(String configFile) protected List<com.google.inject.Module>protected voidinstallConfigRepositories(com.github.joschi.jadconfig.JadConfig jadConfig) booleanisDebug()booleanbooleanbooleanloadPlugins(Path pluginPath, ChainingClassLoader chainingClassLoader) protected booleanprotected voidprocessConfiguration(com.github.joschi.jadconfig.JadConfig jadConfig) voidrun()protected com.google.inject.InjectorSet up a separate injector, containing only the core configuration bindings.protected com.google.inject.InjectorsetupInjector(com.google.inject.Module... modules) protected org.apache.logging.log4j.Levelprotected abstract voidprotected booleanValidate the given configuration for this command.
-
Field Details
-
GRAYLOG_ENVIRONMENT_VAR_PREFIX
- See Also:
-
GRAYLOG_SYSTEM_PROP_PREFIX
- See Also:
-
version
-
FILE_SEPARATOR
-
TMPDIR
-
jadConfig
protected final com.github.joschi.jadconfig.JadConfig jadConfig -
configuration
-
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
-
injector
protected com.google.inject.Injector injector -
coreConfigInjector
protected com.google.inject.Injector coreConfigInjector -
featureFlags
-
-
Constructor Details
-
CmdLineTool
-
CmdLineTool
-
-
Method Details
-
validateConfiguration
protected boolean validateConfiguration()Validate the given configuration for this command.- Returns:
trueif the configuration is valid,false.
-
isDumpConfig
public boolean isDumpConfig() -
isDumpDefaultConfig
public boolean isDumpDefaultConfig() -
isDebug
public boolean isDebug() -
getCommandBindings
-
getCommandConfigurationBeans
-
isMigrationCommand
public boolean isMigrationCommand() -
beforeStart
protected void beforeStart()Things that have to run before thestartCommand()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 thestartCommand()method is being called. Please note that this happens *before* the configuration file has been parsed. -
beforeInjectorCreation
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
-
run
public void run() -
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() -
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) -
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
-
capabilities
-