|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.resource.ResourceManagerBean
public class ResourceManagerBean
A manager that provides methods for creating, updating, deleting, and querying Resources.
| Constructor Summary | |
|---|---|
ResourceManagerBean()
|
|
| Method Summary | |
|---|---|
void |
addResourceError(ResourceError resourceError)
Indicates an error occurred on a resource. |
boolean |
bulkNamedQueryDeleteInNewTransaction(Subject subject,
java.lang.String namedQuery,
java.util.List<java.lang.Integer> resourceIds)
|
boolean |
bulkNativeQueryDeleteInNewTransaction(Subject subject,
java.lang.String nativeQueryString,
java.util.List<java.lang.Integer> resourceIds)
|
void |
clearResourceConfigError(int resourceId)
Clears errors of type ResourceErrorType.INVALID_PLUGIN_CONFIGURATION |
void |
createResource(Subject user,
Resource resource,
int parentId)
Create a new Resource. |
java.util.List<java.lang.Integer> |
deleteResource(Subject user,
int resourceId)
This will delete the resource with the given ID along with all of its child resources. |
void |
deleteResourceError(Subject user,
int resourceErrorId)
Deletes the given resource error, effectively removing it from its resource's list of errors. |
java.util.List<java.lang.Integer> |
deleteResources(Subject user,
int[] resourceIds)
This will delete the resources with the given ID along with all of their child resources. |
void |
deleteSingleResourceInNewTransaction(Subject user,
int resourceId)
Deletes the given resource (but not its children) in a new transaction. |
PageList<Resource> |
findAvailableResourcesForDashboardPortlet(Subject user,
java.lang.Integer typeId,
ResourceCategory category,
int[] excludeIds,
PageControl pageControl)
|
PageList<Resource> |
findAvailableResourcesForRepo(Subject user,
int repoId,
java.lang.String search,
ResourceCategory category,
PageControl pageControl)
|
PageList<Resource> |
findAvailableResourcesForResourceGroup(Subject user,
int groupId,
ResourceType type,
ResourceCategory category,
java.lang.String nameFilter,
int[] excludeIds,
PageControl pageControl)
|
java.util.List<AutoGroupComposite> |
findChildrenAutoGroups(Subject user,
int parentResourceId)
|
java.util.List<AutoGroupComposite> |
findChildrenAutoGroups(Subject user,
int parentResourceId,
int[] resourceTypeIds)
|
java.util.List<java.lang.Integer> |
findChildrenResourceIds(int parentResourceId,
InventoryStatus status)
|
PageList<Resource> |
findChildResources(Subject subject,
int parentResourceId,
PageControl pageControl)
|
PageList<Resource> |
findChildResources(Subject user,
Resource parent,
PageControl pageControl)
|
PageList<Resource> |
findChildResourcesByCategoryAndInventoryStatus(Subject user,
Resource parent,
ResourceCategory category,
InventoryStatus status,
PageControl pageControl)
|
java.util.List<java.lang.Integer> |
findExplicitResourceIdsByResourceGroup(int resourceGroupId)
|
PageList<Resource> |
findExplicitResourcesByResourceGroup(Subject user,
ResourceGroup group,
PageControl pageControl)
|
PageList<ResourceWithAvailability> |
findExplicitResourceWithAvailabilityByResourceGroup(Subject subject,
ResourceGroup group,
PageControl pageControl)
|
java.util.List<ResourceIdFlyWeight> |
findFlyWeights(int[] resourceIds)
|
java.util.List<java.lang.Integer> |
findImplicitResourceIdsByResourceGroup(int resourceGroupId)
|
PageList<Resource> |
findImplicitResourcesByResourceGroup(Subject user,
ResourceGroup group,
PageControl pageControl)
|
PageList<ResourceWithAvailability> |
findImplicitResourceWithAvailabilityByResourceGroup(Subject subject,
ResourceGroup group,
PageControl pageControl)
|
java.util.List<RecentlyAddedResourceComposite> |
findRecentlyAddedPlatforms(Subject user,
long ctime,
int maxItems)
Gets a list of platforms that were recently added (committed) to inventory. |
java.util.List<RecentlyAddedResourceComposite> |
findRecentlyAddedServers(Subject user,
long ctime,
int platformId)
Gets a list of servers that are children of the given platform that were recently added (committed) to inventory. |
PageList<Resource> |
findResourceByIds(Subject subject,
int[] resourceIds,
boolean attachParentResource,
PageControl pageControl)
|
PageList<Resource> |
findResourceByParentAndInventoryStatus(Subject user,
Resource parent,
InventoryStatus inventoryStatus,
PageControl pageControl)
|
PageList<ResourceComposite> |
findResourceCompositeForParentAndTypeAndCategory(Subject user,
ResourceCategory category,
int resourceTypeId,
Resource parentResource,
PageControl pageControl)
Get a Resource Composite for Resources limited by the given parameters |
PageList<ResourceComposite> |
findResourceComposites(Subject user,
ResourceCategory category,
java.lang.String typeName,
int parentResourceId,
java.lang.String searchString,
PageControl pageControl)
|
PageList<ResourceComposite> |
findResourceComposites(Subject user,
ResourceCategory category,
java.lang.String typeName,
java.lang.String pluginName,
Resource parentResource,
java.lang.String searchString,
boolean attachParentResource,
PageControl pageControl)
This finder query can be used to find resources with various combinations of attributes in their composite form. |
java.util.List<ResourceError> |
findResourceErrors(Subject user,
int resourceId,
ResourceErrorType errorType)
Returns the errors of the given type that have occurred for the given resource. |
PageList<ResourceHealthComposite> |
findResourceHealth(Subject user,
int[] resourceIds,
PageControl pc)
Gets the "health" of a set of resources, where the health composite gives you the resource's availability status and the number of alerts it has emitted. |
java.util.List<ResourceInstallCount> |
findResourceInstallCounts(Subject subject,
boolean groupByVersions)
|
java.util.List<Resource> |
findResourceLineage(Subject subject,
int resourceId)
#see {@link ResourceManagerRemote#findResourceLineage(Subject, int) |
java.util.List<AutoGroupComposite> |
findResourcesAutoGroups(Subject subject,
int[] resourceIds)
|
java.util.List<Resource> |
findResourcesByAgent(Subject user,
int agentId,
PageControl unlimitedInstance)
Load the entire list of resources under an agent. |
PageList<Resource> |
findResourcesByCategory(Subject user,
ResourceCategory category,
InventoryStatus inventoryStatus,
PageControl pageControl)
|
java.util.List<Resource> |
findResourcesByCompatibleGroup(Subject user,
int compatibleGroupId,
PageControl pageControl)
|
PageList<Resource> |
findResourcesByCriteria(Subject subject,
ResourceCriteria criteria)
|
java.util.List<ResourceWithAvailability> |
findResourcesByParentAndType(Subject user,
Resource parent,
ResourceType type)
|
PageList<Resource> |
findResourcesByType(Subject user,
ResourceType resourceType,
PageControl pageControl)
|
java.util.List<java.lang.Integer> |
findResourcesMarkedForAsyncDeletion(Subject user)
|
ResourceAvailabilitySummary |
getAvailabilitySummary(Subject user,
int resourceId)
|
ResourceAvailability |
getLiveResourceAvailability(Subject subject,
int resourceId)
#see {@link ResourceManagerRemote#getLiveResourceAvailability(Subject, int) |
Resource |
getParentResource(int resourceId)
Returns the parent of the Resource with the specified id, or null if the Resource does not have a parent (i.e. |
Resource |
getParentResource(Subject subject,
int resourceId)
|
Resource |
getPlatform(Agent agent)
Returns the platform Resource associated with the specified Agent. |
Resource |
getResource(Subject subject,
int resourceId)
#see {@link ResourceManagerRemote#getResource(Subject, int) |
AutoGroupComposite |
getResourceAutoGroup(Subject user,
int resourceId)
|
Resource |
getResourceById(Subject user,
int resourceId)
|
Resource |
getResourceByParentAndKey(Subject user,
Resource parent,
java.lang.String key,
java.lang.String plugin,
java.lang.String typeName)
|
int |
getResourceCountByCategory(Subject user,
ResourceCategory category,
InventoryStatus status)
|
int |
getResourceCountByTypeAndIds(Subject user,
ResourceType type,
int[] resourceIds)
|
java.util.List<java.lang.Integer> |
getResourceIdLineage(int resourceId)
|
java.util.List<Resource> |
getResourceLineage(int resourceId)
Returns the lineage of the Resource with the specified id. |
java.util.Map<java.lang.Integer,InventoryStatus> |
getResourceStatuses(int rootResourceId,
boolean descendents)
|
Resource |
getResourceTree(int rootResourceId,
boolean recursive)
|
Resource |
getRootResourceForResource(int resourceId)
Looks up the root of a subtree in the inventory. |
Resource |
setResourceStatus(Subject user,
Resource resource,
InventoryStatus newStatus,
boolean setDescendents)
Changes the inventory status of the specified resource and optionally its descendants to the provided inventory status if the user is authorized to do so. |
void |
uninventoryResources(Subject subject,
int[] resourceIds)
#see {@link ResourceManagerRemote#uninventoryResources(Subject, int) |
Resource |
updateResource(Subject user,
Resource resource)
Update an existing Resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceManagerBean()
| Method Detail |
|---|
public void createResource(Subject user,
Resource resource,
int parentId)
throws ResourceAlreadyExistsException
ResourceManagerLocal
createResource in interface ResourceManagerLocaluser - the user creating the resourceresource - the resource to be createdparentId - set to -1 to imply that this is a root resource, which has no parent
ResourceAlreadyExistsException - if an equivalent resource already exists
public Resource updateResource(Subject user,
Resource resource)
ResourceManagerLocal
updateResource in interface ResourceManagerLocaluser - the user updating the resourceresource - the resource to be updated
public java.util.List<java.lang.Integer> deleteResources(Subject user,
int[] resourceIds)
ResourceManagerLocal
deleteResources in interface ResourceManagerLocaluser - the user deleting the resourceresourceIds - the ID of the resource to be deleted
resourceIds and
their childrens' IDs
public java.util.List<java.lang.Integer> deleteResource(Subject user,
int resourceId)
ResourceManagerLocal
deleteResource in interface ResourceManagerLocaluser - the user deleting the resourceresourceId - the ID of the resource to be deleted
resourceId and
its children's IDs
public void deleteSingleResourceInNewTransaction(Subject user,
int resourceId)
ResourceManagerLocalResourceManagerLocal.deleteResource(Subject, int). If you call this
method, make sure you have a specific reason for it; check to see if calling
ResourceManagerLocal.deleteResource(Subject, int) would not be more appropriate.
deleteSingleResourceInNewTransaction in interface ResourceManagerLocaluser - the user deleting the resource
public boolean bulkNativeQueryDeleteInNewTransaction(Subject subject,
java.lang.String nativeQueryString,
java.util.List<java.lang.Integer> resourceIds)
bulkNativeQueryDeleteInNewTransaction in interface ResourceManagerLocal
public boolean bulkNamedQueryDeleteInNewTransaction(Subject subject,
java.lang.String namedQuery,
java.util.List<java.lang.Integer> resourceIds)
bulkNamedQueryDeleteInNewTransaction in interface ResourceManagerLocal
public Resource setResourceStatus(Subject user,
Resource resource,
InventoryStatus newStatus,
boolean setDescendents)
ResourceManagerLocal
setResourceStatus in interface ResourceManagerLocaluser - user doing the resource status changingresource - the Resource to changenewStatus - the new status to change it tosetDescendents - if true, all descendent resources will also have their status set
public Resource getResourceById(Subject user,
int resourceId)
getResourceById in interface ResourceManagerLocal
@Nullable
public Resource getResourceByParentAndKey(Subject user,
Resource parent,
java.lang.String key,
java.lang.String plugin,
java.lang.String typeName)
getResourceByParentAndKey in interface ResourceManagerLocal
public java.util.List<ResourceWithAvailability> findResourcesByParentAndType(Subject user,
Resource parent,
ResourceType type)
findResourcesByParentAndType in interface ResourceManagerLocal@Nullable public Resource getParentResource(int resourceId)
ResourceManagerLocal
getParentResource in interface ResourceManagerLocalresourceId - the id of a Resource in inventory
public java.util.List<java.lang.Integer> getResourceIdLineage(int resourceId)
getResourceIdLineage in interface ResourceManagerLocalpublic java.util.List<Resource> getResourceLineage(int resourceId)
ResourceManagerLocal
getResourceLineage in interface ResourceManagerLocalresourceId - the id of a Resource in inventory
@NotNull public Resource getRootResourceForResource(int resourceId)
ResourceManagerLocal
getRootResourceForResource in interface ResourceManagerLocalresourceId - the resource to find the root parent of
public PageList<Resource> findResourceByParentAndInventoryStatus(Subject user,
Resource parent,
InventoryStatus inventoryStatus,
PageControl pageControl)
findResourceByParentAndInventoryStatus in interface ResourceManagerLocal
public PageList<Resource> findChildResources(Subject user,
Resource parent,
PageControl pageControl)
public java.util.List<java.lang.Integer> findChildrenResourceIds(int parentResourceId,
InventoryStatus status)
findChildrenResourceIds in interface ResourceManagerLocal
public PageList<Resource> findChildResourcesByCategoryAndInventoryStatus(Subject user,
Resource parent,
ResourceCategory category,
InventoryStatus status,
PageControl pageControl)
findChildResourcesByCategoryAndInventoryStatus in interface ResourceManagerLocal
public PageList<Resource> findResourcesByCategory(Subject user,
ResourceCategory category,
InventoryStatus inventoryStatus,
PageControl pageControl)
findResourcesByCategory in interface ResourceManagerLocalResourceManagerRemote#findResourcesByCategory(Subject, ResourceCategory, InventoryStatus, PageControl)
public PageList<ResourceComposite> findResourceComposites(Subject user,
ResourceCategory category,
java.lang.String typeName,
int parentResourceId,
java.lang.String searchString,
PageControl pageControl)
findResourceComposites in interface ResourceManagerLocalfindResourceComposites in interface ResourceManagerRemote
public PageList<ResourceComposite> findResourceComposites(Subject user,
ResourceCategory category,
java.lang.String typeName,
java.lang.String pluginName,
Resource parentResource,
java.lang.String searchString,
boolean attachParentResource,
PageControl pageControl)
findResourceComposites in interface ResourceManagerLocaluser - category - Limit the search to a given ResourceCategorytype - Limit the search to to a given ResourceTypeparentResource - Limit the search to children of a given parent resourcesearchString - pageControl -
ResourceManagerRemote.findResourceComposites(Subject, ResourceCategory, String, int, String, PageControl)
public PageList<ResourceComposite> findResourceCompositeForParentAndTypeAndCategory(Subject user,
ResourceCategory category,
int resourceTypeId,
Resource parentResource,
PageControl pageControl)
findResourceCompositeForParentAndTypeAndCategory in interface ResourceManagerLocaluser - User executing the querycategory - Category this query should be limited toresourceTypeId - the PK of the desired resource type or -1 if no limitparentResource - the desired parent resource or null if no limitpageControl -
public PageList<Resource> findResourcesByType(Subject user,
ResourceType resourceType,
PageControl pageControl)
public int getResourceCountByCategory(Subject user,
ResourceCategory category,
InventoryStatus status)
getResourceCountByCategory in interface ResourceManagerLocal
public int getResourceCountByTypeAndIds(Subject user,
ResourceType type,
int[] resourceIds)
getResourceCountByTypeAndIds in interface ResourceManagerLocalpublic java.util.List<java.lang.Integer> findResourcesMarkedForAsyncDeletion(Subject user)
findResourcesMarkedForAsyncDeletion in interface ResourceManagerLocal
public java.util.List<RecentlyAddedResourceComposite> findRecentlyAddedPlatforms(Subject user,
long ctime,
int maxItems)
ResourceManagerLocal
findRecentlyAddedPlatforms in interface ResourceManagerLocalctime - the oldest time (epoch mills) that a platform had to have been added for it to be returnedmaxItems - the maximum number of items to return within the timeframe
ctime
public java.util.List<RecentlyAddedResourceComposite> findRecentlyAddedServers(Subject user,
long ctime,
int platformId)
ResourceManagerLocal
findRecentlyAddedServers in interface ResourceManagerLocalctime - the oldest time (epoch mills) that a server had to have been added for it to be returned
ctime
public AutoGroupComposite getResourceAutoGroup(Subject user,
int resourceId)
getResourceAutoGroup in interface ResourceManagerLocal
public java.util.List<AutoGroupComposite> findResourcesAutoGroups(Subject subject,
int[] resourceIds)
findResourcesAutoGroups in interface ResourceManagerLocal
@NotNull
public java.util.List<AutoGroupComposite> findChildrenAutoGroups(Subject user,
int parentResourceId,
int[] resourceTypeIds)
findChildrenAutoGroups in interface ResourceManagerLocal
public java.util.List<AutoGroupComposite> findChildrenAutoGroups(Subject user,
int parentResourceId)
findChildrenAutoGroups in interface ResourceManagerLocal
public PageList<Resource> findExplicitResourcesByResourceGroup(Subject user,
ResourceGroup group,
PageControl pageControl)
findExplicitResourcesByResourceGroup in interface ResourceManagerLocalpublic java.util.List<java.lang.Integer> findExplicitResourceIdsByResourceGroup(int resourceGroupId)
findExplicitResourceIdsByResourceGroup in interface ResourceManagerLocalpublic java.util.List<java.lang.Integer> findImplicitResourceIdsByResourceGroup(int resourceGroupId)
findImplicitResourceIdsByResourceGroup in interface ResourceManagerLocalpublic java.util.List<ResourceIdFlyWeight> findFlyWeights(int[] resourceIds)
findFlyWeights in interface ResourceManagerLocal
public PageList<Resource> findImplicitResourcesByResourceGroup(Subject user,
ResourceGroup group,
PageControl pageControl)
findImplicitResourcesByResourceGroup in interface ResourceManagerLocal
public PageList<ResourceWithAvailability> findExplicitResourceWithAvailabilityByResourceGroup(Subject subject,
ResourceGroup group,
PageControl pageControl)
findExplicitResourceWithAvailabilityByResourceGroup in interface ResourceManagerLocal
public PageList<ResourceWithAvailability> findImplicitResourceWithAvailabilityByResourceGroup(Subject subject,
ResourceGroup group,
PageControl pageControl)
findImplicitResourceWithAvailabilityByResourceGroup in interface ResourceManagerLocal
public PageList<ResourceHealthComposite> findResourceHealth(Subject user,
int[] resourceIds,
PageControl pc)
ResourceManagerLocalThis method is here to support the favorites portlet in the dashboard, where the favorites are stored as user preferences - and they can't make it into the preferences unless the user had access to see those resources in the first place, hence, no additional authorizations need to be made here.
findResourceHealth in interface ResourceManagerLocal
public PageList<Resource> findAvailableResourcesForResourceGroup(Subject user,
int groupId,
ResourceType type,
ResourceCategory category,
java.lang.String nameFilter,
int[] excludeIds,
PageControl pageControl)
findAvailableResourcesForResourceGroup in interface ResourceManagerLocal
public PageList<Resource> findAvailableResourcesForRepo(Subject user,
int repoId,
java.lang.String search,
ResourceCategory category,
PageControl pageControl)
findAvailableResourcesForRepo in interface ResourceManagerLocal
public PageList<Resource> findAvailableResourcesForDashboardPortlet(Subject user,
java.lang.Integer typeId,
ResourceCategory category,
int[] excludeIds,
PageControl pageControl)
findAvailableResourcesForDashboardPortlet in interface ResourceManagerLocal
public PageList<Resource> findResourceByIds(Subject subject,
int[] resourceIds,
boolean attachParentResource,
PageControl pageControl)
findResourceByIds in interface ResourceManagerLocal
public Resource getResourceTree(int rootResourceId,
boolean recursive)
getResourceTree in interface ResourceManagerLocalResourceManagerRemote#getResourceTree(int)
@NotNull
public java.util.List<ResourceError> findResourceErrors(Subject user,
int resourceId,
ResourceErrorType errorType)
ResourceManagerLocal
findResourceErrors in interface ResourceManagerLocaluser - the user asking to see the errorsresourceId - the resource whose errors are to be returnederrorType - the type of errors to return
public void addResourceError(ResourceError resourceError)
ResourceManagerLocal
addResourceError in interface ResourceManagerLocalresourceError - encapsulates all information about the errorpublic void clearResourceConfigError(int resourceId)
ResourceManagerLocalResourceErrorType.INVALID_PLUGIN_CONFIGURATION
clearResourceConfigError in interface ResourceManagerLocalresourceId - id of the resource
public void deleteResourceError(Subject user,
int resourceErrorId)
ResourceManagerLocal
deleteResourceError in interface ResourceManagerLocaluser - the user deleting the resource errorresourceErrorId - identifies the resource error to delete
public java.util.Map<java.lang.Integer,InventoryStatus> getResourceStatuses(int rootResourceId,
boolean descendents)
getResourceStatuses in interface ResourceManagerLocalpublic Resource getPlatform(Agent agent)
ResourceManagerLocal
getPlatform in interface ResourceManagerLocalagent - an Agent
public ResourceAvailabilitySummary getAvailabilitySummary(Subject user,
int resourceId)
getAvailabilitySummary in interface ResourceManagerLocal
public java.util.List<Resource> findResourcesByAgent(Subject user,
int agentId,
PageControl unlimitedInstance)
ResourceManagerLocalLockedResourcerce
objects for resources that a user should not have visibility to in order to keep the tree a
directed graph.
findResourcesByAgent in interface ResourceManagerLocaluser - user accessing the treeagentId - the agent id of the platform to return inventory forunlimitedInstance - the filter for the resources
public java.util.List<Resource> findResourcesByCompatibleGroup(Subject user,
int compatibleGroupId,
PageControl pageControl)
findResourcesByCompatibleGroup in interface ResourceManagerLocal
public Resource getResource(Subject subject,
int resourceId)
ResourceManagerLocal
getResource in interface ResourceManagerLocalgetResource in interface ResourceManagerRemotesubject - The logged in user's subject.resourceId - the id of a Resource in inventory.
public ResourceAvailability getLiveResourceAvailability(Subject subject,
int resourceId)
ResourceManagerLocal
getLiveResourceAvailability in interface ResourceManagerLocalgetLiveResourceAvailability in interface ResourceManagerRemotesubject - The logged in user's subject.resourceId - the id of a Resource in inventory.
null,
the resource availability is UNKNOWN.
public java.util.List<Resource> findResourceLineage(Subject subject,
int resourceId)
ResourceManagerLocal
findResourceLineage in interface ResourceManagerLocalfindResourceLineage in interface ResourceManagerRemotesubject - The logged in user's subject.resourceId - the id of a Resource in inventory
public void uninventoryResources(Subject subject,
int[] resourceIds)
ResourceManagerLocal
uninventoryResources in interface ResourceManagerLocaluninventoryResources in interface ResourceManagerRemotesubject - The logged in user's subject.resourceIds - The resources to uninventory.
public java.util.List<ResourceInstallCount> findResourceInstallCounts(Subject subject,
boolean groupByVersions)
findResourceInstallCounts in interface ResourceManagerLocal
public PageList<Resource> findResourcesByCriteria(Subject subject,
ResourceCriteria criteria)
findResourcesByCriteria in interface ResourceManagerLocalfindResourcesByCriteria in interface ResourceManagerRemote
public Resource getParentResource(Subject subject,
int resourceId)
getParentResource in interface ResourceManagerLocalgetParentResource in interface ResourceManagerRemote
public PageList<Resource> findChildResources(Subject subject,
int parentResourceId,
PageControl pageControl)
findChildResources in interface ResourceManagerLocalfindChildResources in interface ResourceManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||