org.rhq.enterprise.server.resource
Class ResourceTypeManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.resource.ResourceTypeManagerBean
All Implemented Interfaces:
ResourceTypeManagerLocal, ResourceTypeManagerRemote

public class ResourceTypeManagerBean
extends Object
implements ResourceTypeManagerLocal, ResourceTypeManagerRemote

A manager that provides methods for creating, updating, deleting, and querying ResourceTypes.

Author:
Ian Springer, Joseph Marques

Constructor Summary
ResourceTypeManagerBean()
           
 
Method Summary
 boolean ensureResourceType(org.rhq.core.domain.auth.Subject subject, Integer resourceTypeId, Integer[] resourceIds)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.ResourceType> findResourceTypesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.ResourceTypeCriteria criteria)
           
 List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypeAncestors(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
           
 List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypeDescendants(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
           
 List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.ResourceCategory category)
          Obtain ResourceTypes that match a given category or all if category is null.
 List<org.rhq.core.domain.resource.ResourceType> getChildResourceTypes(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.ResourceType parent)
          Gets the list of resource types that are children of the specified resource type and that are viewable by the specified user.
 List<org.rhq.core.domain.resource.ResourceType> getChildResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.Resource parentResource, org.rhq.core.domain.resource.ResourceCategory category)
          Gets the list of resource types that are children of the specified resource type, that are in the specified resource category, and that are viewable by the specified user.
 Map<Integer,SortedSet<org.rhq.core.domain.resource.ResourceType>> getChildResourceTypesForResourceTypes(List<org.rhq.core.domain.resource.ResourceType> types)
          Return all ResourceTypes that are children of the passed ones
 List<String> getDuplicateTypeNames()
           
 org.rhq.core.domain.resource.composite.ResourceFacets getResourceFacets(int resourceTypeId)
          Return which facets are available for the passed return type.
 org.rhq.core.domain.resource.ResourceType getResourceTypeById(org.rhq.core.domain.auth.Subject subject, int id)
           
 org.rhq.core.domain.resource.ResourceType getResourceTypeByNameAndPlugin(String name, String plugin)
           
 org.rhq.core.domain.resource.ResourceType getResourceTypeByNameAndPlugin(org.rhq.core.domain.auth.Subject subject, String name, String plugin)
           
 Integer getResourceTypeCountByPlugin(String plugin)
           
 Map<String,Integer> getResourceTypeCountsByGroup(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.group.ResourceGroup group, boolean recursive)
           
 HashMap<Integer,String> getResourceTypeDescendantsWithOperations(org.rhq.core.domain.auth.Subject subject, int resourceTypeId)
           
 List<Integer> getResourceTypeIdsByPlugin(String plugin)
           
 List<org.rhq.core.domain.resource.ResourceType> getResourceTypesByPlugin(String pluginName)
           
 List<org.rhq.core.domain.resource.ResourceType> getResourceTypesForCompatibleGroups(org.rhq.core.domain.auth.Subject subject, String pluginName)
           
 Map<Integer,org.rhq.core.domain.resource.composite.ResourceTypeTemplateCountComposite> getTemplateCountCompositeMap()
           
 List<org.rhq.core.domain.resource.ResourceType> getUtilizedChildResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.Resource parentResource, org.rhq.core.domain.resource.ResourceCategory category)
           
 List<String> getUtilizedResourceTypeNamesByCategory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.ResourceCategory category, String nameFilter, String pluginName)
           
 List<org.rhq.core.domain.resource.ResourceType> getUtilizedResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.ResourceCategory category, String nameFilter)
           
 void reloadResourceFacetsCache()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceTypeManagerBean

public ResourceTypeManagerBean()
Method Detail

getResourceTypeById

public org.rhq.core.domain.resource.ResourceType getResourceTypeById(org.rhq.core.domain.auth.Subject subject,
                                                                     int id)
                                                              throws ResourceTypeNotFoundException
Specified by:
getResourceTypeById in interface ResourceTypeManagerLocal
Specified by:
getResourceTypeById in interface ResourceTypeManagerRemote
Throws:
ResourceTypeNotFoundException

