org.rhq.core.pc.bundle
Class BundleManager

java.lang.Object
  extended by org.rhq.core.pc.agent.AgentService
      extended by org.rhq.core.pc.bundle.BundleManager
All Implemented Interfaces:
BundleAgentService, ContainerService, BundleManagerProvider

public class BundleManager
extends AgentService
implements BundleAgentService, BundleManagerProvider, ContainerService

Manages the bundle subsystem, which allows bundles of content to be installed.

This is an agent service; its interface is made remotely accessible if this is deployed within the agent.

Author:
John Mazzitelli

Nested Class Summary
 
Nested classes/interfaces inherited from class org.rhq.core.pc.agent.AgentService
AgentService.LifecycleState
 
Constructor Summary
BundleManager()
           
 
Method Summary
 void auditDeployment(org.rhq.core.domain.bundle.BundleResourceDeployment bundleResourceDeployment, String action, String info, org.rhq.core.domain.bundle.BundleResourceDeploymentHistory.Category category, org.rhq.core.domain.bundle.BundleResourceDeploymentHistory.Status status, String message, String attachment)
           
 void auditDeployment(org.rhq.core.domain.bundle.BundleResourceDeployment bundleResourceDeployment, String action, String info, String message)
          convenience method:
category defaults to null
status defaults to SUCCESS
attachment defaults null
 List<org.rhq.core.domain.content.PackageVersion> getAllBundleVersionPackageVersions(org.rhq.core.domain.bundle.BundleVersion bundleVersion)
           
protected  BundleFacet getBundleFacet(int resourceId, long timeout)
          Given a resource, this obtains that resource's BundleFacet interface.
 long getFileContent(org.rhq.core.domain.content.PackageVersion packageVersion, OutputStream outputStream)
           
protected  InventoryManager getInventoryManager()
          Returns the manager that can provide data on the inventory.
protected  MeasurementManager getMeasurementManager()
          Returns the manager that can provide data on the measurements/metrics.
 void initialize()
          Initializes the container service which will effectively tell the service to start doing its work.
 BundlePurgeResponse purge(BundlePurgeRequest request)
           
 BundleScheduleResponse schedule(BundleScheduleRequest request)
           
 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.
 
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

BundleManager

public BundleManager()
Method Detail

setConfiguration

public void setConfiguration(PluginContainerConfiguration configuration)
Description copied from interface: ContainerService
Informs the container service how it should be configured by providing the full plugin container configuration. The plugin container will ensure it passes in a non-null configuration object so implementations of this interface should never have to worry about a null configuration parameter value.

Specified by:
setConfiguration in interface ContainerService

initialize

public void initialize()
Description copied from interface: ContainerService
Initializes the container service which will effectively tell the service to start doing its work. Implementations of this interface can be assured that prior to this method being called, a non-null configuration will be set via a call to ContainerService.setConfiguration(PluginContainerConfiguration).

Specified by:
initialize in interface ContainerService

shutdown

public void shutdown()
Description copied from interface: ContainerService
Stops the container service which effectively releases all runtime resources such as running threads.

Specified by:
shutdown in interface ContainerService

getAllBundleVersionPackageVersions

public List<org.rhq.core.domain.content.PackageVersion> getAllBundleVersionPackageVersions(org.rhq.core.domain.bundle.BundleVersion bundleVersion)
                                                                                    throws Exception
Specified by:
getAllBundleVersionPackageVersions in interface BundleManagerProvider
Throws:
Exception

getFileContent

public long getFileContent(org.rhq.core.domain.content.PackageVersion packageVersion,
                           OutputStream outputStream)
                    throws Exception
Specified by:
getFileContent in interface BundleManagerProvider
Throws:
Exception

schedule

public BundleScheduleResponse schedule(BundleScheduleRequest request)
Specified by:
schedule in interface BundleAgentService

purge

public BundlePurgeResponse purge(BundlePurgeRequest request)
Specified by:
purge in interface BundleAgentService

auditDeployment

public void auditDeployment(org.rhq.core.domain.bundle.BundleResourceDeployment bundleResourceDeployment,
                            String action,
                            String info,
                            String message)
convenience method:
category defaults to null
status defaults to SUCCESS
attachment defaults null

Parameters:
bundleResourceDeployment - not null
action - not null
info - not null
message -

auditDeployment

public void auditDeployment(org.rhq.core.domain.bundle.BundleResourceDeployment bundleResourceDeployment,
                            String action,
                            String info,
                            org.rhq.core.domain.bundle.BundleResourceDeploymentHistory.Category category,
                            org.rhq.core.domain.bundle.BundleResourceDeploymentHistory.Status status,
                            String message,
                            String attachment)
Specified by:
auditDeployment in interface BundleManagerProvider

getBundleFacet

protected BundleFacet getBundleFacet(int resourceId,
                                     long timeout)
                              throws PluginContainerException
Given a resource, this obtains that resource's BundleFacet interface. If the resource does not support that facet, an exception is thrown. The resource must be in the STARTED (i.e. connected) state.

Parameters:
resourceId - identifies the resource that is to perform the bundle activities
timeout - if any facet method invocation thread has not completed after this many milliseconds, interrupt it; value must be positive
Returns:
the resource's bundle facet interface
Throws:
PluginContainerException - on error

getInventoryManager

protected InventoryManager getInventoryManager()
Returns the manager that can provide data on the inventory. This is a separate protected method so we can extend our manger class to have a mock manager for testing.

Returns:
the inventory manager

getMeasurementManager

protected MeasurementManager getMeasurementManager()
Returns the manager that can provide data on the measurements/metrics. This is a separate protected method so we can extend our manger class to have a mock manager for testing.

Returns:
the inventory manager


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