org.globus.gridshib.config
Class BootstrapConfigLoader

java.lang.Object
  extended by org.globus.gridshib.config.BootstrapConfigLoader

public class BootstrapConfigLoader
extends Object

A bootstrap properties file provides bootstrap configuration options to GridShib SAML Tools at startup. The following bootstrap properties are defined:

  1. gridshib.logConfigPath
  2. gridshib.SAMLToolsConfigPath
  3. gridshib.certPath
  4. gridshib.keyPath
  5. gridshib.identityAttributesPath
  6. gridshib.cogConfigPath
  7. gridshib.SecurityContextImpl
See the GridShib SAML Tools Installation Notes for definitions of each bootstrap property and background reading regarding the bootstrap properties file.

This BootstrapConfigLoader attempts to load a bootstrap properties file automatically. The file is obtained in one of three ways (checked in order):

  1. Check the system property org.globus.gridshib.config for a (system dependent) absolute path to a bootstrap properties file
  2. Check for file $HOME/.globus/gridshib-bootstrap.properties on UNIX systems (or %USERPROFILE%\.globus\gridshib-bootstrap.properties on Windows systems)
  3. Check for resource /org/globus/gridshib/resource/gridshib-bootstrap.properties on the classpath
A default bootstrap properties file is created at install time and bundled with the gridshib-saml-tools JAR file. Thus step 3 is guaranteed to succeed in a source deployment of GridShib SAML Tools. In the case of a binary deployment, one approach is to use System.setProperty(String,String) to set the system property org.globus.gridshib.config before this class is initialized. See the GridShib SAML Tools Developer Guide for additional information.

Once loaded, the BootstrapConfigLoader class provides an API to override selected bootstrap properties.

Since:
0.4.0

Method Summary
static File getConfigFileDefault()
          Get the current value of the gridshib.SAMLToolsConfigPath bootstrap property.
static GlobusCredential getCredentialDefault()
          Get the current default issuing credential.
static StringSetFile getIdentityAttributes()
          Get the identity attributes.
static String getKeyStoreKeyAliasDefault()
          Get the value of the gridshib.keyStoreKeyAlias bootstrap property.
static char[] getKeyStoreKeyPasswordDefault()
          Get the value of the gridshib.keyStoreKeyPassword bootstrap property.
static char[] getKeyStorePasswordDefault()
          Get the value of the gridshib.keyStorePassword bootstrap property.
static String getKeyStorePathDefault()
          Get the value of the gridshib.keyStorePath bootstrap property.
static String getLogConfigPathDefault()
          Get the current value of the gridshib.logConfigPath bootstrap property.
static String getProperty(Properties props, String propName)
          Gets the value of a GridShib Tool config property.
static String getProperty(Properties props, String propName, String propValueDefault)
          Gets the value of a GridShib Tool config property.
static String getSecurityContextImpl()
          Get the value of the gridshib.SecurityContextImpl bootstrap property.
static void setCoGConfigPathDefault(String cogConfigPath)
          Store the given path in the "org.globus.config.file" system property.
static void setConfigFileDefault(String configPath)
          Deprecated. As of 0.4.3, use SAMLToolsConfigLoader.getToolConfig(File) or SAMLToolsConfigLoader.load(File) or GlobusSAMLCredential.setDefaultConfigFile(String) instead. This method will be removed in a future version of GridShib SAML Tools.
static void setCredentialDefault(GlobusCredential cred)
          Deprecated. As of 0.4.3, use BasicConfig.setCredential(GlobusCredential) or GlobusSAMLCredential.setDefaultCredential(GlobusCredential) instead. This method will be removed in a future version of GridShib SAML Tools.
static void setLogConfigPathDefault(String logConfigPath)
          Set the path to the default log4j properties file and configure the logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLogConfigPathDefault

