public class AdminAccessBuilderSpec extends Object
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.
adminUsername=[String]
: sets AdminAccess.Builder.adminUsername
.
adminHome=[String]
: sets AdminAccess.Builder.adminHome
.
adminPublicKeyFile=[String]
: sets AdminAccess.Builder.adminPublicKeyFile
.
adminPrivateKeyFile=[String]
: sets AdminAccess.Builder.adminPrivateKeyFile
. *
adminPassword=[String]
: sets AdminAccess.Builder.adminPassword
.
loginPassword=[String]
: sets AdminAccess.Builder.loginPassword
.
lockSsh=[Boolean]
: sets TemplateBuilder#lockSsh
.
grantSudoToAdminUser=[Boolean]
: sets TemplateBuilder#grantSudoToAdminUser
.
authorizeAdminPublicKey=[Boolean]
: sets
TemplateBuilder#authorizeAdminPublicKey
.
installAdminPrivateKey=[Boolean]
: sets TemplateBuilder#installAdminPrivateKey
.
resetLoginPassword=[Boolean]
: sets TemplateBuilder#resetLoginPassword
.
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
Modifier and Type | Class and Description |
---|---|
protected static interface |
AdminAccessBuilderSpec.ValueParser
Parses a single value.
|
Modifier and Type | Field and Description |
---|---|
protected static com.google.common.base.Splitter |
KEY_VALUE_SPLITTER
Splits the key from the value.
|
protected static com.google.common.base.Splitter |
KEYS_SPLITTER
Splits each key-value pair.
|
protected String[] |
specifications
Specification; used for toParseableString().
|
protected static com.google.common.collect.ImmutableMap<String,AdminAccessBuilderSpec.ValueParser> |
VALUE_PARSERS
Map of names to ValueParser.
|
Modifier | Constructor and Description |
---|---|
protected |
AdminAccessBuilderSpec() |
protected |
AdminAccessBuilderSpec(String... specifications) |
Modifier and Type | Method and Description |
---|---|
AdminAccess.Builder |
copyTo(AdminAccess.Builder builder)
Returns a AdminAccess.Builder configured according to this instance's specification.
|
boolean |
equals(Object obj) |
String |
getAdminHome() |
String |
getAdminPassword() |
File |
getAdminPrivateKeyFile() |
File |
getAdminPublicKeyFile() |
String |
getAdminUsername() |
Boolean |
getGrantSudoToAdminUser() |
Boolean |
getInstallAdminPrivateKey() |
Boolean |
getLockSsh() |
String |
getLoginPassword() |
Boolean |
getResetLoginPassword() |
int |
hashCode() |
static AdminAccessBuilderSpec |
parse(String adminAccessSpecification)
Creates a AdminAccessBuilderSpec from multiple specifications,
|
String[] |
toParsableStrings()
Returns a string that can be used to parse an equivalent
AdminAccessSpec . |
String |
toString()
Returns a string representation for this AdminAccessSpec instance.
|
protected static final com.google.common.base.Splitter KEYS_SPLITTER
protected static final com.google.common.base.Splitter KEY_VALUE_SPLITTER
protected static final com.google.common.collect.ImmutableMap<String,AdminAccessBuilderSpec.ValueParser> VALUE_PARSERS
protected transient String[] specifications
protected AdminAccessBuilderSpec()
protected AdminAccessBuilderSpec(String... specifications)
public static AdminAccessBuilderSpec parse(String adminAccessSpecification)
adminAccessSpecification
- the string formpublic AdminAccess.Builder copyTo(AdminAccess.Builder builder)
public String[] toParsableStrings()
AdminAccessSpec
. The order
and form of this representation is not guaranteed, except that reparsing its output will
produce a AdminAccessSpec
equal to this instance.public String toString()
public String getAdminUsername()
public String getAdminHome()
public File getAdminPublicKeyFile()
public File getAdminPrivateKeyFile()
public String getAdminPassword()
public String getLoginPassword()
public Boolean getLockSsh()
public Boolean getGrantSudoToAdminUser()
public Boolean getInstallAdminPrivateKey()
public Boolean getResetLoginPassword()
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.