org.rhq.core.clientapi.agent.configuration
Class ConfigurationUtility

java.lang.Object
  extended by org.rhq.core.clientapi.agent.configuration.ConfigurationUtility

public abstract class ConfigurationUtility
extends Object

Utility methods for working with Configurations.


Constructor Summary
ConfigurationUtility()
           
 
Method Summary
static void normalizeConfiguration(Configuration configuration, ConfigurationDefinition configurationDefinition)
          "Normalize" the given configuration according to the given configuration definition.
static List<String> validateConfiguration(Configuration configuration, ConfigurationDefinition configurationDefinition)
          Validate the given configuration according to the given configuration definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationUtility

public ConfigurationUtility()
Method Detail

normalizeConfiguration

public static void normalizeConfiguration(@NotNull
                                          Configuration configuration,
                                          @Nullable
                                          ConfigurationDefinition configurationDefinition)
"Normalize" the given configuration according to the given configuration definition. That is, for any optional properties that are not defined in the top-level configuration Map or any sub-Maps, set them. Simple properties are set with a null value, Map properties as an empty Map, and List properties as an empty List.

Parameters:
configuration - the configuration to be normalized
configurationDefinition - the configuration definition to normalize the configuration against

validateConfiguration

@NotNull
public static List<String> validateConfiguration(@NotNull
                                                         Configuration configuration,
                                                         @Nullable
                                                         ConfigurationDefinition configurationDefinition)
Validate the given configuration according to the given configuration definition. That is, check that any required properties in the top-level configuration Map or any sub-Maps, are defined and, in the case of simple properties, check that they have a non-null value. A list of messages describing any errors that were found is returned. Additionally, any undefined or null simple properties will be assigned a value of "".

Parameters:
configuration - the configuration to be validated
configurationDefinition - the configuration definition to validate the configuration against
Returns:
a list of messages describing any errors that were found


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.