org.rhq.core.domain.configuration.definition
Class ConfigurationDefinition

java.lang.Object
  extended by org.rhq.core.domain.configuration.definition.ConfigurationDefinition
All Implemented Interfaces:
Serializable

public class ConfigurationDefinition
extends Object
implements Serializable

The entire definition for a javax.persistence.CascadeType.Configuration. This includes mapped property definitions of arbitrary complexity, made up of PropertyDefinitionSimples, PropertyDefinitionLists, and PropertyDefinitionMaps.

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_DEPLOYMENT_BY_PACKAGE_TYPE_ID
           
static String QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID
           
static String QUERY_FIND_RESOURCE_BY_RESOURCE_TYPE_ID
           
 
Constructor Summary
protected ConfigurationDefinition()
           
  ConfigurationDefinition(String name, String description)
           
 
Method Summary
 PropertyDefinition get(String name)
           
 ConfigurationFormat getConfigurationFormat()
          This property is currently used only for resource configuration which may support structured config, raw config, both, or neither.
 ConfigurationTemplate getDefaultTemplate()
          If there is a default template, return it, otherwise return null.
 String getDescription()
           
 List<PropertyGroupDefinition> getGroupDefinitions()
          Goes through the properties of this definition and builds a list of the groups that contain its properties.
 int getId()
           
 String getName()
           
 List<PropertyDefinition> getNonGroupedProperties()
          Retrieve property definitions for properties that are not in a group.
 List<PropertyDefinition> getPropertiesInGroup(String groupName)
          Retrieve property definitions for properties in a group with the provided name.
 PropertyDefinitionList getPropertyDefinitionList(String name)
           
 PropertyDefinitionMap getPropertyDefinitionMap(String name)
           
 Map<String,PropertyDefinition> getPropertyDefinitions()
          Get the properties for this configuration.
 PropertyDefinitionSimple getPropertyDefinitionSimple(String name)
           
 ConfigurationTemplate getTemplate(String name)
          Returns the template indicated by the specified name
 Map<String,ConfigurationTemplate> getTemplates()
          This is a list of templates for this configuration definition.
 void put(PropertyDefinition propertyDefinition)
           
 void putTemplate(ConfigurationTemplate template)
           
 ConfigurationTemplate removeTemplate(ConfigurationTemplate template)
           
 void setConfigurationFormat(ConfigurationFormat configurationFormat)
           
 void setDescription(String description)
           
 void setId(int id)
           
 void setName(String name)
           
 void setPropertyDefinitions(Map<String,PropertyDefinition> propertyDefinitions)
           
 Set<String> templateNamesSet()
          Returns the set of all template names for this definition.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_DEPLOYMENT_BY_PACKAGE_TYPE_ID

public static final String QUERY_FIND_DEPLOYMENT_BY_PACKAGE_TYPE_ID
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_BY_RESOURCE_TYPE_ID

public static final String QUERY_FIND_RESOURCE_BY_RESOURCE_TYPE_ID
See Also:
Constant Field Values

QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID

public static final String QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID
See Also:
Constant Field Values
Constructor Detail

ConfigurationDefinition

protected ConfigurationDefinition()

ConfigurationDefinition

public ConfigurationDefinition(@NotNull
                               String name,
                               String description)
Method Detail

getId

public int getId()

setId

public void setId(int id)

getName

@NotNull
public String getName()

setName

public void setName(@NotNull
                    String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getConfigurationFormat

public ConfigurationFormat getConfigurationFormat()
This property is currently used only for resource configuration which may support structured config, raw config, both, or neither. For an older plugin that was implemented prior to raw config support, this would be null.

Returns:
The configuration format which may be structured, raw, or both. null indicates an older plugin that was developed prior to raw configuration being supported.

setConfigurationFormat

public void setConfigurationFormat(ConfigurationFormat configurationFormat)

getPropertyDefinitions

@NotNull
public Map<String,PropertyDefinition> getPropertyDefinitions()
Get the properties for this configuration. This is the only method that returns a Collection, where an update will be reflected in the database.

Returns:

setPropertyDefinitions

public void setPropertyDefinitions(Map<String,PropertyDefinition> propertyDefinitions)

put

public void put(PropertyDefinition propertyDefinition)

get

public PropertyDefinition get(String name)

getPropertyDefinitionSimple

public PropertyDefinitionSimple getPropertyDefinitionSimple(String name)

getPropertyDefinitionList

public PropertyDefinitionList getPropertyDefinitionList(String name)

getPropertyDefinitionMap

public PropertyDefinitionMap getPropertyDefinitionMap(String name)

getGroupDefinitions

@NotNull
public List<PropertyGroupDefinition> getGroupDefinitions()
Goes through the properties of this definition and builds a list of the groups that contain its properties. The list is sorted by group order index, then by name.

NOTE: updates of the result List will not be reflected in the database!

Returns:
all groups holding properties in this definition

getPropertiesInGroup

@NotNull
public List<PropertyDefinition> getPropertiesInGroup(String groupName)
Retrieve property definitions for properties in a group with the provided name. The list is sorted by property definition order index, then by name.

NOTE: updates of the result List will not be reflected in the database!

Parameters:
groupName - the name of the group
Returns:
the set of properties in a group with the provided name

getNonGroupedProperties

@NotNull
public List<PropertyDefinition> getNonGroupedProperties()
Retrieve property definitions for properties that are not in a group. The list is sorted by property definition order index, then by name.

DO NOT use this for updating the collection, as the updates will not be persisted!

Returns:
the set of properties that are not in a group
See Also:
propertyDefinitions, getPropertyDefinitions()

getTemplates

@NotNull
public Map<String,ConfigurationTemplate> getTemplates()
This is a list of templates for this configuration definition. Each template relates to a single "configuration" object which holds the values for the template.

Returns:
the set of templates for this configuration

putTemplate

public void putTemplate(ConfigurationTemplate template)

removeTemplate

public ConfigurationTemplate removeTemplate(ConfigurationTemplate template)

getDefaultTemplate

@Nullable
public ConfigurationTemplate getDefaultTemplate()
If there is a default template, return it, otherwise return null.

Returns:
a template if one is default, null otherwise

getTemplate

public ConfigurationTemplate getTemplate(@NotNull
                                         String name)
Returns the template indicated by the specified name

Parameters:
name - name of the template to return
Returns:
ConfigurationTemplate with the specified name; null if no template by that name exists.

templateNamesSet

public Set<String> templateNamesSet()
Returns the set of all template names for this definition.

Returns:
set of template names.

toString

public String toString()
Overrides:
toString in class Object


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