org.rhq.enterprise.server.resource.group
Interface ResourceGroupManagerLocal

All Known Implementing Classes:
ResourceGroupManagerBean

public interface ResourceGroupManagerLocal

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

Author:
Ian Springer

Method Summary
 void addResourcesToGroup(org.rhq.core.domain.auth.Subject subject, int groupId, int[] resourceIds)
           
 org.rhq.core.domain.resource.group.ResourceGroup createPrivateResourceGroup(org.rhq.core.domain.auth.Subject user, org.rhq.core.domain.resource.group.ResourceGroup group)
          NOTE: This is only used to support AutoGroups currently but the idea may be expanded in the future.
 org.rhq.core.domain.resource.group.ResourceGroup createResourceGroup(org.rhq.core.domain.auth.Subject user, org.rhq.core.domain.resource.group.ResourceGroup group)
           
 void deleteResourceGroup(org.rhq.core.domain.auth.Subject user, int groupId)
           
 void deleteResourceGroups(org.rhq.core.domain.auth.Subject user, int[] groupIds)
           
 void enableRecursivityForGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findAvailableResourceGroupsForRole(org.rhq.core.domain.auth.Subject subject, int roleId, int[] excludeIds, org.rhq.core.domain.util.PageControl pageControl)
           
 int[] findDefinitionsForAutoGroup(org.rhq.core.domain.auth.Subject subject, int autoGroupParentResourceId, int autoGroupChildResourceTypeId, boolean displayTypeSummaryOnly)
          Get the MeasurementDefinitions for the passed autogroup
 int[] findDefinitionsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId, boolean displayTypeSummaryOnly)
          Return the MeasurementDefinitions for the passed comatible group
 List<Integer> findDeletedResourceGroupIds(int[] groupIds)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupByIds(org.rhq.core.domain.auth.Subject subject, int[] resourceGroupIds, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.composite.ResourceGroupComposite> findResourceGroupComposites(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.group.GroupCategory groupCategory, org.rhq.core.domain.resource.ResourceCategory resourceCategory, String resourceTypeName, String pluginName, String nameFilter, Integer resourceId, Integer groupId, org.rhq.core.domain.util.PageControl pc)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.composite.ResourceGroupComposite> findResourceGroupCompositesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.ResourceGroupCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.ResourceGroupCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupsForRole(org.rhq.core.domain.auth.Subject subject, int roleId, org.rhq.core.domain.util.PageControl pc)
           
 List<org.rhq.core.domain.resource.Resource> findResourcesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int autoGroupParentResourceId, int autoGroupChildResourceTypeId)
           
 List<org.rhq.core.domain.resource.Resource> findResourcesForResourceGroup(org.rhq.core.domain.auth.Subject subject, int groupId, org.rhq.core.domain.resource.group.GroupCategory category)
           
 org.rhq.core.domain.resource.group.ResourceGroup getByGroupDefinitionAndGroupByClause(int groupDefinitionId, String groupByClause)
           
 int getExplicitGroupMemberCount(int resourceGroupId)
           
 int getImplicitGroupMemberCount(int resourceGroupId)
           
 org.rhq.core.domain.resource.group.ResourceGroup getResourceGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 org.rhq.core.domain.resource.group.ResourceGroup getResourceGroupById(org.rhq.core.domain.auth.Subject user, int id, org.rhq.core.domain.resource.group.GroupCategory category)
           
 org.rhq.core.domain.resource.group.composite.ResourceGroupComposite getResourceGroupComposite(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 int[] getResourceGroupCountSummary(org.rhq.core.domain.auth.Subject user)
          Get a summary of counts, by category, of the user's assigned, visible groups.
 void removeAllResourcesFromGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 void removeResourcesFromGroup(org.rhq.core.domain.auth.Subject subject, int groupId, int[] resourceIds)
           
 void setAssignedResourceGroupsForResource(org.rhq.core.domain.auth.Subject subject, int groupId, int[] resourceIds, boolean setType)
          This method ensures that the resource will have exactly the specified set of explicit group membership.
 void setAssignedResources(org.rhq.core.domain.auth.Subject subject, int groupId, int[] resourceIds, boolean setType)
          This method ensures that the explicit group membership is set to the specified resources.
 void setRecursive(org.rhq.core.domain.auth.Subject subject, int groupId, boolean isRecursive)
           
 void setResourceType(int resourceGroupId)
           
 void uninventoryMembers(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 void updateImplicitGroupMembership(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.Resource resource)
           
 org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.group.ResourceGroup group)
           
 org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject user, org.rhq.core.domain.resource.group.ResourceGroup group, RecursivityChangeType changeType)
           
 org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject user, org.rhq.core.domain.resource.group.ResourceGroup group, RecursivityChangeType changeType, boolean updateMembership)
           
 

Method Detail

createPrivateResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup createPrivateResourceGroup(org.rhq.core.domain.auth.Subject user,
                                                                            org.rhq.core.domain.resource.group.ResourceGroup group)
