org.rhq.enterprise.server.resource
Interface ResourceManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface ResourceManagerRemote

Author:
Asaf Shakarchi, Jay Shaughnessy, Simeon Pinder

Method Summary
 PageList<Resource> findChildResources(Subject subject, int resourceId, PageControl pageControl)
           
 PageList<ResourceComposite> findResourceComposites(Subject subject, ResourceCategory category, String typeName, int parentResourceId, String searchString, PageControl pageControl)
           
 List<Resource> findResourceLineage(Subject subject, int resourceId)
          Returns the lineage of the Resource with the specified id.
 PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria)
           
 Resource getParentResource(Subject subject, int resourceId)
           
 Resource getResource(Subject subject, int resourceId)
          Returns the Resource with the specified id.
 void uninventoryResources(Subject subject, int[] resourceIds)
          Removes these resources from inventory.
 

Method Detail

getResource

Resource getResource(Subject subject,
                     int resourceId)
Returns the Resource with the specified id.

Parameters:
subject - The logged in user's subject.
resourceId - the id of a Resource in inventory.
Returns:
the resource
Throws:
FetchException - if the resource represented by the resourceId parameter does not exist, or if the passed subject does not have permission to view this resource.

findResourceLineage

List<Resource> findResourceLineage(Subject subject,
                                   int resourceId)
Returns the lineage of the Resource with the specified id. The lineage is represented as a List of Resources, with the first item being the root of the Resource's ancestry (or the Resource itself if it is a root Resource (i.e. a platform)) and the last item being the Resource itself. Since the lineage includes the Resource itself, the returned List will always contain at least one item.

Parameters:
subject - The logged in user's subject.
resourceId - the id of a Resource in inventory
Returns:
the lineage of the Resource with the specified id
Throws:
FetchException - on any issue. Wraps ResourceNotFoundException when necessary.

uninventoryResources

void uninventoryResources(Subject subject,
                          int[] resourceIds)
Removes these resources from inventory. The resources may subsequently be rediscovered. Note that for each specified resource all children will also be removed, it it not necessary or recommended to specify more than one resource in the same ancestry line.

Parameters:
subject - The logged in user's subject.
resourceIds - The resources to uninventory.

findResourceComposites

PageList<ResourceComposite> findResourceComposites(Subject subject,
                                                   ResourceCategory category,
                                                   String typeName,
                                                   int parentResourceId,
                                                   String searchString,
                                                   PageControl pageControl)

findResourcesByCriteria

PageList<Resource> findResourcesByCriteria(Subject subject,
                                           ResourceCriteria criteria)

findChildResources

PageList<Resource> findChildResources(Subject subject,
                                      int resourceId,
                                      PageControl pageControl)

getParentResource

Resource getParentResource(Subject subject,
                           int resourceId)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.