org.globus.gridshib.config
Class SAMLToolsConfigLoader

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

public class SAMLToolsConfigLoader
extends Object

Configuration property file loader for the GridShib SAML Tools. This loader maintains a static SAML Tools configuration object that may be retrieved at any time using getToolConfig(). Calling load(File) or load(InputStream) initializes the configuration object with the loaded configuration properties. On the other hand, calling overlay(InputStream) overlays the current configuration object with the configuration properties on the input stream.

This loader performs the following optimizations. A configuration file loaded with load(File) is cached such that the next request to load the same file is short-circuited. Subsequent calls to load(InputStream) or overlay(InputStream) clear the cache, that is, the next call to load(File) is guaranteed not to short-circuit.

Since:
0.4.0

Method Summary
static SAMLToolsConfig getToolConfig()
          Gets the SAML Tools configuration object.
static SAMLToolsConfig getToolConfig(File defaultConfigFile)
          Gets the SAML Tools configuration object.
static void load()
          A convenience method that loads the default config file specified in the bootstrap properties file.
static void load(File configFile)
          Load the properties from the given config file.
static void load(InputStream in)
          Load the properties from the given input stream.
static void overlay(InputStream in)
          Overlays the config properties on the given input stream on top of the existing configuration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getToolConfig

public static SAMLToolsConfig getToolConfig()
                                     throws GridShibConfigException
Gets the SAML Tools configuration object. If the config object is null (which it is, initially), this method loads the default config file specified in the bootstrap properties file and returns the resulting config object. Thus this method is guaranteed to return a non-null config object.

Returns:
the (non-null) configuration object
Throws:
GridShibConfigException - if there was an error loading the default config file
See Also:
BootstrapConfigLoader.getConfigFileDefault()

getToolConfig

public static SAMLToolsConfig getToolConfig(File defaultConfigFile)
                                     throws GridShibConfigException
Gets the SAML Tools configuration object. If the config object is null (which it is, initially), this method loads the given config file and returns the resulting config object. Thus this method is guaranteed to return a non-null config object.

Parameters:
defaultConfigFile - a default config file to load if the configuration object is null
Returns:
the (non-null) configuration object
Throws:
GridShibConfigException - if there was an error loading the given config file
See Also:
BootstrapConfigLoader.getConfigFileDefault()

load

public static void load()
                 throws GridShibConfigException
A convenience method that loads the default config file specified in the bootstrap properties file.

Throws:
GridShibConfigException - if there was an error loading the default config file
Since:
0.4.3
See Also:
BootstrapConfigLoader.getConfigFileDefault()

load

public static void load(File configFile)
                 throws GridShibConfigException
Load the properties from the given config file. If the given config file is null, load the default config file specified in the bootstrap properties file.

Parameters:
configFile - the config file to be loaded
Throws:
GridShibConfigException - if there was an error loading the indicated config file
See Also:
BootstrapConfigLoader.getConfigFileDefault()

load

public static void load(InputStream in)
                 throws GridShibConfigException
Load the properties from the given input stream. In effect this method initializes the current config object with the loaded config properties.

This method clears the cache, that is, the next call to load(File) is guaranteed not to short-circuit.

Parameters:
in - an input stream of config properties
Throws:
GridShibConfigException - if there was an error loading the config properties on the input stream

overlay

public static void overlay(InputStream in)
                    throws GridShibConfigException
Overlays the config properties on the given input stream on top of the existing configuration object. Each property value defaults to the current property value, which in effect loads properties on top of existing properties.

If this method is called without previously loading any config properties, the effect is the same as calling load(InputStream).

This method clears the cache, that is, the next call to load(File) is guaranteed not to short-circuit.

Parameters:
in - an input stream of config properties
Throws:
GridShibConfigException - if there was an error loading the config properties on the input stream
Since:
0.4.3


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