getResourceTypeByNameAndPlugin

public org.rhq.core.domain.resource.ResourceType getResourceTypeByNameAndPlugin(org.rhq.core.domain.auth.Subject subject,
                                                                                String name,
                                                                                String plugin)
Specified by:
getResourceTypeByNameAndPlugin in interface ResourceTypeManagerLocal
Specified by:
getResourceTypeByNameAndPlugin in interface ResourceTypeManagerRemote
Returns:
the resource type by name and plugin or null if the type is not found

getResourceTypeByNameAndPlugin

public org.rhq.core.domain.resource.ResourceType getResourceTypeByNameAndPlugin(String name,
                                                                                String plugin)
Specified by:
getResourceTypeByNameAndPlugin in interface ResourceTypeManagerLocal

getChildResourceTypes

public List<org.rhq.core.domain.resource.ResourceType> getChildResourceTypes(org.rhq.core.domain.auth.Subject subject,
                                                                             org.rhq.core.domain.resource.ResourceType parent)
Description copied from interface: ResourceTypeManagerLocal
Gets the list of resource types that are children of the specified resource type and that are viewable by the specified user.

Specified by:
getChildResourceTypes in interface ResourceTypeManagerLocal
Parameters:
subject - an authz subject
parent - a resource type
Returns:
the list of resource types that are children of the specified resource type and that are viewable by the specified user

getChildResourceTypesByCategory

public List<org.rhq.core.domain.resource.ResourceType> getChildResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject,
                                                                                       org.rhq.core.domain.resource.Resource parentResource,
                                                                                       org.rhq.core.domain.resource.ResourceCategory category)
Description copied from interface: ResourceTypeManagerLocal
Gets the list of resource types that are children of the specified resource type, that are in the specified resource category, and that are viewable by the specified user.

Specified by:
getChildResourceTypesByCategory in interface ResourceTypeManagerLocal
Parameters:
subject - an authz subject
parentResource - the parent resource
category - a resource category
Returns:
the list of resource types that are children of the specified resource type, that are in the specified resource category, and that are viewable by the specified user

getUtilizedChildResourceTypesByCategory

public List<org.rhq.core.domain.resource.ResourceType> getUtilizedChildResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject,
                                                                                               org.rhq.core.domain.resource.Resource parentResource,
                                                                                               org.rhq.core.domain.resource.ResourceCategory category)
Specified by:
getUtilizedChildResourceTypesByCategory in interface ResourceTypeManagerLocal

getAllResourceTypesByCategory

public List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject,
                                                                                     org.rhq.core.domain.resource.ResourceCategory category)
Obtain ResourceTypes that match a given category or all if category is null.

Specified by:
getAllResourceTypesByCategory in interface ResourceTypeManagerLocal
Parameters:
subject - subject of the caller
category - the category to check for. If this is null, entries from all categories will be returned.
Returns:
a List of ResourceTypes
See Also:
ResourceCategory

getUtilizedResourceTypeNamesByCategory

public List<String> getUtilizedResourceTypeNamesByCategory(org.rhq.core.domain.auth.Subject subject,
                                                           org.rhq.core.domain.resource.ResourceCategory category,
                                                           String nameFilter,
                                                           String pluginName)
Specified by:
getUtilizedResourceTypeNamesByCategory in interface ResourceTypeManagerLocal

getUtilizedResourceTypesByCategory

public List<org.rhq.core.domain.resource.ResourceType> getUtilizedResourceTypesByCategory(org.rhq.core.domain.auth.Subject subject,
                                                                                          org.rhq.core.domain.resource.ResourceCategory category,
                                                                                          String nameFilter)
Specified by:
getUtilizedResourceTypesByCategory in interface ResourceTypeManagerLocal

getChildResourceTypesForResourceTypes

public Map<Integer,SortedSet<org.rhq.core.domain.resource.ResourceType>> getChildResourceTypesForResourceTypes(List<org.rhq.core.domain.resource.ResourceType> types)
Return all ResourceTypes that are children of the passed ones

