Class BaseKeyStoreCommand
java.lang.Object
org.elasticsearch.cli.Command
org.elasticsearch.cli.EnvironmentAwareCommand
org.elasticsearch.cli.KeyStoreAwareCommand
org.elasticsearch.common.settings.BaseKeyStoreCommand
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
UpgradeKeyStoreCommand
public abstract class BaseKeyStoreCommand extends KeyStoreAwareCommand
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BaseKeyStoreCommand(java.lang.String description, boolean keyStoreMustExist)
-
Method Summary
Modifier and Type Method Description protected void
execute(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, Environment env)
Execute the command with the initializedEnvironment
.protected abstract void
executeCommand(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, Environment env)
This is called after the keystore password has been read from the stdin and the keystore is decrypted and loaded.protected KeyStoreWrapper
getKeyStore()
protected SecureString
getKeyStorePassword()
Methods inherited from class org.elasticsearch.cli.KeyStoreAwareCommand
decryptKeyStore, readPassword
Methods inherited from class org.elasticsearch.cli.EnvironmentAwareCommand
createEnv, createEnv, execute
-
Constructor Details
-
BaseKeyStoreCommand
public BaseKeyStoreCommand(java.lang.String description, boolean keyStoreMustExist)
-
-
Method Details
-
execute
protected final void execute(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, Environment env) throws java.lang.ExceptionDescription copied from class:EnvironmentAwareCommand
Execute the command with the initializedEnvironment
.- Specified by:
execute
in classKeyStoreAwareCommand
- Throws:
java.lang.Exception
-
getKeyStore
-
getKeyStorePassword
-
executeCommand
protected abstract void executeCommand(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, Environment env) throws java.lang.ExceptionThis is called after the keystore password has been read from the stdin and the keystore is decrypted and loaded. The keystore and keystore passwords are available to classes extendingBaseKeyStoreCommand
usinggetKeyStore()
andgetKeyStorePassword()
respectively.- Throws:
java.lang.Exception
-