BEA Systems, Inc.

com.connecterra.ale.dynamicconfig.api
Class PluginConfig

java.lang.Object
  extended by com.connecterra.ale.dynamicconfig.api.PluginConfig

public abstract class PluginConfig
extends Object

Models plugin instance in the edge server. Includes:


Constructor Summary
PluginConfig()
           
 
Method Summary
 void addParameter(PluginConfigParameter pluginConfigParameter)
          Adds a PluginConfigParameter representing a configuration parameter value of the plugin.
 Boolean getBooleanValue(String paramKey)
          Convenience method to get boolean value of a given parameter.
abstract  String getMetaKeyName()
          Returns the key name of the PluginMeta that describes the plugin.
abstract  String getName()
          Returns the name of the plugin instance.
 Long getNumericValue(String paramKey)
          Convenience method to get long value of a given parameter.
 PluginConfigParameter getParameter(String keyName)
          Finds and returns PluginConfigParameter with the specified key name.
 List getParameterList()
          Returns a list of PluginConfigParameter containing the configuration parameter values for the plugin.
abstract  String getRole()
          Returns the PluginMeta.Role to which the plugin belongs.
 List getStringListValue(String paramKey)
          Convenience method to get string list value of a given parameter.
 String getStringValue(String paramKey)
          Convenience method to get the string value of a given parameter.
 String getStringValue(String subConfigKey, String paramKey)
          Convenience method to get the string value of a given parameter within a subconfiguration.
 void setParameterList(List parameterList)
          Specifies the configuration parameter values of the plugin as a list of PluginConfigParameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginConfig

public PluginConfig()
Method Detail

getName

public abstract String getName()
Returns the name of the plugin instance.

Returns:
the name of the plugin instance

getRole

public abstract String getRole()
Returns the PluginMeta.Role to which the plugin belongs.

Returns:
the PluginMeta.Role to which the plugin belongs

getMetaKeyName

public abstract String getMetaKeyName()
Returns the key name of the PluginMeta that describes the plugin.

Returns:
the key name of the PluginMeta that describes the plugin

getParameterList

public List getParameterList()
Returns a list of PluginConfigParameter containing the configuration parameter values for the plugin.

Returns:
list of PluginConfigParameter containing the configuration parameter values for the plugin

getParameter

public PluginConfigParameter getParameter(String keyName)
                                   throws NoSuchNameException
Finds and returns PluginConfigParameter with the specified key name. This method only looks at the PluginConfigParameters that are direct children of this PluginConfig; it will not match the given key with the key names of the descendants that are not direct children of this PluginConfig.

Parameters:
keyName - the key name of the parameter that is to be found
Returns:
PluginConfigParameter with matching keyName
Throws:
NoSuchNameException - if this PluginConfig does not have a parameter with the given name.

setParameterList

public void setParameterList(List parameterList)
Specifies the configuration parameter values of the plugin as a list of PluginConfigParameter.

Parameters:
parameterList - list of PluginConfigParameter containing the parameter values of the plugin

addParameter

public void addParameter(PluginConfigParameter pluginConfigParameter)
                  throws DuplicateNameException
Adds a PluginConfigParameter representing a configuration parameter value of the plugin.

Parameters:
pluginConfigParameter - PluginConfigParameter representing the configuration parameter value
Throws:
DuplicateNameException - if a parameter value for the same key name already exists

getStringValue

public String getStringValue(String paramKey)
Convenience method to get the string value of a given parameter. This uses PluginConfigParameter.getStringValue() to get the string value of the parameter if a parameter by the key name exists. If a parameter by the key name does not exist, this will return null.

This implementation does not return the default value if no value is set on the parameter. The caller must get the default value if needed.

Parameters:
paramKey - key name of the parameter whose string value is to be returned
Returns:
the string value of the parameter. This will return null of the parameter entry is not found.
Throws:
IllegalStateException - on incorrect value type (non-string)
See Also:
PluginConfigParameter.getStringValue()

getStringValue

public String getStringValue(String subConfigKey,
                             String paramKey)
Convenience method to get the string value of a given parameter within a subconfiguration. This is similar to getStringValue(String).

Parameters:
subConfigKey - the key name of the sub configuration. If null is passed in, this will assume no subconfiguration and behave exactly like getStringValue(String).
paramKey - key name of the parameter whose string value is to be returned
Throws:
IllegalStateException - on incorrect value type (non-string)
See Also:
PluginConfig.getStringValue(String)

getNumericValue

public Long getNumericValue(String paramKey)
Convenience method to get long value of a given parameter. This method uses PluginConfigParameter.getNumericValue() to get the long value of the parameter if a parameter by the key name exists. If a parameter by the key name does not exist, this will return null.

This implementation does not return the default value if no value is set on the parameter. The caller must get the default value if needed.

Parameters:
paramKey - key name of the parameter whose long value is to be returned
Returns:
long value of the parameter. This will return null of the parameter entry is not found.
Throws:
IllegalStateException - on incorrect value type (non-string)
NumberFormatException - if the value contains a string that cannot be parsed as a long

getBooleanValue

public Boolean getBooleanValue(String paramKey)
Convenience method to get boolean value of a given parameter. This method uses PluginConfigParameter.getBooleanValue() to get the boolean value of the parameter if a parameter by the key name exists. If a parameter by the key name does not exist, this will return null.

This implementation does not return the default value if no value is set on the parameter. The caller must get the default value if needed.

Parameters:
paramKey - key name of the parameter whose long value is to be returned
Returns:
long value of the parameter. This will return null of the parameter entry is not found.
Throws:
IllegalStateException - on incorrect value type (non-string) or if the string value contains anything other than "true" or "false" (case insensitive).

getStringListValue

public List getStringListValue(String paramKey)
Convenience method to get string list value of a given parameter. This method uses PluginConfigParameter.getStringListValue() to get the string list value from the parameter if a parameter by the key name exists. If a parameter by the key name does not exist, this will return null.

This implementation does not return the default value if no value is set on the parameter. The caller must get the default value if needed.

Parameters:
paramKey - key name of the parameter whose list value is to be returned
Returns:
List<String> value of the parameter. This will return null of the parameter entry is not found.
Throws:
IllegalStateException - on incorrect value type (not a list with strings)

Documentation is available at
${DOCSWEBROOT}
Copyright 2007 BEA Systems Inc.