public static void setLogConfigPathDefault(String logConfigPath)
Set the path to the default log4j properties file and configure the logger. If the given path is relative and GRIDSHIB_HOME is not null, the path is resolved relative to GRIDSHIB_HOME.

Parameters:
logConfigPath - the path to a log4j properties file

setConfigFileDefault

public static void setConfigFileDefault(String configPath)
Deprecated. As of 0.4.3, use SAMLToolsConfigLoader.getToolConfig(File) or SAMLToolsConfigLoader.load(File) or GlobusSAMLCredential.setDefaultConfigFile(String) instead. This method will be removed in a future version of GridShib SAML Tools.

Set the default config file. If the given path is relative and GRIDSHIB_HOME is not null, the path is resolved relative to GRIDSHIB_HOME.

Parameters:
configPath - the path to a GridShib SAML Tools configuration properties file

setCredentialDefault

public static void setCredentialDefault(GlobusCredential cred)
Deprecated. As of 0.4.3, use BasicConfig.setCredential(GlobusCredential) or GlobusSAMLCredential.setDefaultCredential(GlobusCredential) instead. This method will be removed in a future version of GridShib SAML Tools.

Set the default issuing credential.

Parameters:
cred - the default issuing credential

setCoGConfigPathDefault

public static void setCoGConfigPathDefault(String cogConfigPath)
Store the given path in the "org.globus.config.file" system property. If the given path is relative and GRIDSHIB_HOME is not null, the path is resolved relative to GRIDSHIB_HOME.

Parameters:
cogConfigPath - the path to a CoG properties file

getLogConfigPathDefault

public static String getLogConfigPathDefault()
Get the current value of the gridshib.logConfigPath bootstrap property.


getConfigFileDefault

public static File getConfigFileDefault()
Get the current value of the gridshib.SAMLToolsConfigPath bootstrap property.


getCredentialDefault

public static GlobusCredential getCredentialDefault()
Get the current default issuing credential.


getIdentityAttributes

public static StringSetFile getIdentityAttributes()
Get the identity attributes.

Since:
0.4.3

getKeyStorePathDefault

public static String getKeyStorePathDefault()
Get the value of the gridshib.keyStorePath bootstrap property. The Java KeyStore is used solely for testing purposes.

Since:
0.5.0

getKeyStorePasswordDefault

public static char[] getKeyStorePasswordDefault()
Get the value of the gridshib.keyStorePassword bootstrap property. The Java KeyStore is used solely for testing purposes.

Since:
0.5.0

getKeyStoreKeyAliasDefault

public static String getKeyStoreKeyAliasDefault()
Get the value of the gridshib.keyStoreKeyAlias bootstrap property. The Java KeyStore is used solely for testing purposes.

Since:
0.5.0

getKeyStoreKeyPasswordDefault

public static char[] getKeyStoreKeyPasswordDefault()
Get the value of the gridshib.keyStoreKeyPassword bootstrap property. The Java KeyStore is used solely for testing purposes.

Since:
0.5.0

getSecurityContextImpl

public static String getSecurityContextImpl()
Get the value of the gridshib.SecurityContextImpl bootstrap property. This becomes the default SecurityContext implementation in SecurityContextFactory.

Since:
0.5.0
See Also:
SecurityContextFactory

getProperty

public static String getProperty(Properties props,
                                 String propName)
                          throws GridShibConfigException
Gets the value of a GridShib Tool config property. This value is guaranteed to be non-null and nonempty.

Parameters:
props - the complete set of config properties
propName - the config property of interest
Returns:
the requested property value
Throws:
GridShibConfigException - if the property value is missing or empty

getProperty

public static String getProperty(Properties props,
                                 String propName,
                                 String propValueDefault)
Gets the value of a GridShib Tool config property.

Parameters:
props - the complete set of config properties
propName - the config property of interest
propValueDefault - the default config property value, which may be null
Returns:
the requested config property value or the default config property value if the requested property is not found


Copyright © 2007-2008 University of Illinois. All Rights Reserved.