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

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

Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility

public abstract class ConfigurationUtility
extends Object

Utility methods for working with Configurations.

Author:
Ian Springer

Constructor Summary
ConfigurationUtility()
          Deprecated.  
 
Method Summary
static org.rhq.core.domain.configuration.Configuration createDefaultConfiguration(org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
          Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility
static void initializeDefaultTemplate(org.rhq.core.domain.configuration.definition.ConfigurationDefinition configDef)
          Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility
static void normalizeConfiguration(org.rhq.core.domain.configuration.Configuration configuration, org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
          Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility
static List<String> validateConfiguration(org.rhq.core.domain.configuration.Configuration configuration, org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
          Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationUtility

public ConfigurationUtility()
Deprecated. 
Method Detail

initializeDefaultTemplate

public static void initializeDefaultTemplate(org.rhq.core.domain.configuration.definition.ConfigurationDefinition configDef)
Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility

This will populate the given configuration definition with a default template. A default template will only be created if one or more properties are required or have default values. If no property definition is required or has a default value, the default template will remain null in the given config definition. Note that if the given configuration definition already has a default template defined for it, this method is a no-op and will return immediately.

Parameters:
configDef - the configuration definition whose default template is to be created and set

createDefaultConfiguration

public static org.rhq.core.domain.configuration.Configuration createDefaultConfiguration(org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility

Given a configuration definition, this will build and return a "default configuration" that can be validated with the definition. All required properties are set and all properties that define a default value are also set. If a required property does not have a default value defined in the definition, the property value will be set to null. Use this to help create the definition's default template.

Parameters:
configurationDefinition - the configuration definition whose default configuration is to be created
Returns:
configuration the default configuration

normalizeConfiguration

public static void normalizeConfiguration(@NotNull
                                          org.rhq.core.domain.configuration.Configuration configuration,
                                          @Nullable
                                          org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility

"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
                                                         org.rhq.core.domain.configuration.Configuration configuration,
                                                         @Nullable
                                                         org.rhq.core.domain.configuration.definition.ConfigurationDefinition configurationDefinition)
Deprecated. use the utility found in the domain module -org.rhq.core.domain.configuration.ConfigurationUtility

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-2012 Red Hat, Inc.. All Rights Reserved.