org.jclouds.scriptbuilder.statements.login
Class AdminAccessBuilderSpec

java.lang.Object
  extended by org.jclouds.scriptbuilder.statements.login.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

Nested Class Summary
protected static interface AdminAccessBuilderSpec.ValueParser
          Parses a single value.
 
Field Summary
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.
 
Constructor Summary
protected AdminAccessBuilderSpec()
           
protected AdminAccessBuilderSpec(String... specifications)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.


VALUE_PARSERS

protected static final com.google.common.collect.ImmutableMap<String,AdminAccessBuilderSpec.ValueParser> VALUE_PARSERS
Map of names to ValueParser.


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

copyTo

public AdminAccess.Builder copyTo(AdminAccess.Builder builder)
Returns a AdminAccess.Builder configured according to this instance's specification.


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

equals

public boolean equals(Object obj)
Overrides:
equals 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()


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.