org.jclouds.domain
Class LoginCredentials

java.lang.Object
  extended by org.jclouds.domain.Credentials
      extended by org.jclouds.domain.LoginCredentials

public class LoginCredentials
extends Credentials

Author:
Adrian Cole

Nested Class Summary
static class LoginCredentials.Builder
           
 
Field Summary
 
Fields inherited from class org.jclouds.domain.Credentials
credential, identity, NO_CREDENTIALS
 
Constructor Summary
LoginCredentials(String username, boolean authenticateSudo)
           
LoginCredentials(String username, com.google.common.base.Optional<String> password, com.google.common.base.Optional<String> privateKey, boolean authenticateSudo)
           
LoginCredentials(String username, String password, String privateKey, boolean authenticateSudo)
           
 
Method Summary
static LoginCredentials.Builder builder()
           
static LoginCredentials.Builder builder(Credentials creds)
           
static LoginCredentials fromCredentials(Credentials creds)
           
 com.google.common.base.Optional<String> getOptionalPassword()
           
 com.google.common.base.Optional<String> getOptionalPrivateKey()
           
 String getPassword()
           
 String getPrivateKey()
           
 String getUser()
           
 boolean hasPassword()
           
 boolean hasPasswordOption()
           
 boolean hasPrivateKey()
           
 boolean hasPrivateKeyOption()
           
 boolean shouldAuthenticateSudo()
          secures access to root requires a password.
 LoginCredentials.Builder toBuilder()
           
 String toString()
           
 
Methods inherited from class org.jclouds.domain.Credentials
equals, hashCode, parse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoginCredentials

public LoginCredentials(String username,
                        boolean authenticateSudo)

LoginCredentials

public LoginCredentials(String username,
                        @Nullable
                        String password,
                        @Nullable
                        String privateKey,
                        boolean authenticateSudo)

LoginCredentials

public LoginCredentials(String username,
                        @Nullable
                        com.google.common.base.Optional<String> password,
                        @Nullable
                        com.google.common.base.Optional<String> privateKey,
                        boolean authenticateSudo)
Method Detail

fromCredentials

public static LoginCredentials fromCredentials(Credentials creds)

builder

public static LoginCredentials.Builder builder(Credentials creds)

builder

public static LoginCredentials.Builder builder()

getUser

public String getUser()
Returns:
the login user

hasPassword

public boolean hasPassword()
Returns:
true if a password is available

hasPasswordOption

public boolean hasPasswordOption()
Returns:
true if a password was set

getPassword

@Nullable
public String getPassword()
Returns:
the password of the login user or null

getOptionalPassword

@Nullable
public com.google.common.base.Optional<String> getOptionalPassword()
Returns:
the optional password of the user or null

hasPrivateKey

public boolean hasPrivateKey()
Returns:
true if a private key is available

hasPrivateKeyOption

public boolean hasPrivateKeyOption()
Returns:
true if a password was set

getPrivateKey

@Nullable
public String getPrivateKey()
Returns:
the private ssh key of the user or null

getOptionalPrivateKey

@Nullable
public com.google.common.base.Optional<String> getOptionalPrivateKey()
Returns:
the optional private ssh key of the user or null

shouldAuthenticateSudo

public boolean shouldAuthenticateSudo()
secures access to root requires a password. This password is required to access either the console or run sudo as root.

ex. echo 'password' |sudo -S command

Returns:
if a password is required to access the root user

toBuilder

public LoginCredentials.Builder toBuilder()
Overrides:
toBuilder in class Credentials

toString

public String toString()
Overrides:
toString in class Credentials


Copyright © 2009-2012 jclouds. All Rights Reserved.