|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.resource.ResourceAvailabilityManagerBean
public class ResourceAvailabilityManagerBean
A manager that provides methods for manipulating and querying the cached current availability for Resources.
| Constructor Summary | |
|---|---|
ResourceAvailabilityManagerBean()
|
|
| Method Summary | |
|---|---|
org.rhq.core.domain.measurement.ResourceAvailability |
getLatestAvailability(int resourceId)
Returns the latest availability for the given Resource |
org.rhq.core.domain.measurement.AvailabilityType |
getLatestAvailabilityType(org.rhq.core.domain.auth.Subject whoami,
int resourceId)
Returns the latest availability type for the given resource. |
void |
init()
|
void |
insertNeededAvailabilityForImportedResources(List<Integer> resourceIds)
The first time an agent is started and its platform and top-level servers are discovered, the DiscoveryBossBean.mergeInventoryReport(InventoryReport) will use the
EntityManager to persist the resource. |
void |
updateAllResourcesAvailabilitiesForAgent(int agentId,
org.rhq.core.domain.measurement.AvailabilityType availabilityType)
Marks all resources managed by the specified agent as down |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceAvailabilityManagerBean()
| Method Detail |
|---|
@PostConstruct public void init()
public void insertNeededAvailabilityForImportedResources(List<Integer> resourceIds)
ResourceAvailabilityManagerLocalDiscoveryBossBean.mergeInventoryReport(InventoryReport) will use the
EntityManager to persist the resource. A PostPersist hook exists on the
Resource entity to create a corresponding default ResourceAvailability
entity. However, when a platform or top-level server is removed from inventory, the agent
might rediscover the resource so quickly that InventoryReport merges the resource
instead of persisting new ones, bypassing the PostPersist hook. As a result, this
method should be called when resources are imported from the auto-discovery portlet (the
InventoryStatus is changed from NEW to COMMITTED, which will add the necessary
default ResourceAvailability objects to those resources missing them.
insertNeededAvailabilityForImportedResources in interface ResourceAvailabilityManagerLocalresourceIds - a list of resource ids which should have default ResourceAvailability
objects created for them, only if the corresponding data doesn't already exist.
public org.rhq.core.domain.measurement.AvailabilityType getLatestAvailabilityType(org.rhq.core.domain.auth.Subject whoami,
int resourceId)
ResourceAvailabilityManagerLocal
getLatestAvailabilityType in interface ResourceAvailabilityManagerLocalwhoami - the user asking for the dataresourceId - the id of the resource
null if not knownpublic org.rhq.core.domain.measurement.ResourceAvailability getLatestAvailability(int resourceId)
ResourceAvailabilityManagerLocal
getLatestAvailability in interface ResourceAvailabilityManagerLocalresourceId - the id of the resource
public void updateAllResourcesAvailabilitiesForAgent(int agentId,
org.rhq.core.domain.measurement.AvailabilityType availabilityType)
ResourceAvailabilityManagerLocal
updateAllResourcesAvailabilitiesForAgent in interface ResourceAvailabilityManagerLocalagentId - the id of the agent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||