org.eclipse.actf.core.config
Interface IConfiguration

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractConfiguration, EclipseConfiguration, HybridConfiguraton, XmlConfiguration

public interface IConfiguration
extends Serializable

interface to embody overall settings and parameters for the validation process. Implementations of this interface will build configuration objects from a variety of sources such as files on the file system, serialized data, database queries, and the like.

ACTF configuration instances consist of symbol pools, each pool containing a set of symbols and their corresponding values. There are two types of symbol pools:

Note: Clients who wish to form configuration instances from other sources than the default source (i.e. xml files) should extend AbstractConfiguration rather than implementing this interface. Also, the RuntimeContextFactory should always be used to instantiate configuration objects.

Important: The current implementations packaged with ACTF are not thread-safe.

Author:
Mike Squillace
See Also:
AbstractConfiguration, XmlConfiguration, RuntimeContextFactory

Field Summary
static String ACTF_ID
          pool id for main actf pool - value is 'actf'
static String ALIASES_ID
           
static String FILTER_CLASSNAME_ATTRIBUTE
           
static String FILTER_ID
           
static String FILTER_MODEL_ATTRIBUTE
           
static String FILTER_NODEIDS_ATTRIBUTE
           
static String FILTER_NODENAMES_ATTRIBUTE
           
static String FILTER_NODETYPES_ATTRIBUTE
           
static String MODEL_ADAPTOR_FACTORY
           
static String MODEL_BASE_TYPE
           
static String MODEL_ID
          pool id and model pool id for models - value is 'model'
static String MODEL_IGNOREIDS
           
static String MODEL_IGNORENODENAMES
           
static String MODEL_LOCATOR
           
static String MODEL_LOCATORIDS_POOL
           
static char MODEL_POOL_ID_DELIMITER
          model pool ids are denoted with the model name followed by this delimiter followed by the actual pool id
static long serialVersionUID
           
static String SHOW_INVISIBLE_KEY
           
static String SHOW_ITEMS_KEY
           
static String TRACE_LEVEL_KEY
           
static String TRACE_STREAM_KEY
           
static String WORKING_DIR_KEY
           
 
Method Summary
 void addConfigurationData(Object data)
          add data to this configuration object
 boolean getBooleanParameter(String key)
          retrieve a boolean parameter from the current symbol pool
 Class getClassParameter(String key)
          retrieve a class parameter from the current symbol pool
 double getDoubleParameter(String key)
          retrieve a double parameter from the current symbol pool
 int getIntParameter(String key)
          retrieve an int parameter from the current symbol pool
 String[] getModelTypes()
          returns the model supported within this configuration object.
 Object getParameter(String key)
          get a parameter of an undetermined type in the current symbol pool
 String getParameterAsString(String key)
          get the parameter with the given key as a string
 String[] getParameterNames()
          retrieve list of parameters from the current symbol pool
 String getStringParameter(String key)
          retrieve a string parameter from the current symbol pool
 String getSymbolPool()
          get the current symbol pool.
 Map getSymbolPoolContents(String poolID)
          get the contents of the specified symbol pool
 String[] getSymbolPools()
          get all available symbol pools.
 void setParameter(String key, boolean val)
          set a boolean parameter in the current symbol pool
 void setParameter(String key, Class val)
          set a class parameter in the current symbol pool
 void setParameter(String key, double val)
          set a double parameter in the current symbol pool
 void setParameter(String key, int val)
          set an int parameter in the current symbol pool
 void setParameter(String key, Object val)
          set a parameter of an undetermined type in the current symbol pool
 void setParameter(String key, String val)
          set a string parameter in the current symbol pool
 void setSymbolPool(String id)
          set the symbol pool to be used in subsequent set/getParameter calls.
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

MODEL_POOL_ID_DELIMITER

static final char MODEL_POOL_ID_DELIMITER
model pool ids are denoted with the model name followed by this delimiter followed by the actual pool id

See Also:
Constant Field Values

MODEL_ID

static final String MODEL_ID
pool id and model pool id for models - value is 'model'

See Also:
Constant Field Values

ACTF_ID

static final String ACTF_ID
pool id for main actf pool - value is 'actf'

See Also:
Constant Field Values

WORKING_DIR_KEY

static final String WORKING_DIR_KEY
See Also:
Constant Field Values

TRACE_LEVEL_KEY

static final String TRACE_LEVEL_KEY
See Also:
Constant Field Values

TRACE_STREAM_KEY

static final String TRACE_STREAM_KEY
See Also:
Constant Field Values

MODEL_LOCATORIDS_POOL

static final String MODEL_LOCATORIDS_POOL
See Also:
Constant Field Values

MODEL_ADAPTOR_FACTORY

static final String MODEL_ADAPTOR_FACTORY
See Also:
Constant Field Values

MODEL_IGNORENODENAMES

static final String MODEL_IGNORENODENAMES
See Also:
Constant Field Values

MODEL_IGNOREIDS

static final String MODEL_IGNOREIDS
See Also:
Constant Field Values

MODEL_LOCATOR

static final String MODEL_LOCATOR
See Also:
Constant Field Values

MODEL_BASE_TYPE

static final String MODEL_BASE_TYPE
See Also:
Constant Field Values

SHOW_INVISIBLE_KEY

static final String SHOW_INVISIBLE_KEY
See Also:
Constant Field Values

