org.rhq.core.domain.resource
Class ResourceType

java.lang.Object
  extended by org.rhq.core.domain.resource.ResourceType
All Implemented Interfaces:
Serializable, Comparable<ResourceType>

public class ResourceType
extends Object
implements Serializable, Comparable<ResourceType>

Defines a type of Resource (e.g. a Linux platform, a JBossAS server, or a Datasource service). Unique business key (and therefore equals/hashCode basis) is the (String name, String plugin) combination. This will keep plugin writers from stepping on each other's toes.

See Also:
Serialized Form

Field Summary
static ResourceType ANY_PLATFORM_TYPE
           
static String FIND_ALL_TEMPLATE_COUNT_COMPOSITES
           
static String FIND_CHILDREN_BY_PARENT
          find child resource types for the resource type passed in :resourceType
static String MAPPING_FIND_CHILDREN_BY_CATEGORY
           
static String QUERY_DYNAMIC_CONFIG_WITH_PLUGIN
           
static String QUERY_FIND_ALL
           
static String QUERY_FIND_BY_CATEGORY
           
static String QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS
           
static String QUERY_FIND_BY_NAME_AND_PLUGIN
           
static String QUERY_FIND_BY_PARENT_AND_NAME
           
static String QUERY_FIND_BY_PLUGIN
           
static String QUERY_FIND_BY_RESOURCE_GROUP
           
static String QUERY_FIND_BY_RESOURCE_GROUP_admin
           
static String QUERY_FIND_BY_SUBCATEGORY
           
static String QUERY_FIND_CHILDREN
           
static String QUERY_FIND_CHILDREN_BY_CATEGORY
          find child resource types for resource :parentResource and category :category
static String QUERY_FIND_CHILDREN_BY_CATEGORY_admin
           
static String QUERY_FIND_COUNT_BY_PLUGIN
           
static String QUERY_FIND_DUPLICATE_TYPE_NAMES
           
static String QUERY_FIND_IDS_BY_PLUGIN
           
static String QUERY_FIND_RESOURCE_FACETS
           
static String QUERY_FIND_UTILIZED_BY_CATEGORY
           
static String QUERY_FIND_UTILIZED_BY_CATEGORY_admin
           
static String QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY
          find utilized (i.e. represented in inventory) child resource types for resource :parentResource and category :category
static String QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY_admin
           
static String QUERY_GET_BUNDLE_CONFIG_BY_GROUP_ID
           
static String QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP
           
static String QUERY_GET_IMPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP
           
static String QUERY_MARK_TYPES_DELETED
           
static String TABLE_NAME
           
 
Constructor Summary
ResourceType()
           
