com.bbn.swede.core.libraries
Interface IConfiguration

All Known Implementing Classes:
AbstractConfiguration

public interface IConfiguration

Classes which implement this interface represent a meta-data store. String values are associated with keys, and can be separated into two mutually exclusive categories, System and User properties. Implementers are expected to extend this interface to specify accessors and mutators for domain-specific configuration options.

Author:
aperezlo

Field Summary
static String SYSTEM_SUFFIX
          Suffix used for all system property keys in Ontology Library metadata.
static String USER_SUFFIX
          Suffix used for all user property keys in Ontology Library metadata.
 
Method Summary
 String getName()
          Retrieves the name of this configuration object.
 Properties getProperties()
          This method is used to get System and User properties in a single operation.
 IConfigurationValidator getPropertiesValidator()
          Returns an IConfigurationValidator object capable of validating this IConfiguration object.
 Properties getSystemProperties()
          Retrieves all system properties for this configuration.
 String getSystemProperty(String key)
          Accessor method to get a System property.
 Properties getUserProperties()
          Retrieves all user properties for this configuration.
 String getUserProperty(String key)
          Accessor method to get a User property.
 void load(InputStream arg0)
          Loads a set of System and User properties from a file.
 void removeSystemProperty(String key)
          Mutator method to remove a System property.
 void removeUserProperty(String key)
          Mutator method to remove a User property.
 void setProperties(Properties p)
          This method is used to set System and User properties in a single operation.
 void setSystemProperties(Properties p)
          Mutator method for IConfiguration.
 void setSystemProperty(String key, String value)
          Mutator method to set a System property.
 void setUserProperties(Properties p)
          Mutator method for IConfiguration.
 void setUserProperty(String key, String value)
          Mutator method to set a User property.
 void store(OutputStream arg0, String arg1)
          Stores a set of System and User properties in a file.
 

Field Detail

USER_SUFFIX

public static final String USER_SUFFIX
Suffix used for all user property keys in Ontology Library metadata.

See Also:
Constant Field Values

SYSTEM_SUFFIX

public static final String SYSTEM_SUFFIX
Suffix used for all system property keys in Ontology Library metadata.

See Also:
Constant Field Values
Method Detail

getSystemProperties

public Properties getSystemProperties()
Retrieves all system properties for this configuration.

Returns:
a Properties class containing all of the System properties.

getUserProperties

public Properties getUserProperties()
Retrieves all user properties for this configuration.

Returns:
a Properties class containing all of the User properties.

setSystemProperties

public void setSystemProperties(Properties p)
Mutator method for IConfiguration.

Parameters:
p - a Properties containing all of the System properties

setUserProperties

public void setUserProperties(Properties p)
Mutator method for IConfiguration.

Parameters:
p - a Properties containing all of the User properties

setProperties

public void setProperties(Properties p)
This method is used to set System and User properties in a single operation. The method by which this is accomplished is specific to the implementation of the interface.

Parameters:
p - a single Properties object containing all of the System and User properties.

getProperties

public Properties getProperties()
This method is used to get System and User properties in a single operation. The method by which this is accomplished is specific to the implementation of the interface.

Returns:
p a single Properties object containing all of the System and User properties.

setSystemProperty

public void setSystemProperty(String key,
                              String value)
Mutator method to set a System property.

Parameters:
key - the key
value - the value associated with key

getSystemProperty

public String getSystemProperty(String key)
Accessor method to get a System property.

Parameters:
key - the key
Returns:
value the value associated with key

removeSystemProperty

public void removeSystemProperty(String key)
Mutator method to remove a System property.

Parameters:
key - the key to remove from the System properties

setUserProperty

public void setUserProperty(String key,
                            String value)
Mutator method to set a User property.

Parameters:
key - the key
value - the value associated with key

getUserProperty

public String getUserProperty(String key)
Accessor method to get a User property.

Parameters:
key - the key
Returns:
value the value associated with key

removeUserProperty

public void removeUserProperty(String key)
Mutator method to remove a User property.

Parameters:
key - the key to be removed from the User properties

load

public void load(InputStream arg0)
          throws IOException
Loads a set of System and User properties from a file. The behaviour of this method mimics that of Properties.load(java.io.InputStream).

Parameters:
arg0 - The input stream
Throws:
IOException - if an error occured when reading from the input stream
See Also:
Properties.load(java.io.InputStream)

store

public void store(OutputStream arg0,
                  String arg1)
           throws IOException
Stores a set of System and User properties in a file. The behaviour of this method mimics that of Properties.store(java.io.OutputStream, java.lang.String).

Parameters:
arg0 - A property stream
arg1 - A description of the property list
Throws:
IOException - if an error occurred writing to the output stream
See Also:
Properties.store(java.io.OutputStream, java.lang.String)

getName

public String getName()
Retrieves the name of this configuration object.

Returns:
The name

getPropertiesValidator

public IConfigurationValidator getPropertiesValidator()
Returns an IConfigurationValidator object capable of validating this IConfiguration object.

Returns:
an appropriate IConfigurationValidator object


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.