SHOW_ITEMS_KEY

static final String SHOW_ITEMS_KEY
See Also:
Constant Field Values

FILTER_ID

static final String FILTER_ID
See Also:
Constant Field Values

FILTER_MODEL_ATTRIBUTE

static final String FILTER_MODEL_ATTRIBUTE
See Also:
Constant Field Values

FILTER_CLASSNAME_ATTRIBUTE

static final String FILTER_CLASSNAME_ATTRIBUTE
See Also:
Constant Field Values

FILTER_NODENAMES_ATTRIBUTE

static final String FILTER_NODENAMES_ATTRIBUTE
See Also:
Constant Field Values

FILTER_NODEIDS_ATTRIBUTE

static final String FILTER_NODEIDS_ATTRIBUTE
See Also:
Constant Field Values

FILTER_NODETYPES_ATTRIBUTE

static final String FILTER_NODETYPES_ATTRIBUTE
See Also:
Constant Field Values

ALIASES_ID

static final String ALIASES_ID
See Also:
Constant Field Values
Method Detail

setSymbolPool

void setSymbolPool(String id)
set the symbol pool to be used in subsequent set/getParameter calls. A symbol pool embodies a purpose or role in the ACTF engine. Instances of this interface might represent a particular symbol pool by a .properties file, data base table, or XML document.

Symbol pool ids can have two forms:


getSymbolPool

String getSymbolPool()
get the current symbol pool. The returned value is the id of the pool that is currently be accessed by any get/setXXXParameter methods.

Returns:
current symbol pool id
See Also:
setSymbolPool(String)

getSymbolPools

String[] getSymbolPools()
get all available symbol pools.

Returns:
array of ids for all available symbol pools or empty array if no pools have been created other than the default pool
See Also:
setSymbolPool(String)

getSymbolPoolContents

Map getSymbolPoolContents(String poolID)
get the contents of the specified symbol pool

Parameters:
poolID - - id of symbol pool
Returns:
map containing contents of pool or null if pool does not exist
See Also:
setSymbolPool(String)

getStringParameter

String getStringParameter(String key)
retrieve a string parameter from the current symbol pool

Parameters:
key - - name or key of parameter
Returns:
string parameter with the given name or null if no such key exists
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  String val)
set a string parameter in the current symbol pool

Parameters:
key - - name of parameter
val - - string value corresponding to this key
See Also:
setSymbolPool(String)

getIntParameter

int getIntParameter(String key)
retrieve an int parameter from the current symbol pool

Parameters:
key - - name or key of parameter
Returns:
int parameter with the given name or null if no such key exists
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  int val)
set an int parameter in the current symbol pool

Parameters:
key - - name of parameter
val - - int value corresponding to this key
See Also:
setSymbolPool(String)

getDoubleParameter

double getDoubleParameter(String key)
retrieve a double parameter from the current symbol pool

Parameters:
key - - name or key of parameter
Returns:
double parameter with the given name or null if no such key exists
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  double val)
set a double parameter in the current symbol pool

Parameters:
key - - name of parameter
val - - double value corresponding to this key
See Also:
setSymbolPool(String)

getBooleanParameter

boolean getBooleanParameter(String key)
retrieve a boolean parameter from the current symbol pool

Parameters:
key - - name or key of parameter
Returns:
boolean parameter with the given name or null if no such key exists
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  boolean val)
set a boolean parameter in the current symbol pool

Parameters:
key - - name of parameter
val - - boolean value corresponding to this key
See Also:
setSymbolPool(String)

getClassParameter

Class getClassParameter(String key)
retrieve a class parameter from the current symbol pool

Parameters:
key - - name or key of parameter
Returns:
class parameter with the given name or null if no such key exists
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  Class val)
set a class parameter in the current symbol pool

Parameters:
key - - name of parameter
val - - Class object corresponding to this key
See Also:
setSymbolPool(String)

setParameter

void setParameter(String key,
                  Object val)
set a parameter of an undetermined type in the current symbol pool

Parameters:
key - - name of parameter
val - - object corresponding to this key
See Also:
setSymbolPool(String)

getParameter

Object getParameter(String key)
get a parameter of an undetermined type in the current symbol pool

Parameters:
key - - name of parameter to retrieve
Returns:
desired parameter
See Also:
setSymbolPool(String)

getParameterNames

String[] getParameterNames()
retrieve list of parameters from the current symbol pool

Returns:
list of parameters or empty array if no parameters exist
See Also:
setSymbolPool(String)

getParameterAsString

String getParameterAsString(String key)
get the parameter with the given key as a string

Parameters:
key - - key of desired parameter
Returns:
string representation of parameter or null if parameter is not found
See Also:
setSymbolPool(String)

getModelTypes

String[] getModelTypes()
returns the model supported within this configuration object. ACTF is packaged with support for the following model:

Models are always introduced in the main symbol pool, ACTF_ID and should be retrieved via the MODEL_ID symbol pool. Indeed, this method will usually be short-hand for:

 setSymbolPool(MODEL_ID);
 return getParameterNames();
 

Returns:
names of supported model
See Also:
getParameterNames(), setSymbolPool(String)

addConfigurationData

void addConfigurationData(Object data)
                          throws ConfigurationException
add data to this configuration object

Parameters:
data - the data to be added
Throws:
ConfigurationException