FusionReactor API
v3.0.1

com.intergral.fusionreactor.api
Interface ConfigurationSurrogate


public interface ConfigurationSurrogate

This interface specifies the public members of a FusionReactor Configuration object.

Since:
2.0
Version:
3.0.1

Method Summary
 void applyChanges(Map changes)
          Apply a set of changes to this configuration object.
 void assertValidity()
          Check whether the currently loaded configuration is valid.
 Properties getAsProperties()
           
 boolean getBooleanValue(String name)
           
 boolean getBooleanValue(String name, boolean defaultValue)
           
 int getIntValue(String name)
           
 int getIntValue(String name, int defaultValue)
           
 Iterator getKeyIterator()
           
 String getStringValue(String name)
           
 String getStringValue(String name, String defaultValue)
           
 Iterator getValueIterator()
           
 int getVersion()
           
 void removeKey(String key)
          Remove a key from the configuration.
 void setValue(String key, String value)
          Insert a new configuration key/value into the store.
 

Method Detail

applyChanges

void applyChanges(Map changes)
Apply a set of changes to this configuration object. Any keys which do not exist are added, and any which exist are overwritten.

Parameters:
changes - the changes to apply.
Since:
2.0

assertValidity

void assertValidity()
                    throws ConfigurationInvalidExceptionSurrogate
Check whether the currently loaded configuration is valid.

Throws:
com.intergral.fusionreactor.config.ConfigurationInvalidException - if the configuration is not valid
ConfigurationInvalidExceptionSurrogate
Since:
2.0

getAsProperties

Properties getAsProperties()
Returns:
this configuration as a properties set
Since:
2.0

getBooleanValue

boolean getBooleanValue(String name,
                        boolean defaultValue)
Parameters:
name - the name of the value being sought
defaultValue - the default value to be returned if the named parameter was not found
Returns:
the value of the named parameter as a boolean value or the default if it was not found
Since:
2.0

getBooleanValue

boolean getBooleanValue(String name)
Parameters:
name - the name of the parameter being sought
Returns:
the value of the named parameter as a boolean primitive.
Since:
2.0

getIntValue

int getIntValue(String name,
                int defaultValue)
Parameters:
name - the key to be sought
defaultValue - the default value to be returned
Returns:
the specified value as an int, or the default value if the key is not found.
Since:
2.0

getIntValue

int getIntValue(String name)
                throws NumberFormatException,
                       NullPointerException
Returns:
the specified value as an int.
Throws:
NumberFormatException - if the given element could not be coerced to int (via Integer)
NullPointerException - if the key does not exist
Since:
2.0

getKeyIterator

Iterator getKeyIterator()
Returns:
an Iterator over set of configuration keys held by this object.
Since:
2.0

getStringValue

String getStringValue(String name,
                      String defaultValue)
Parameters:
name - the key to be sought
defaultValue - the default value to be returned
Returns:
a named string value, or defaultValue if the named value is not found
Since:
2.0

getStringValue

String getStringValue(String name)
Parameters:
name - the name of the value to be returned
Returns:
a named string value
Since:
2.0

getValueIterator

Iterator getValueIterator()
Returns:
an Iterator over all the values stored in this configuration
Since:
2.0

getVersion

int getVersion()
Returns:
the Configuration file version of this Configuration
Since:
2.0

removeKey

void removeKey(String key)
Remove a key from the configuration. N.b. this may leave the configuration in an invalid state.

Parameters:
key - the key to be removed from the configuration.
Since:
2.0

setValue

void setValue(String key,
              String value)
Insert a new configuration key/value into the store.

Parameters:
key - the name of the value being stored
value - the value being stored
Since:
2.0

FusionReactor API
v3.0.1

Copyright © 2005-2008 Intergral Information Solutions GmbH. All Rights Reserved.