com.paypal.base
Class ConfigManager

java.lang.Object
  extended by com.paypal.base.ConfigManager

public final class ConfigManager
extends Object

ConfigManager loads configuration from 'sdk_config.properties' file found in the classpath. There are certain default parameters that the system chooses to use if not seen a part of the configuration. They are enumerated below with the defaults is parenthesis http.ConnectionTimeOut(5000 ms), http.Retry(2), http.ReadTimeOut(30000 ms), http.MaxConnections(100), http.IPAddress(127.0.0.1), http.GoogleAppEngine(false)


Method Summary
static Properties combineDefaultProperties(Properties receivedProperties)
          Combines some Properties with Default Properties
 Map<String,String> getConfigurationMap()
          Constructs a Map object from the underlying Properties.
static Properties getDefaultProperties()
          Returns the Default Properties of System Configuration
static Map<String,String> getDefaultSDKMap()
          Returns a Map view of Default Properties
static ConfigManager getInstance()
          Singleton accessor method
 Set<String> getNumOfAcct()
          Deprecated.  
 String getValue(String key)
          Deprecated.  
 Map<String,String> getValuesByCategory(String category)
          Deprecated.  
 String getValueWithDefault(String key, String defaultValue)
          Deprecated.  
 boolean isPropertyLoaded()
          Deprecated.  
 void load(InputStream is)
          Deprecated. use PayPalResource.initConfig() instead
 void load(Properties properties)
          Deprecated. use PayPalResource.initConfig() instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConfigManager getInstance()
Singleton accessor method

Returns:
ConfigManager object

getDefaultProperties

public static Properties getDefaultProperties()
Returns the Default Properties of System Configuration

Returns:
Default Properties

getDefaultSDKMap

public static Map<String,String> getDefaultSDKMap()
Returns a Map view of Default Properties

Returns:
Map view of Default Properties

combineDefaultProperties

public static Properties combineDefaultProperties(Properties receivedProperties)
Combines some Properties with Default Properties

Parameters:
receivedProperties - Properties used to combine with Default Properties
Returns:
Combined Properties

load

public void load(InputStream is)
          throws IOException
Deprecated. use PayPalResource.initConfig() instead

Loads the internal properties with the passed InputStream

Parameters:
is - InputStream
Throws:
IOException

load

public void load(Properties properties)
Deprecated. use PayPalResource.initConfig() instead

Initializes the internal properties with the passed Properties instance

Parameters:
properties - Properties instance

getConfigurationMap

public Map<String,String> getConfigurationMap()
Constructs a Map object from the underlying Properties. The Properties object is loaded for 'sdk_config.properties' file in the classpath

Returns:
Map

getValue

public String getValue(String key)
Deprecated. 

Returns a value for the corresponding key

Parameters:
key - String key
Returns:
String value

getValueWithDefault

public String getValueWithDefault(String key,
                                  String defaultValue)
Deprecated. 

Mimics the call to Properties.getProperty(key, defaultValue)

Parameters:
key - String key to search in properties file
defaultValue - Default value to be sent in case of a miss
Returns:
String value corresponding to the key or default value

getValuesByCategory

public Map<String,String> getValuesByCategory(String category)
Deprecated. 

Gets all the values in the particular category in configuration (eg: acct)

Parameters:
category -
Returns:
Map

getNumOfAcct

public Set<String> getNumOfAcct()
Deprecated. 

Returns the key prefixes for all configured accounts

Returns:
Set of Accounts

isPropertyLoaded

public boolean isPropertyLoaded()
Deprecated. 

Returns:


Copyright © 2015. All Rights Reserved.