|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.pc.agent.AgentService
org.rhq.core.pc.inventory.InventoryManager
public class InventoryManager
Manages the process of both auto-detection of servers and runtime detection of services across all plugins. Manages their scheduling and result sending as well as the general inventory model.
This is an Agent service; its DiscoveryAgentService interface is made remotely accessible if it is deployed within the Agent.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.rhq.core.pc.agent.AgentService |
|---|
AgentService.LifecycleState |
| Constructor Summary | |
|---|---|
InventoryManager()
|
|
| Method Summary | ||
|---|---|---|
void |
activateResource(org.rhq.core.domain.resource.Resource resource,
ResourceContainer container,
boolean updatedPluginConfig)
This will start the resource's plugin component, creating it first if it has not yet been created. |
|
void |
addInventoryEventListener(InventoryEventListener listener)
Instructs the inventory manager to notify the specified listener of inventory change events. |
|
|
createResourceUpgradeContext(org.rhq.core.domain.resource.Resource resource,
ResourceContext<?> parentResourceContext,
T parentComponent,
ResourceDiscoveryComponent<T> discoveryComponent)
|
|
void |
deactivateResource(org.rhq.core.domain.resource.Resource resource)
Shutdown the ResourceComponents from the bottom up. |
|
void |
disableServiceScans(int serverResourceId)
|
|
void |
enableServiceScans(int serverResourceId,
org.rhq.core.domain.configuration.Configuration config)
|
|
org.rhq.core.domain.discovery.AvailabilityReport |
executeAvailabilityScanImmediately(boolean changedOnlyReport)
|
|
InventoryReport |
executeServerScanImmediately()
|
|
void |
executeServiceScanDeferred()
|
|
InventoryReport |
executeServiceScanImmediately()
|
|
org.rhq.core.domain.resource.Agent |
getAgent()
|
|
org.rhq.core.domain.measurement.Availability |
getAvailabilityIfKnown(org.rhq.core.domain.resource.Resource resource)
Returns the known availability for the resource. |
|
org.rhq.core.domain.measurement.Availability |
getCurrentAvailability(org.rhq.core.domain.resource.Resource resource)
|
|
DiscoveryComponentProxyFactory |
getDiscoveryComponentProxyFactory()
|
|
org.rhq.core.domain.resource.Resource |
getPlatform()
|
|
ResourceComponent<?> |
getResourceComponent(org.rhq.core.domain.resource.Resource resource)
|
|
ResourceContainer |
getResourceContainer(CanonicalResourceKey canonicalId)
|
|
ResourceContainer |
getResourceContainer(Integer resourceId)
|
|
ResourceContainer |
getResourceContainer(org.rhq.core.domain.resource.Resource resource)
|
|
ResourceContainer |
getResourceContainer(String uuid)
|
|
Set<org.rhq.core.domain.resource.Resource> |
getResourcesWithType(org.rhq.core.domain.resource.ResourceType serverType)
Lookup all the servers with a particular server type |
|
boolean |
handleInvalidPluginConfigurationResourceError(org.rhq.core.domain.resource.Resource resource,
Throwable t)
This will send a resource error to the server (if applicable) to indicate that the given resource could not be connected to due to an invalid plugin configuration. |
|
void |
handleReport(org.rhq.core.domain.discovery.AvailabilityReport report)
|
|
boolean |
handleReport(InventoryReport report)
Send an inventory report to the Server. |
|
boolean |
hasUpgradeMergeFailed()
|
|
void |
initialize()
Initializes the container service which will effectively tell the service to start doing its work. |
|
Set<DiscoveredResourceDetails> |
invokeDiscoveryComponent(ResourceContainer parentResourceContainer,
ResourceDiscoveryComponent component,
ResourceDiscoveryContext context)
Invokes the given discovery component in order to discover resources. |
|
List<URL> |
invokeDiscoveryComponentClassLoaderFacet(org.rhq.core.domain.resource.Resource resource,
ResourceDiscoveryComponent component,
ResourceContainer parentContainer)
Invokes the given discovery component's ClassLoaderFacet in order to obtain additional jars for the resource's classloader. |
|
|
invokeDiscoveryComponentResourceUpgradeFacet(org.rhq.core.domain.resource.ResourceType resourceType,
ResourceDiscoveryComponent<T> component,
ResourceUpgradeContext<T> inventoriedResource,
ResourceContainer parentResourceContainer)
|
|
org.rhq.core.domain.discovery.MergeResourceResponse |
manuallyAddResource(org.rhq.core.domain.resource.ResourceType resourceType,
int parentResourceId,
org.rhq.core.domain.configuration.Configuration pluginConfiguration,
int ownerSubjectId)
|
|
org.rhq.core.domain.resource.Resource |
mergeResourceFromDiscovery(org.rhq.core.domain.resource.Resource resource,
org.rhq.core.domain.resource.Resource parent)
|
|
void |
mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests)
|
|
void |
notifyForAllActivatedResources(InventoryEventListener listener)
During initialization time, the inventory manager will active resources after loading them from disk. |
|
void |
performServiceScan(int resourceId)
Performs a service scan on the specified Resource. |
|
void |
removeInventoryEventListener(InventoryEventListener listener)
Removes the specified listener from notification of inventory change events. |
|
void |
setConfiguration(PluginContainerConfiguration configuration)
Informs the container service how it should be configured by providing the full plugin container configuration. |
|
void |
shutdown()
Stops the container service which effectively releases all runtime resources such as running threads. |
|
void |
synchronizeInventory(org.rhq.core.domain.discovery.ResourceSyncInfo syncInfo)
|
|
void |
uninventoryResource(int resourceId)
|
|
org.rhq.core.domain.measurement.Availability |
updateAvailability(org.rhq.core.domain.resource.Resource resource,
org.rhq.core.domain.measurement.AvailabilityType availabilityType)
Inject a new availability |
|
void |
updatePluginConfiguration(int resourceId,
org.rhq.core.domain.configuration.Configuration newPluginConfiguration)
|
|
| Methods inherited from class org.rhq.core.pc.agent.AgentService |
|---|
addLifecycleListener, getClientInterface, notifyLifecycleListenersOfNewState, remoteInputStream, remoteOutputStream, removeLifecycleListener, setAgentServiceStreamRemoter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InventoryManager()
| Method Detail |
|---|
public void initialize()
ContainerServicenull
configuration will be set via a call to ContainerService.setConfiguration(PluginContainerConfiguration).
initialize in interface ContainerServiceContainerService.initialize()public void shutdown()
ContainerService
shutdown in interface ContainerServiceContainerService.shutdown()
public Set<DiscoveredResourceDetails> invokeDiscoveryComponent(ResourceContainer parentResourceContainer,
ResourceDiscoveryComponent component,
ResourceDiscoveryContext context)
throws DiscoverySuspendedException,
Exception
null if for some reason
we could not invoke the discovery component.
parentResourceContainer - the container of the resource under which we are going to execute the discoverycomponent - the discovery component that will actually go out and discover resourcescontext - the context for use by the discovery component
null
DiscoverySuspendedException - if the discovery is suspended due to a resource upgrade failure
Exception - if the discovery component threw an exception
public List<URL> invokeDiscoveryComponentClassLoaderFacet(org.rhq.core.domain.resource.Resource resource,
ResourceDiscoveryComponent component,
ResourceContainer parentContainer)
throws Throwable
resource - the resource whose component is to be invokedcomponent - the discovery component that will actually go out and discover resourcesparentContainer - the activated parent container
Throwable - if the discovery component threw an exception
public <T extends ResourceComponent<?>> org.rhq.core.domain.resource.ResourceUpgradeReport invokeDiscoveryComponentResourceUpgradeFacet(org.rhq.core.domain.resource.ResourceType resourceType,
ResourceDiscoveryComponent<T> component,
ResourceUpgradeContext<T> inventoriedResource,
ResourceContainer parentResourceContainer)
throws Throwable
Throwablepublic DiscoveryComponentProxyFactory getDiscoveryComponentProxyFactory()
@Nullable public ResourceContainer getResourceContainer(String uuid)
@Nullable public ResourceContainer getResourceContainer(CanonicalResourceKey canonicalId)
@Nullable public ResourceContainer getResourceContainer(org.rhq.core.domain.resource.Resource resource)
@Nullable public ResourceContainer getResourceContainer(Integer resourceId)
public void setConfiguration(PluginContainerConfiguration configuration)
ContainerServicenull configuration object so implementations of
this interface should never have to worry about a null configuration parameter value.
setConfiguration in interface ContainerService
public void updatePluginConfiguration(int resourceId,
org.rhq.core.domain.configuration.Configuration newPluginConfiguration)
throws InvalidPluginConfigurationClientException,
PluginContainerException
updatePluginConfiguration in interface DiscoveryAgentServiceInvalidPluginConfigurationClientException
PluginContainerExceptionpublic InventoryReport executeServerScanImmediately()
executeServerScanImmediately in interface DiscoveryAgentServicepublic InventoryReport executeServiceScanImmediately()
executeServiceScanImmediately in interface DiscoveryAgentServicepublic void executeServiceScanDeferred()
executeServiceScanDeferred in interface DiscoveryAgentServicepublic org.rhq.core.domain.discovery.AvailabilityReport executeAvailabilityScanImmediately(boolean changedOnlyReport)
executeAvailabilityScanImmediately in interface DiscoveryAgentService@NotNull public org.rhq.core.domain.measurement.Availability getCurrentAvailability(org.rhq.core.domain.resource.Resource resource)
getCurrentAvailability in interface DiscoveryAgentService
public org.rhq.core.domain.discovery.MergeResourceResponse manuallyAddResource(org.rhq.core.domain.resource.ResourceType resourceType,
int parentResourceId,
org.rhq.core.domain.configuration.Configuration pluginConfiguration,
int ownerSubjectId)
throws InvalidPluginConfigurationClientException,
PluginContainerException
manuallyAddResource in interface DiscoveryAgentServiceInvalidPluginConfigurationClientException
PluginContainerException@Nullable public org.rhq.core.domain.measurement.Availability getAvailabilityIfKnown(org.rhq.core.domain.resource.Resource resource)
null is returned.
resource - the resource whose availability should be returned
null if not knownpublic void handleReport(org.rhq.core.domain.discovery.AvailabilityReport report)
public boolean handleReport(InventoryReport report)
report - the inventory report to be sent
public void performServiceScan(int resourceId)
resourceId - the id of the Resource on which to discover services@Nullable public ResourceComponent<?> getResourceComponent(org.rhq.core.domain.resource.Resource resource)
public void uninventoryResource(int resourceId)
uninventoryResource in interface DiscoveryAgentServicepublic org.rhq.core.domain.resource.Resource getPlatform()
getPlatform in interface DiscoveryAgentServicepublic org.rhq.core.domain.resource.Agent getAgent()
public org.rhq.core.domain.measurement.Availability updateAvailability(org.rhq.core.domain.resource.Resource resource,
org.rhq.core.domain.measurement.AvailabilityType availabilityType)
resource - availabilityType -
public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests)
throws Exception
Exception
public org.rhq.core.domain.resource.Resource mergeResourceFromDiscovery(org.rhq.core.domain.resource.Resource resource,
org.rhq.core.domain.resource.Resource parent)
throws PluginContainerException
PluginContainerExceptionpublic void notifyForAllActivatedResources(InventoryEventListener listener)
listener - the listener that will be notified for every resource currently active
public void activateResource(org.rhq.core.domain.resource.Resource resource,
@NotNull
ResourceContainer container,
boolean updatedPluginConfig)
throws InvalidPluginConfigurationException,
PluginContainerException
resource - the resource that the component will managecontainer - the wrapper around the resource and its componentupdatedPluginConfig - if true, this will indicate that the resource's plugin configuration is
known to have changed since the last time the resource component was started
InvalidPluginConfigurationException - when connecting to the managed resource fails due to an invalid
plugin configuration
PluginContainerException - for all other errors
public <T extends ResourceComponent<?>> ResourceUpgradeContext<T> createResourceUpgradeContext(org.rhq.core.domain.resource.Resource resource,
ResourceContext<?> parentResourceContext,
T parentComponent,
ResourceDiscoveryComponent<T> discoveryComponent)
public boolean handleInvalidPluginConfigurationResourceError(org.rhq.core.domain.resource.Resource resource,
Throwable t)
resource - the resource that could not be connected tot - the exception that indicates the problem with the plugin configuration
public Set<org.rhq.core.domain.resource.Resource> getResourcesWithType(org.rhq.core.domain.resource.ResourceType serverType)
serverType - the server type to match against
public void deactivateResource(org.rhq.core.domain.resource.Resource resource)
resource - The resource to deactivatepublic void synchronizeInventory(org.rhq.core.domain.discovery.ResourceSyncInfo syncInfo)
synchronizeInventory in interface DiscoveryAgentServicepublic void addInventoryEventListener(InventoryEventListener listener)
listener - instance to notify of change eventspublic void removeInventoryEventListener(InventoryEventListener listener)
listener - instance to remove from event notificationpublic boolean hasUpgradeMergeFailed()
public void enableServiceScans(int serverResourceId,
org.rhq.core.domain.configuration.Configuration config)
enableServiceScans in interface DiscoveryAgentServicepublic void disableServiceScans(int serverResourceId)
disableServiceScans in interface DiscoveryAgentService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||