Class AdminAccessBuilderSpec


  • public class AdminAccessBuilderSpec
    extends Object
    A specification of a AdminAccess.Builder configuration.

    AdminAccess.Builder supports parsing configuration off of a string, which makes it especially useful for command-line configuration of a AdminAccess.Builder.

    The string syntax is a series of comma-separated keys or key-value pairs, each corresponding to a AdminAccess.Builder method.

    Whitespace before and after commas and equal signs is ignored. Keys may not be repeated and both private key and public key must be passed through files, as they might include weird characters.

    AdminAccessBuilderSpec does not support configuring AdminAccess.Builder methods with non-value parameters. These must be configured in code.

    A new AdminAccess.Builder can be instantiated from a AdminAccessBuilderSpec using AdminAccess.Builder.from(AdminAccessBuilderSpec) or AdminAccess.Builder.from(String).

    Design inspired by CacheBuilderSpec

    Since:
    1.5
    • Field Detail

      • KEYS_SPLITTER

        protected static final com.google.common.base.Splitter KEYS_SPLITTER
        Splits each key-value pair.
      • KEY_VALUE_SPLITTER

        protected static final com.google.common.base.Splitter KEY_VALUE_SPLITTER
        Splits the key from the value.
      • specifications

        protected transient String[] specifications
        Specification; used for toParseableString().
    • Constructor Detail

      • AdminAccessBuilderSpec

        protected AdminAccessBuilderSpec()
      • AdminAccessBuilderSpec

        protected AdminAccessBuilderSpec​(String... specifications)
    • Method Detail

      • parse

        public static AdminAccessBuilderSpec parse​(String adminAccessSpecification)
        Creates a AdminAccessBuilderSpec from multiple specifications,
        Parameters:
        adminAccessSpecification - the string form
      • toParsableStrings

        public String[] toParsableStrings()
        Returns a string that can be used to parse an equivalent AdminAccessSpec. The order and form of this representation is not guaranteed, except that reparsing its output will produce a AdminAccessSpec equal to this instance.
      • toString

        public String toString()
        Returns a string representation for this AdminAccessSpec instance. The form of this representation is not guaranteed.
        Overrides:
        toString in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getAdminUsername

        public String getAdminUsername()
      • getAdminHome

        public String getAdminHome()
      • getAdminPublicKeyFile

        public File getAdminPublicKeyFile()
      • getAdminPrivateKeyFile

        public File getAdminPrivateKeyFile()
      • getAdminPassword

        public String getAdminPassword()
      • getLoginPassword

        public String getLoginPassword()
      • getLockSsh

        public Boolean getLockSsh()
      • getGrantSudoToAdminUser

        public Boolean getGrantSudoToAdminUser()
      • getInstallAdminPrivateKey

        public Boolean getInstallAdminPrivateKey()
      • getResetLoginPassword

        public Boolean getResetLoginPassword()