ResourceType(String name, String plugin, ResourceCategory category, ResourceType parentResourceType)
           
 
Method Summary
 void addChildResourceType(ResourceType childResourceType)
          Makes this resource type a parent of the given child resource type.
 void addChildSubCategory(ResourceSubCategory subCategory)
          Adds a child ResourceSubCategory to the List which has been defined on this ResourceType.
 void addDriftDefinitionTemplate(DriftDefinitionTemplate template)
           
 void addEventDefinition(EventDefinition eventDefinition)
           
 boolean addMetricDefinition(MeasurementDefinition metricDef)
           
 boolean addOperationDefinition(OperationDefinition operationDefinition)
           
 void addPackageType(PackageType packageType)
           
 void addParentResourceType(ResourceType parentResourceType)
          Makes this resource type a child of the given parent resource type.
 boolean addProcessScan(ProcessScan processMatch)
           
 int compareTo(ResourceType that)
           
 boolean equals(Object obj)
           
 BundleType getBundleType()
           
 ResourceCategory getCategory()
           
 Set<ResourceType> getChildResourceTypes()
           
 List<ResourceSubCategory> getChildSubCategories()
          Returns the List of child ResourceSubCategorys which have been defined on this ResourceType.
 ClassLoaderType getClassLoaderType()
           
 CreateDeletePolicy getCreateDeletePolicy()
           
 ResourceCreationDataType getCreationDataType()
           
 long getCtime()
           
 String getDescription()
           
 Set<DriftDefinitionTemplate> getDriftDefinitionTemplates()
           
 Set<EventDefinition> getEventDefinitions()
           
 String getHelpText()
           
 int getId()
           
 Set<MeasurementDefinition> getMetricDefinitions()
           
 long getMtime()
           
 String getName()
           
 Set<OperationDefinition> getOperationDefinitions()
           
 Set<PackageType> getPackageTypes()
           
 Set<ResourceType> getParentResourceTypes()
           
 String getPlugin()
           
 ConfigurationDefinition getPluginConfigurationDefinition()
           
 Set<ProcessScan> getProcessScans()
           
 Set<ProductVersion> getProductVersions()
           
 ConfigurationDefinition getResourceConfigurationDefinition()
           
 List<ResourceGroup> getResourceGroups()
           
 List<Resource> getResources()
           
 ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration()
           
 ResourceSubCategory getSubCategory()
          Returns the ResourceSubCategory, if any, which this ResourceType has been tagged with.
 int hashCode()
           
 boolean isCreatable()
           
 boolean isDeletable()
           
 boolean isDeleted()
           
 boolean isSingleton()
          If true, this resource may only ever have one discovered instance per parent resource.
 boolean isSupportsManualAdd()
           
 void removeChildResourceType(ResourceType oldChildResourceType)
          Removes the given resource type as a child of this resource type.
 void removePackageType(PackageType packageType)
           
 void removeParentResourceType(ResourceType oldParentResourceType)
          Removes the given resource type as a parent of this resource type.
 void setBundleType(BundleType bundleType)
           
 void setCategory(ResourceCategory category)
           
 void setChildResourceTypes(Set<ResourceType> childResourceTypes)
           
 void setChildSubCategories(List<ResourceSubCategory> subCategories)
          Sets the List of child ResourceSubCategorys for this ResourceType.
 void setClassLoaderType(ClassLoaderType classLoaderType)
           
 void setCreateDeletePolicy(CreateDeletePolicy createDeletePolicy)
           
 void setCreationDataType(ResourceCreationDataType creationDataType)
           
 void setDeleted(boolean deleted)
           
 void setDescription(String description)
           
 void setDriftDefinitionTemplates(Set<DriftDefinitionTemplate> driftDefinitionTemplates)
           
 void setEventDefinitions(Set<EventDefinition> eventDefinitions)
           
 void setHelpText(String helpText)
           
 void setId(int id)
           
 void setMetricDefinitions(Set<MeasurementDefinition> metricDefinitions)
           
 void setName(String name)
           
 void setOperationDefinitions(Set<OperationDefinition> operationDefinitions)
           
 void setPackageTypes(Set<PackageType> packageTypes)
           
 void setParentResourceTypes(Set<ResourceType> parentResourceTypes)
           
 void setPlugin(String plugin)
           
 void setPluginConfigurationDefinition(ConfigurationDefinition pluginConfigurationDefinition)
           
 void setProcessScans(Set<ProcessScan> processScans)
           
 void setProductVersions(Set<ProductVersion> productVersions)
           
 void setResourceConfigurationDefinition(ConfigurationDefinition resourceConfigurationDefinition)
           
 void setResourceGroups(List<ResourceGroup> resourceGroups)
           
 void setResources(List<Resource> resources)
           
 void setResourceTypeBundleConfiguration(ResourceTypeBundleConfiguration rtbc)
           
 void setSingleton(boolean singleton)
           
 void setSubCategory(ResourceSubCategory subcategory)
          Tags this ResourceType as being part of the specified ResourceSubCategory
 void setSupportsManualAdd(boolean supportsManualAdd)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_NAME

public static final String TABLE_NAME
See Also:
Constant Field Values

ANY_PLATFORM_TYPE

public static final ResourceType ANY_PLATFORM_TYPE

QUERY_GET_BUNDLE_CONFIG_BY_GROUP_ID

public static final String QUERY_GET_BUNDLE_CONFIG_BY_GROUP_ID
See Also:
Constant Field Values

QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP

public static final String QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP
See Also:
Constant Field Values

QUERY_GET_IMPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP

public static final String QUERY_GET_IMPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP
See Also:
Constant Field Values

QUERY_FIND_BY_NAME_AND_PLUGIN

public static final String QUERY_FIND_BY_NAME_AND_PLUGIN
See Also:
Constant Field Values

QUERY_FIND_BY_PLUGIN

public static final String QUERY_FIND_BY_PLUGIN
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_NAME

public static final String QUERY_FIND_BY_PARENT_AND_NAME
See Also:
Constant Field Values

QUERY_FIND_ALL

public static final String QUERY_FIND_ALL
See Also:
Constant Field Values

QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS

public static final String QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS
See Also:
Constant Field Values

QUERY_FIND_BY_CATEGORY

public static final String QUERY_FIND_BY_CATEGORY
See Also:
Constant Field Values

QUERY_FIND_CHILDREN

public static final String QUERY_FIND_CHILDREN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_BY_CATEGORY

public static final String QUERY_FIND_CHILDREN_BY_CATEGORY
find child resource types for resource :parentResource and category :category

See Also:
Constant Field Values

