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
Modifier and TypeFieldDescriptionprotected final ChainingClassLoader
protected String
protected final Configuration
protected com.google.inject.Injector
protected boolean
protected boolean
protected FeatureFlags
protected static final String
static final String
static final String
protected com.google.inject.Injector
protected final com.github.joschi.jadconfig.JadConfig
protected static final String
protected static final Version
-
Constructor Summary
ModifierConstructorDescriptionprotected
CmdLineTool
(String commandName, Configuration configuration) protected
CmdLineTool
(Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
annotateInjectorCreationException
(com.google.inject.CreationException e) protected void
annotateInjectorExceptions
(Collection<com.google.inject.spi.Message> messages) protected static void
applySecuritySettings
(TLSProtocolsConfiguration configuration) protected void
beforeInjectorCreation
(Set<Plugin> plugins) Things that have to run before the guice injector is created.protected void
Things that have to run before thestartCommand()
method is being called.protected void
beforeStart
(TLSProtocolsConfiguration configuration, PathConfiguration pathConfiguration) Things that have to run before thestartCommand()
method is being called.protected Set<ServerStatus.Capability>
void
doRun
(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>
boolean
isDebug()
boolean
boolean
boolean
loadPlugins
(Path pluginPath, ChainingClassLoader chainingClassLoader) protected boolean
protected void
processConfiguration
(com.github.joschi.jadconfig.JadConfig jadConfig) void
run()
protected com.google.inject.Injector
Set up a separate injector, containing only the core configuration bindings.protected com.google.inject.Injector
setupInjector
(com.google.inject.Module... modules) protected org.apache.logging.log4j.Level
protected abstract void
protected boolean
Validate 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:
true
if 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) -
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
-