org.rhq.core.clientapi.server.discovery
Interface DiscoveryServerService


public interface DiscoveryServerService

The interface to a JON server's resource discovery subsystem.


Field Summary
static String CONCURRENCY_LIMIT_AVAILABILITY_REPORT
           
static String CONCURRENCY_LIMIT_INVENTORY_REPORT
           
static String CONCURRENCY_LIMIT_INVENTORY_SYNC
           
 
Method Summary
 MergeResourceResponse addResource(Resource resource, int creatorSubjectId)
          Merges the specified resource into inventory.
 void clearResourceConfigError(int resourceId)
          Clears errors of type ResourceErrorType.INVALID_PLUGIN_CONFIGURATION
 Map<Integer,InventoryStatus> getInventoryStatus(int rootResourceId, boolean descendants)
          Retrieve a set of inventory statuses for a resource and potentially its descendants.
 Set<Resource> getResources(Set<Integer> resourceIds, boolean includeDescendants)
          Returns the Resources with the given id's, optionally including all descendant Resources.
 boolean mergeAvailabilityReport(AvailabilityReport availabilityReport)
          Merges a new availability report from the agent into the server.
 ResourceSyncInfo mergeInventoryReport(InventoryReport inventoryReport)
          Merge the platform/servers/services contained in the specified inventory report into the server's inventory.
 Set<ResourceMeasurementScheduleRequest> postProcessNewlyCommittedResources(Set<Integer> resourceIds)
          Gives the server a chance to apply any necessary post-processing that's needed for newly committed resources that have been successfully synchronized on the agent.
 void setResourceError(ResourceError resourceError)
          Indicates that an error occurred on a resource.
 boolean updateResourceVersion(int resourceId, String version)
          Updates the version of the specified Resource in inventory, if it is indeed in inventory.
 

Field Detail

CONCURRENCY_LIMIT_INVENTORY_REPORT

static final String CONCURRENCY_LIMIT_INVENTORY_REPORT
See Also:
Constant Field Values

CONCURRENCY_LIMIT_AVAILABILITY_REPORT

static final String CONCURRENCY_LIMIT_AVAILABILITY_REPORT
See Also:
Constant Field Values

CONCURRENCY_LIMIT_INVENTORY_SYNC

static final String CONCURRENCY_LIMIT_INVENTORY_SYNC
See Also:
Constant Field Values
Method Detail

mergeInventoryReport

@LimitedConcurrency(value="rhq.server.concurrency-limit.inventory-report")
@Timeout(value=1800000L)
ResourceSyncInfo mergeInventoryReport(InventoryReport inventoryReport)
                                      throws InvalidInventoryReportException
Merge the platform/servers/services contained in the specified inventory report into the server's inventory. Note that the plugin container will use this method to send the results of both platform/server scans and service scans. In the case of the former, the server will queue the inventory updates and require the JON administrator to approve them before merging them into inventory.

Parameters:
inventoryReport - a report containing updated inventory data
Returns:
response that contains information the plugin container will need in order to sync itself up with new data that the server had to create in order to merge the report into its inventory
Throws:
InvalidInventoryReportException - if the inventory report contains invalid data

mergeAvailabilityReport

@LimitedConcurrency(value="rhq.server.concurrency-limit.availability-report")
boolean mergeAvailabilityReport(AvailabilityReport availabilityReport)
Merges a new availability report from the agent into the server. This updates the availability statuses of known resources.

Parameters:
availabilityReport - report containing updated availability statuses for a set of resources
Returns:
If true, this indicates everything seems OK - the server merged everything successfully and the server and agent seem to be in sync with each. If false, the server thinks something isn't right and it may be out of sync with the agent. When false is returned, the caller should send a full availability report the next time in order to ensure the server and agent are in sync. true should always be returned if the given availability report is already a full report.

getResources

Set<Resource> getResources(Set<Integer> resourceIds,
                           boolean includeDescendants)
Returns the Resources with the given id's, optionally including all descendant Resources.

Parameters:
resourceIds -
includeDescendants -
Returns:
a tree of resources with the latest data

setResourceError

@Asynchronous(guaranteedDelivery=false)
void setResourceError(ResourceError resourceError)
Indicates that an error occurred on a resource.

Parameters:
resourceError - all information about the error that occurred

clearResourceConfigError

@Asynchronous(guaranteedDelivery=true)
void clearResourceConfigError(int resourceId)
Clears errors of type ResourceErrorType.INVALID_PLUGIN_CONFIGURATION

Parameters:
resourceId - id of the resource

getInventoryStatus

@LimitedConcurrency(value="rhq.server.concurrency-limit.inventory-sync")
Map<Integer,InventoryStatus> getInventoryStatus(int rootResourceId,
                                                                        boolean descendants)
Retrieve a set of inventory statuses for a resource and potentially its descendants.

Parameters:
rootResourceId - a Resource id
descendants - true if the resource's descendants should be included, or false if not
Returns:
a map of the resourceId to the inventory status

addResource

MergeResourceResponse addResource(Resource resource,
                                  int creatorSubjectId)
Merges the specified resource into inventory.

Parameters:
resource - the resource to be merged
creatorSubjectId - the Subject id of the JON user that requested the addition of the resource
Returns:
a response containing the merged resource, as well as whether the resource already existed in inventory

updateResourceVersion

boolean updateResourceVersion(int resourceId,
                              String version)
Updates the version of the specified Resource in inventory, if it is indeed in inventory.

Parameters:
resourceId - the id of the Resource to be updated
version - the new version
Returns:
true if the Resource was updated, or false if the Resource was not in inventory

postProcessNewlyCommittedResources

@LimitedConcurrency(value="rhq.server.concurrency-limit.inventory-sync")
Set<ResourceMeasurementScheduleRequest> postProcessNewlyCommittedResources(Set<Integer> resourceIds)
Gives the server a chance to apply any necessary post-processing that's needed for newly committed resources that have been successfully synchronized on the agent.

Parameters:
resourceIds - a collection ofResource ids that have been newly committed and successfully synchronized on the agent
Returns:
the current list of measurement schedules that should be installed agent side for each resource contained within the passed set


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