QUERY_FIND_CHILDREN_BY_CATEGORY_admin

public static final String QUERY_FIND_CHILDREN_BY_CATEGORY_admin
See Also:
Constant Field Values

QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY

public static final String QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY
find utilized (i.e. represented in inventory) child resource types for resource :parentResource and category :category

See Also:
Constant Field Values

QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY_admin

public static final String QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY_admin
See Also:
Constant Field Values

FIND_CHILDREN_BY_PARENT

public static final String FIND_CHILDREN_BY_PARENT
find child resource types for the resource type passed in :resourceType

See Also:
Constant Field Values

FIND_ALL_TEMPLATE_COUNT_COMPOSITES

public static final String FIND_ALL_TEMPLATE_COUNT_COMPOSITES
See Also:
Constant Field Values

QUERY_FIND_BY_SUBCATEGORY

public static final String QUERY_FIND_BY_SUBCATEGORY
See Also:
Constant Field Values

QUERY_FIND_UTILIZED_BY_CATEGORY

public static final String QUERY_FIND_UTILIZED_BY_CATEGORY
See Also:
Constant Field Values

QUERY_FIND_UTILIZED_BY_CATEGORY_admin

public static final String QUERY_FIND_UTILIZED_BY_CATEGORY_admin
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_GROUP

public static final String QUERY_FIND_BY_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_GROUP_admin

public static final String QUERY_FIND_BY_RESOURCE_GROUP_admin
See Also:
Constant Field Values

MAPPING_FIND_CHILDREN_BY_CATEGORY

public static final String MAPPING_FIND_CHILDREN_BY_CATEGORY
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_FACETS

public static final String QUERY_FIND_RESOURCE_FACETS
See Also:
Constant Field Values

QUERY_FIND_DUPLICATE_TYPE_NAMES

public static final String QUERY_FIND_DUPLICATE_TYPE_NAMES
See Also:
Constant Field Values

QUERY_DYNAMIC_CONFIG_WITH_PLUGIN

public static final String QUERY_DYNAMIC_CONFIG_WITH_PLUGIN
See Also:
Constant Field Values

QUERY_MARK_TYPES_DELETED

public static final String QUERY_MARK_TYPES_DELETED
See Also:
Constant Field Values

QUERY_FIND_IDS_BY_PLUGIN

public static final String QUERY_FIND_IDS_BY_PLUGIN
See Also:
Constant Field Values

QUERY_FIND_COUNT_BY_PLUGIN

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

ResourceType

public ResourceType()

ResourceType

public ResourceType(String name,
                    String plugin,
                    ResourceCategory category,
                    ResourceType parentResourceType)
Method Detail

getId

public int getId()

setId

public void setId(int id)

getName

public String getName()

setName

public void setName(String name)

getCategory

public ResourceCategory getCategory()

setCategory

public void setCategory(ResourceCategory category)

getCreationDataType

public ResourceCreationDataType getCreationDataType()

setCreationDataType

public void setCreationDataType(ResourceCreationDataType creationDataType)

getCreateDeletePolicy

public CreateDeletePolicy getCreateDeletePolicy()

setCreateDeletePolicy

public void setCreateDeletePolicy(CreateDeletePolicy createDeletePolicy)

isCreatable

public boolean isCreatable()

isDeletable

public boolean isDeletable()

getSubCategory

public ResourceSubCategory getSubCategory()
Returns the ResourceSubCategory, if any, which this ResourceType has been tagged with. If the ResourceType has not been tagged with a subcategory, null is returned.


setSubCategory

public void setSubCategory(ResourceSubCategory subcategory)
Tags this ResourceType as being part of the specified ResourceSubCategory


isSingleton

public boolean isSingleton()
If true, this resource may only ever have one discovered instance per parent resource.

Returns:
true if this is a singleton resource

setSingleton

public void setSingleton(boolean singleton)
Parameters:
singleton - true if there is only ever one discovered instance per parent resource

isSupportsManualAdd

public boolean isSupportsManualAdd()

setSupportsManualAdd

public void setSupportsManualAdd(boolean supportsManualAdd)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getPlugin

public String getPlugin()

setPlugin

public void setPlugin(String plugin)

getCtime

public long getCtime()

getMtime

public long getMtime()

isDeleted

public boolean isDeleted()

setDeleted

public void setDeleted(boolean deleted)

getResources

public List<Resource> getResources()

setResources

public void setResources(List<Resource> resources)

getResourceGroups

public List<ResourceGroup> getResourceGroups()

setResourceGroups

public void setResourceGroups(List<ResourceGroup> resourceGroups)

getParentResourceTypes

public Set<ResourceType> getParentResourceTypes()

