Class BaseKeyStoreCommand

java.lang.Object
org.elasticsearch.cli.Command
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable
Direct Known Subclasses:
UpgradeKeyStoreCommand

public abstract class BaseKeyStoreCommand
extends KeyStoreAwareCommand
  • Field Summary

    Fields inherited from class org.elasticsearch.cli.KeyStoreAwareCommand

    MAX_PASSPHRASE_LENGTH

    Fields inherited from class org.elasticsearch.cli.Command

    description, parser
  • 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 initialized Environment.
    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

    Methods inherited from class org.elasticsearch.cli.Command

    addShutdownHook, close, exit, main, printAdditionalHelp

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.Exception
      Description copied from class: EnvironmentAwareCommand
      Execute the command with the initialized Environment.
      Specified by:
      execute in class KeyStoreAwareCommand
      Throws:
      java.lang.Exception
    • getKeyStore

      protected KeyStoreWrapper getKeyStore()
    • getKeyStorePassword

      protected SecureString getKeyStorePassword()
    • executeCommand

      protected abstract void executeCommand​(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, Environment env) throws java.lang.Exception
      This 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 extending BaseKeyStoreCommand using getKeyStore() and getKeyStorePassword() respectively.
      Throws:
      java.lang.Exception