org.apache.qpid.server.configuration.plugins
Class ConfigurationPlugin

java.lang.Object
  extended by org.apache.qpid.server.configuration.plugins.ConfigurationPlugin
Direct Known Subclasses:
AllowAll.AllowAllConfiguration, DenyAll.DenyAllConfiguration, LegacyAccess.LegacyAccessConfiguration, QueueConfiguration, QueueConfiguration.QueueConfig, SecurityManager.SecurityConfiguration, ServerConfiguration, SlowConsumerDetectionConfiguration, SlowConsumerDetectionPolicyConfiguration, SlowConsumerDetectionQueueConfiguration, TopicConfig, TopicConfiguration, TopicDeletePolicyConfiguration, VirtualHostConfiguration

public abstract class ConfigurationPlugin
extends Object


Field Summary
protected  Configuration _configuration
           
protected static org.apache.log4j.Logger _logger
           
 
Constructor Summary
ConfigurationPlugin()
           
 
Method Summary
 void addConfiguration(ConfigurationPlugin configuration)
          Given another configuration merge the configuration into our own config The new values being merged in will take precedence over existing values.
protected  boolean contains(String property)
           
protected  boolean containsBoolean(String property)
           
protected  boolean containsInt(String property)
           
protected  boolean containsLong(String property)
           
protected  boolean containsPositiveLong(String property)
           
 String formatToString()
           
protected  boolean getBooleanValue(String property)
           
protected  boolean getBooleanValue(String property, boolean defaultValue)
           
 Configuration getConfig()
           
<C extends ConfigurationPlugin>
C
getConfiguration(String plugin)
           
protected  double getDoubleValue(String property)
           
protected  double getDoubleValue(String property, double defaultValue)
           
abstract  String[] getElementsProcessed()
          The Elements that this Plugin can process.
protected  int getIntValue(String property)
           
protected  int getIntValue(String property, int defaultValue)
           
protected  List getListValue(String property)
           
protected  List getListValue(String property, List defaultValue)
           
protected  long getLongValue(String property)
           
protected  long getLongValue(String property, long defaultValue)
           
protected  String getStringValue(String property)
           
protected  String getStringValue(String property, String defaultValue)
           
protected  boolean hasConfiguration()
           
protected  void mergeConfiguration(ConfigurationPlugin configuration)
           
 void setConfiguration(String path, Configuration configuration)
          Sets the configuration for this plugin
static void showKeys(Configuration config)
          Helper method to print out list of keys in a Configuration.
 String toString()
           
 void validateConfiguration()
          Performs configuration validation.
protected  void validatePositiveLong(String property)
          Provide mechanism to validate Configuration contains a Postiive Long Value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_logger

protected static final org.apache.log4j.Logger _logger

_configuration

protected Configuration _configuration
Constructor Detail

ConfigurationPlugin

public ConfigurationPlugin()
Method Detail

getElementsProcessed

public abstract String[] getElementsProcessed()
The Elements that this Plugin can process. For a Queues plugin that would be a list containing:


validateConfiguration

public void validateConfiguration()
                           throws ConfigurationException
Performs configuration validation.

Throws:
ConfigurationException

getConfig

public Configuration getConfig()

getConfiguration

public <C extends ConfigurationPlugin> C getConfiguration(String plugin)

setConfiguration

public void setConfiguration(String path,
                             Configuration configuration)
                      throws ConfigurationException
Sets the configuration for this plugin

Parameters:
path -
configuration - the configuration for this plugin.
Throws:
ConfigurationException

showKeys

public static final void showKeys(Configuration config)
Helper method to print out list of keys in a Configuration.


hasConfiguration

protected boolean hasConfiguration()

getDoubleValue

protected double getDoubleValue(String property)

getDoubleValue

protected double getDoubleValue(String property,
                                double defaultValue)

getLongValue

protected long getLongValue(String property)

getLongValue

protected long getLongValue(String property,
                            long defaultValue)

getIntValue

protected int getIntValue(String property)

getIntValue

protected int getIntValue(String property,
                          int defaultValue)

getStringValue

protected String getStringValue(String property)

getStringValue

protected String getStringValue(String property,
                                String defaultValue)

getBooleanValue

protected boolean getBooleanValue(String property)

getBooleanValue

protected boolean getBooleanValue(String property,
                                  boolean defaultValue)

getListValue

protected List getListValue(String property)

getListValue

protected List getListValue(String property,
                            List defaultValue)

contains

protected boolean contains(String property)

validatePositiveLong

protected void validatePositiveLong(String property)
                             throws ConfigurationException
Provide mechanism to validate Configuration contains a Postiive Long Value

Parameters:
property -
Throws:
ConfigurationException

containsLong

protected boolean containsLong(String property)

containsPositiveLong

protected boolean containsPositiveLong(String property)

containsInt

protected boolean containsInt(String property)

containsBoolean

protected boolean containsBoolean(String property)

addConfiguration

public void addConfiguration(ConfigurationPlugin configuration)
Given another configuration merge the configuration into our own config The new values being merged in will take precedence over existing values. In the simplistic case this means something like: So if we have configuration set name = 'fooo' And the new configuration contains a name then that will be reset. name = 'new' However this plugin will simply contain other plugins so the merge will be called until we end up at a base plugin that understand how to merge items. i.e Alerting values. Where the provided configuration will take precedence.

Parameters:
configuration - the config to merge in to our own.

mergeConfiguration

protected void mergeConfiguration(ConfigurationPlugin configuration)

toString

public String toString()
Overrides:
toString in class Object

formatToString

public String formatToString()


Licensed to the Apache Software Foundation