setParentResourceTypes

public void setParentResourceTypes(Set<ResourceType> parentResourceTypes)

addParentResourceType

public void addParentResourceType(ResourceType parentResourceType)
Makes this resource type a child of the given parent resource type.

Parameters:
parentResourceType -

removeParentResourceType

public void removeParentResourceType(ResourceType oldParentResourceType)
Removes the given resource type as a parent of this resource type.

Parameters:
oldParentResourceType -

getChildResourceTypes

public Set<ResourceType> getChildResourceTypes()

addChildResourceType

public void addChildResourceType(ResourceType childResourceType)
Makes this resource type a parent of the given child resource type.

Parameters:
childResourceType -

removeChildResourceType

public void removeChildResourceType(ResourceType oldChildResourceType)
Removes the given resource type as a child of this resource type.

Parameters:
oldChildResourceType -

setChildResourceTypes

public void setChildResourceTypes(Set<ResourceType> childResourceTypes)

getPluginConfigurationDefinition

public ConfigurationDefinition getPluginConfigurationDefinition()

setPluginConfigurationDefinition

public void setPluginConfigurationDefinition(ConfigurationDefinition pluginConfigurationDefinition)

getResourceConfigurationDefinition

public ConfigurationDefinition getResourceConfigurationDefinition()

setResourceConfigurationDefinition

public void setResourceConfigurationDefinition(ConfigurationDefinition resourceConfigurationDefinition)

getResourceTypeBundleConfiguration

public ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration()

setResourceTypeBundleConfiguration

public void setResourceTypeBundleConfiguration(ResourceTypeBundleConfiguration rtbc)

getMetricDefinitions

public Set<MeasurementDefinition> getMetricDefinitions()

setMetricDefinitions

public void setMetricDefinitions(Set<MeasurementDefinition> metricDefinitions)

addMetricDefinition

public boolean addMetricDefinition(MeasurementDefinition metricDef)

getEventDefinitions

public Set<EventDefinition> getEventDefinitions()

setEventDefinitions

public void setEventDefinitions(Set<EventDefinition> eventDefinitions)

addEventDefinition

public void addEventDefinition(EventDefinition eventDefinition)

getOperationDefinitions

public Set<OperationDefinition> getOperationDefinitions()

setOperationDefinitions

public void setOperationDefinitions(Set<OperationDefinition> operationDefinitions)

addOperationDefinition

public boolean addOperationDefinition(OperationDefinition operationDefinition)

getProcessScans

public Set<ProcessScan> getProcessScans()

setProcessScans

public void setProcessScans(Set<ProcessScan> processScans)

addProcessScan

public boolean addProcessScan(ProcessScan processMatch)

getPackageTypes

public Set<PackageType> getPackageTypes()

setPackageTypes

public void setPackageTypes(Set<PackageType> packageTypes)

addPackageType

public void addPackageType(PackageType packageType)

removePackageType

public void removePackageType(PackageType packageType)

getChildSubCategories

public List<ResourceSubCategory> getChildSubCategories()
Returns the List of child ResourceSubCategorys which have been defined on this ResourceType. These ResourceSubCategory's are available to tag any child ResourceTypes of this ResourceType.

Returns:
the list of ResourceSubCategory's which have been defined on this ResourceType

setChildSubCategories

public void setChildSubCategories(List<ResourceSubCategory> subCategories)
Sets the List of child ResourceSubCategorys for this ResourceType.

Parameters:
subCategories - the List of ResourceSubCategory's for this ResourceType

addChildSubCategory

public void addChildSubCategory(ResourceSubCategory subCategory)
Adds a child ResourceSubCategory to the List which has been defined on this ResourceType.


getProductVersions

public Set<ProductVersion> getProductVersions()

setProductVersions

public void setProductVersions(Set<ProductVersion> productVersions)

getHelpText

public String getHelpText()

setHelpText

public void setHelpText(String helpText)

getClassLoaderType

public ClassLoaderType getClassLoaderType()

setClassLoaderType

public void setClassLoaderType(ClassLoaderType classLoaderType)

getBundleType

public BundleType getBundleType()

setBundleType

public void setBundleType(BundleType bundleType)

getDriftDefinitionTemplates

public Set<DriftDefinitionTemplate> getDriftDefinitionTemplates()

addDriftDefinitionTemplate

public void addDriftDefinitionTemplate(DriftDefinitionTemplate template)

setDriftDefinitionTemplates

public void setDriftDefinitionTemplates(Set<DriftDefinitionTemplate> driftDefinitionTemplates)

compareTo

public int compareTo(ResourceType that)
Specified by:
compareTo in interface Comparable<ResourceType>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


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