Specified by:
getChildResourceTypesForResourceTypes in interface ResourceTypeManagerLocal
Parameters:
types - List of ResourceTypes
Returns:
List of ResourceTypes. If nothing is found, then this list is empty

getResourceTypesForCompatibleGroups

public List<org.rhq.core.domain.resource.ResourceType> getResourceTypesForCompatibleGroups(org.rhq.core.domain.auth.Subject subject,
                                                                                           String pluginName)
Specified by:
getResourceTypesForCompatibleGroups in interface ResourceTypeManagerLocal

getResourceTypeCountsByGroup

public Map<String,Integer> getResourceTypeCountsByGroup(org.rhq.core.domain.auth.Subject subject,
                                                        org.rhq.core.domain.resource.group.ResourceGroup group,
                                                        boolean recursive)
Specified by:
getResourceTypeCountsByGroup in interface ResourceTypeManagerLocal

ensureResourceType

public boolean ensureResourceType(org.rhq.core.domain.auth.Subject subject,
                                  Integer resourceTypeId,
                                  Integer[] resourceIds)
                           throws ResourceTypeNotFoundException
Specified by:
ensureResourceType in interface ResourceTypeManagerLocal
Throws:
ResourceTypeNotFoundException

getResourceFacets

public org.rhq.core.domain.resource.composite.ResourceFacets getResourceFacets(int resourceTypeId)
Return which facets are available for the passed return type. This is e.g. used to determine which tabs (Monitor, Inventory, ...) can be displayed for a resource of a certain type

Specified by:
getResourceFacets in interface ResourceTypeManagerLocal

reloadResourceFacetsCache

public void reloadResourceFacetsCache()
Specified by:
reloadResourceFacetsCache in interface ResourceTypeManagerLocal

getTemplateCountCompositeMap

public Map<Integer,org.rhq.core.domain.resource.composite.ResourceTypeTemplateCountComposite> getTemplateCountCompositeMap()
Specified by:
getTemplateCountCompositeMap in interface ResourceTypeManagerLocal

getResourceTypesByPlugin

public List<org.rhq.core.domain.resource.ResourceType> getResourceTypesByPlugin(String pluginName)
Specified by:
getResourceTypesByPlugin in interface ResourceTypeManagerLocal

getResourceTypeIdsByPlugin

public List<Integer> getResourceTypeIdsByPlugin(String plugin)
Specified by:
getResourceTypeIdsByPlugin in interface ResourceTypeManagerLocal

getResourceTypeCountByPlugin

public Integer getResourceTypeCountByPlugin(String plugin)
Specified by:
getResourceTypeCountByPlugin in interface ResourceTypeManagerLocal

findResourceTypesByCriteria

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.ResourceType> findResourceTypesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                org.rhq.core.domain.criteria.ResourceTypeCriteria criteria)
Specified by:
findResourceTypesByCriteria in interface ResourceTypeManagerLocal
Specified by:
findResourceTypesByCriteria in interface ResourceTypeManagerRemote

getDuplicateTypeNames

public List<String> getDuplicateTypeNames()
Specified by:
getDuplicateTypeNames in interface ResourceTypeManagerLocal

getResourceTypeDescendantsWithOperations

public HashMap<Integer,String> getResourceTypeDescendantsWithOperations(org.rhq.core.domain.auth.Subject subject,
                                                                        int resourceTypeId)
Specified by:
getResourceTypeDescendantsWithOperations in interface ResourceTypeManagerLocal

getAllResourceTypeAncestors

public List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypeAncestors(org.rhq.core.domain.auth.Subject subject,
                                                                                   int resourceTypeId)
Specified by:
getAllResourceTypeAncestors in interface ResourceTypeManagerLocal

getAllResourceTypeDescendants

public List<org.rhq.core.domain.resource.ResourceType> getAllResourceTypeDescendants(org.rhq.core.domain.auth.Subject subject,
                                                                                     int resourceTypeId)
Specified by:
getAllResourceTypeDescendants in interface ResourceTypeManagerLocal


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