com.cloudbees.sdk
Class UserConfiguration

java.lang.Object
  extended by com.cloudbees.sdk.UserConfiguration

public class UserConfiguration
extends Object

Injectable component that encapsulates the user configuration and its persistence to ~/.bees/bees.config

Parameters vs Config properties

For historical reasons, the code distinguishes "config properties" and "parameters." Both are string->string key/value pairs, and both captures various aspects of how we talk to CloudBees backend, but for reasons beyond me, they use different key names to represent the same thing. For example, "config properties" would have "bees.api.key" for API key, whereas "parameters" would use "key".

"config properties" are tied to the persisted ~/.bees/bees.config whereas parameters appear to be transient within one invocation.

There's no constants defined for any of those keys.

Most likely this is unintended technical debt over time, but for the time being I'm not touching it. I recommend unifying them to consistently use "config properties" key names.

Author:
Kohsuke Kawaguchi

Field Summary
static int EMAIL_CREDENTIALS
           
static int KEYS_CREDENTIALS
           
 
Constructor Summary
UserConfiguration()
           
 
Method Summary
 Properties create(int credentialType, Map<String,String> paramaters)
          Creates a new configuration file.
 File getConfigFile()
           
 Properties load(int credentialType, Map<String,String> parameters)
          Loads the configuration, by creating it if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL_CREDENTIALS

public static int EMAIL_CREDENTIALS

KEYS_CREDENTIALS

public static int KEYS_CREDENTIALS
Constructor Detail

UserConfiguration

public UserConfiguration()
Method Detail

load

public Properties load(int credentialType,
                       Map<String,String> parameters)
Loads the configuration, by creating it if necessary.

Parameters:
parameters - used only if we are to create configuration.

getConfigFile

public File getConfigFile()

create

public Properties create(int credentialType,
                         Map<String,String> paramaters)
Creates a new configuration file.



Copyright © 2011-2013. All Rights Reserved.