NOTE: This is only used to support AutoGroups currently but the idea may be expanded in the future. Creates a private, "user-owned" (aka "subject-owned") resource group. This group differs from a role-owned group in that it can not be assigned to a role, instead it is owned by the user that creates it. It comprises only a set of resources for which the user has, minimally, view permission. Since a user's view permissions can change, membership and authz checking must be performed as needed when taking any action on the group.

A user does not need MANAGE_INVENTORY to create a sub-group because it is private to his view.

This call does not populate the group with members, it only creates the group. The group is automatically set to be non-recursive.

All user-owned groups are deleted if the the user is deleted.

Parameters:
user - The user for which the group will be created.
group - The group characteristics. Any membership defined here is ignored. The recursivity setting is ignored.
Returns:
The new group.

getResourceGroupById

org.rhq.core.domain.resource.group.ResourceGroup getResourceGroupById(org.rhq.core.domain.auth.Subject user,
                                                                      int id,
                                                                      org.rhq.core.domain.resource.group.GroupCategory category)
                                                                      throws ResourceGroupNotFoundException
Throws:
ResourceGroupNotFoundException

getResourceGroupCountSummary

int[] getResourceGroupCountSummary(org.rhq.core.domain.auth.Subject user)
Get a summary of counts, by category, of the user's assigned, visible groups.

Parameters:
user -
Returns:
A 2 element int array with counts for mixed, compatible as a[0], a[1] respectively.

enableRecursivityForGroup

void enableRecursivityForGroup(org.rhq.core.domain.auth.Subject subject,
                               int groupId)
                               throws ResourceGroupNotFoundException,
                                      ResourceGroupUpdateException
Throws:
ResourceGroupNotFoundException
ResourceGroupUpdateException

removeAllResourcesFromGroup

void removeAllResourcesFromGroup(org.rhq.core.domain.auth.Subject subject,
                                 int groupId)
                                 throws ResourceGroupDeleteException
Throws:
ResourceGroupDeleteException

findAvailableResourceGroupsForRole

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findAvailableResourceGroupsForRole(org.rhq.core.domain.auth.Subject subject,
                                                                                                                       int roleId,
                                                                                                                       int[] excludeIds,
                                                                                                                       org.rhq.core.domain.util.PageControl pageControl)

findResourceGroupByIds

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupByIds(org.rhq.core.domain.auth.Subject subject,
                                                                                                           int[] resourceGroupIds,
                                                                                                           org.rhq.core.domain.util.PageControl pageControl)

updateImplicitGroupMembership

void updateImplicitGroupMembership(org.rhq.core.domain.auth.Subject subject,
                                   org.rhq.core.domain.resource.Resource resource)

findResourcesForAutoGroup

List<org.rhq.core.domain.resource.Resource> findResourcesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                                                      int autoGroupParentResourceId,
                                                                      int autoGroupChildResourceTypeId)

findResourcesForResourceGroup

List<org.rhq.core.domain.resource.Resource> findResourcesForResourceGroup(org.rhq.core.domain.auth.Subject subject,
                                                                          int groupId,
                                                                          org.rhq.core.domain.resource.group.GroupCategory category)

findDefinitionsForCompatibleGroup

int[] findDefinitionsForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                        int groupId,
                                        boolean displayTypeSummaryOnly)
Return the MeasurementDefinitions for the passed comatible group

Parameters:
subject - Subject of the calling user
groupId - id of the group
displayTypeSummaryOnly - TODO
Returns:
a set of Definitions, which is empty for an invalid groupId

findDefinitionsForAutoGroup

int[] findDefinitionsForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                  int autoGroupParentResourceId,
                                  int autoGroupChildResourceTypeId,
                                  boolean displayTypeSummaryOnly)
Get the MeasurementDefinitions for the passed autogroup

Parameters:
subject - Subject of the calling user
autoGroupParentResourceId - id of the parent resource
autoGroupChildResourceTypeId - Id of the ResourceType of the children
displayTypeSummaryOnly - TODO
Returns:
a set of Definitions which is empty for an invalid autoGroupChildResourceType

getByGroupDefinitionAndGroupByClause

org.rhq.core.domain.resource.group.ResourceGroup getByGroupDefinitionAndGroupByClause(int groupDefinitionId,
                                                                                      String groupByClause)

setResourceType

void setResourceType(int resourceGroupId)
                     throws ResourceGroupDeleteException
Throws:
ResourceGroupDeleteException

getExplicitGroupMemberCount

int getExplicitGroupMemberCount(int resourceGroupId)

getImplicitGroupMemberCount

int getImplicitGroupMemberCount(int resourceGroupId)

findResourceGroupComposites

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.composite.ResourceGroupComposite> findResourceGroupComposites(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                   org.rhq.core.domain.resource.group.GroupCategory groupCategory,
                                                                                                                                   org.rhq.core.domain.resource.ResourceCategory resourceCategory,
                                                                                                                                   String resourceTypeName,
                                                                                                                                   String pluginName,
                                                                                                                                   String nameFilter,
                                                                                                                                   Integer resourceId,
                                                                                                                                   Integer groupId,
                                                                                                                                   org.rhq.core.domain.util.PageControl pc)

findResourceGroupCompositesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.composite.ResourceGroupComposite> findResourceGroupCompositesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                             org.rhq.core.domain.criteria.ResourceGroupCriteria criteria)

findDeletedResourceGroupIds

List<Integer> findDeletedResourceGroupIds(int[] groupIds)

setAssignedResources

void setAssignedResources(org.rhq.core.domain.auth.Subject subject,
                          int groupId,
                          int[] resourceIds,
                          boolean setType)
                          throws ResourceGroupUpdateException,
                                 ResourceGroupDeleteException
This method ensures that the explicit group membership is set to the specified resources. Members will be added or removed as necessary. Make sure you pass the correct value for the parameter.

For global groups requires MANAGE_INVENTORY. For private groups requires VIEW permission on all specified resources.

Parameters:
subject -
groupId -
resourceIds -
setType - Set to false if the specified resourceIds will not alter the group type (compatible or mixed). Set true to have the group type (re)set automatically, based on the new group membership.
Throws:
ResourceGroupUpdateException
ResourceGroupDeleteException

setAssignedResourceGroupsForResource

void setAssignedResourceGroupsForResource(org.rhq.core.domain.auth.Subject subject,
                                          int groupId,
                                          int[] resourceIds,
                                          boolean setType)
                                          throws ResourceGroupUpdateException,
                                                 ResourceGroupDeleteException
This method ensures that the resource will have exactly the specified set of explicit group membership. Make sure you pass the correct value for the parameter.

Parameters:
subject -
resourceId -
resourceGroupIds -
setType - Set to false if addition or removal of the specified resourceId will not alter the group type for the specified resource groups (compatible or mixed). Set true to have the group type (re)set automatically, based on the new group membership.
Throws:
ResourceGroupUpdateException
ResourceGroupDeleteException

uninventoryMembers

void uninventoryMembers(org.rhq.core.domain.auth.Subject subject,
                        int groupId)

updateResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject user,
                                                                     org.rhq.core.domain.resource.group.ResourceGroup group,
                                                                     RecursivityChangeType changeType)
                                                                     throws ResourceGroupAlreadyExistsException,
                                                                            ResourceGroupUpdateException
Throws:
ResourceGroupAlreadyExistsException
ResourceGroupUpdateException

updateResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject user,
                                                                     org.rhq.core.domain.resource.group.ResourceGroup group,
                                                                     RecursivityChangeType changeType,
                                                                     boolean updateMembership)
                                                                     throws ResourceGroupAlreadyExistsException,
                                                                            ResourceGroupUpdateException
Throws:
ResourceGroupAlreadyExistsException
ResourceGroupUpdateException

addResourcesToGroup

void addResourcesToGroup(org.rhq.core.domain.auth.Subject subject,
                         int groupId,
                         int[] resourceIds)

createResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup createResourceGroup(org.rhq.core.domain.auth.Subject user,
                                                                     org.rhq.core.domain.resource.group.ResourceGroup group)

deleteResourceGroup

void deleteResourceGroup(org.rhq.core.domain.auth.Subject user,
                         int groupId)
                         throws ResourceGroupNotFoundException,
                                ResourceGroupDeleteException
Throws:
ResourceGroupNotFoundException
ResourceGroupDeleteException

deleteResourceGroups

void deleteResourceGroups(org.rhq.core.domain.auth.Subject user,
                          int[] groupIds)
                          throws ResourceGroupNotFoundException,
                                 ResourceGroupDeleteException
Throws:
ResourceGroupNotFoundException
ResourceGroupDeleteException

getResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup getResourceGroup(org.rhq.core.domain.auth.Subject subject,
                                                                  int groupId)

getResourceGroupComposite

org.rhq.core.domain.resource.group.composite.ResourceGroupComposite getResourceGroupComposite(org.rhq.core.domain.auth.Subject subject,
                                                                                              int groupId)

findResourceGroupsForRole

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupsForRole(org.rhq.core.domain.auth.Subject subject,
                                                                                                              int roleId,
                                                                                                              org.rhq.core.domain.util.PageControl pc)

removeResourcesFromGroup

void removeResourcesFromGroup(org.rhq.core.domain.auth.Subject subject,
                              int groupId,
                              int[] resourceIds)

setRecursive

void setRecursive(org.rhq.core.domain.auth.Subject subject,
                  int groupId,
                  boolean isRecursive)

updateResourceGroup

org.rhq.core.domain.resource.group.ResourceGroup updateResourceGroup(org.rhq.core.domain.auth.Subject subject,
                                                                     org.rhq.core.domain.resource.group.ResourceGroup group)

findResourceGroupsByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.group.ResourceGroup> findResourceGroupsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                 org.rhq.core.domain.criteria.ResourceGroupCriteria criteria)


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