org.rhq.enterprise.server.bundle
Interface BundleManagerLocal

All Superinterfaces:
BundleManagerRemote
All Known Implementing Classes:
BundleManagerBean

public interface BundleManagerLocal
extends BundleManagerRemote

Local interface to the manager responsible for creating and managing bundles.

Author:
John Mazzitelli, Jay Shaughnessy

Method Summary
 void _finalizePurge(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.bundle.BundleDeployment bundleDeployment, Map<org.rhq.core.domain.bundle.BundleResourceDeployment,String> failedToPurge)
          This is for internal use only - when BundleManagerRemote.purgeBundleDestination(Subject, int) is done, it calls this so the purge can be finalized.
 org.rhq.core.domain.bundle.BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(org.rhq.core.domain.auth.Subject subject, int resourceDeploymentId, org.rhq.core.domain.bundle.BundleResourceDeploymentHistory history)
          Called internally to add history when action is taken against a deployment.
 org.rhq.core.domain.bundle.Bundle createBundle(org.rhq.core.domain.auth.Subject subject, String name, String description, int bundleTypeId)
          Mainly Used For Testing
 org.rhq.core.domain.bundle.BundleVersion createBundleAndBundleVersion(org.rhq.core.domain.auth.Subject subject, String bundleName, String bundleDescription, int bundleTypeId, String bundleVersionName, String bundleVersionDescription, String version, String recipe)
          Mainly Used For Testing Convienence method that combines #createBundle(Subject, String, int) and #createBundleVersion(Subject, int, String, String, String).
 org.rhq.core.domain.bundle.BundleDeployment createBundleDeploymentInNewTrans(org.rhq.core.domain.auth.Subject subject, int bundleVersionId, int bundleDestinationId, String name, String description, org.rhq.core.domain.configuration.Configuration configuration)
          Similar to BundleManagerRemote.createBundleDeployment(Subject, int, int, String, Configuration) but supplies the internally generated deploymentName and has different transaction semantics.
 org.rhq.core.domain.bundle.BundleResourceDeployment createBundleResourceDeployment(org.rhq.core.domain.auth.Subject subject, int bundleDeploymentId, int resourceId)
          This is typically not called directly, typically scheduleBundleResourceDeployment() is called externally.
 org.rhq.core.domain.bundle.BundleType createBundleType(org.rhq.core.domain.auth.Subject subject, String name, int resourceTypeId)
          Not generally called.
 org.rhq.core.domain.bundle.BundleVersion createBundleVersion(org.rhq.core.domain.auth.Subject subject, int bundleId, String name, String description, String version, String recipe)
          Mainly Used For Testing
 void deleteBundleDeployment(org.rhq.core.domain.auth.Subject subject, int bundleDeploymentId)
          This is a simple attempt at delete, typically used for removing a poorly defined deployment before it is actually scheduled for deployment.
 void deleteBundleDestination(org.rhq.core.domain.auth.Subject subject, int bundleDestinationId)
          This is a simple attempt at delete, typically used for removing a poorly defined destination.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.BundleDeployment> findBundleDeploymentsByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.BundleDeploymentCriteria criteria)
          Fetch bundle deployments by criteria and then filter on destinations on the result objects to limit what the user can see
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.Bundle> findBundlesByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.BundleCriteria criteria)
          Fetch bundles by criteria and then on the result objects
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.BundleVersion> findBundleVersionsByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.BundleVersionCriteria criteria)
          Fetch bundle versions by criteria and then filter destination on the result objects to limit what the user can see
 HashMap<String,Boolean> getAllBundleVersionFilenames(org.rhq.core.domain.auth.Subject subject, int bundleVersionId)
           
 String getBundleDeploymentName(org.rhq.core.domain.auth.Subject subject, int bundleDestinationId, int bundleVersionId, int prevDeploymentId)
          Needed by the Bundle Deploy and Revert wizards GUI to generate a deployment name for display.
 BundleScheduleRequest getScheduleRequest(org.rhq.core.domain.auth.Subject subject, int resourceDeploymentId, boolean isCleanDeployment, boolean isRevert)
          Not for general consumption.
 org.rhq.core.domain.bundle.BundleResourceDeployment setBundleResourceDeploymentStatus(org.rhq.core.domain.auth.Subject subject, int resourceDeploymentId, org.rhq.core.domain.bundle.BundleDeploymentStatus status)
          Called internally to set deployment status.
 
Methods inherited from interface org.rhq.enterprise.server.bundle.BundleManagerRemote
addBundleFile, addBundleFileViaByteArray, addBundleFileViaPackageVersion, addBundleFileViaURL, createBundleDeployment, createBundleDestination, createBundleVersionViaByteArray, createBundleVersionViaFile, createBundleVersionViaRecipe, createBundleVersionViaURL, deleteBundle, deleteBundles, deleteBundleVersion, findBundleDeploymentsByCriteria, findBundleDestinationsByCriteria, findBundleFilesByCriteria, findBundleResourceDeploymentsByCriteria, findBundlesByCriteria, findBundlesWithLatestVersionCompositesByCriteria, findBundleVersionsByCriteria, getAllBundleTypes, getBundleType, getBundleVersionFilenames, getResourceTypeBundleConfiguration, purgeBundleDestination, scheduleBundleDeployment, scheduleRevertBundleDeployment
 

Method Detail

addBundleResourceDeploymentHistory

org.rhq.core.domain.bundle.BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(org.rhq.core.domain.auth.Subject subject,
                                                                                              int resourceDeploymentId,
                                                                                              org.rhq.core.domain.bundle.BundleResourceDeploymentHistory history)
                                                                                              throws Exception
Called internally to add history when action is taken against a deployment. This executes in a New Transaction and supports deployBundle and Agent requests.

Parameters:
subject -
resourceDeploymentId - id of the deployment appending the history record
history -
Returns:
the persisted history
Throws:
Exception

createBundle

org.rhq.core.domain.bundle.Bundle createBundle(org.rhq.core.domain.auth.Subject subject,
                                               String name,
                                               String description,
                                               int bundleTypeId)
                                               throws Exception
Mainly Used For Testing

Parameters:
subject - user that must have proper permissions
name - not null or empty
description - optional long description of the bundle
bundleTypeId - valid bundleType
Returns:
the persisted Bundle (id is assigned)
Throws:
Exception

createBundleAndBundleVersion

org.rhq.core.domain.bundle.BundleVersion createBundleAndBundleVersion(org.rhq.core.domain.auth.Subject subject,
                                                                      String bundleName,
                                                                      String bundleDescription,
                                                                      int bundleTypeId,
                                                                      String bundleVersionName,
                                                                      String bundleVersionDescription,
                                                                      String version,
                                                                      String recipe)
                                                                      throws Exception
Mainly Used For Testing Convienence method that combines #createBundle(Subject, String, int) and #createBundleVersion(Subject, int, String, String, String). This will first check to see if a bundle with the given type/name exists - if it doesn't, it will be created. If it does, it will be reused. This will then create the bundle version that will be associated with the bundle that was created or found.

Parameters:
subject - user that must have proper permissions
bundleName - name of the bundle to use (if not found, it will be created)
bundleDescription - optional long description of the bundle
bundleTypeId - the bundle type for the new bundle (if it is created) for which this will be the first version
bundleVersionName - name of the bundle version
bundleVersionDescription - optional long description of the bundle version
version - optional. If not supplied set to 1.0 for first version, or incremented (as best as possible) for subsequent version
Returns:
the persisted BundleVersion (id is assigned)
Throws:
Exception

createBundleVersion

org.rhq.core.domain.bundle.BundleVersion createBundleVersion(org.rhq.core.domain.auth.Subject subject,
                                                             int bundleId,
                                                             String name,
                                                             String description,
                                                             String version,
                                                             String recipe)
                                                             throws Exception
Mainly Used For Testing

Parameters:
subject - user that must have proper permissions
bundleId - the bundle for which this will be the next version
name - not null or empty
description - optional long description of the bundle version
version - optional. If not supplied set to 1.0 for first version, or incremented (as best as possible) for subsequent version
Returns:
the persisted BundleVersion (id is assigned)
Throws:
Exception

createBundleType

org.rhq.core.domain.bundle.BundleType createBundleType(org.rhq.core.domain.auth.Subject subject,
                                                       String name,
                                                       int resourceTypeId)
                                                       throws Exception
Not generally called. For use by Server Side Plugins when registering a Bundle Plugin.

Parameters:
subject - must be InventoryManager
name - not null or empty
resourceTypeId - id of the ResourceType that handles this BundleType
Returns:
the persisted BundleType (id is assigned)
Throws:
Exception

createBundleResourceDeployment

org.rhq.core.domain.bundle.BundleResourceDeployment createBundleResourceDeployment(org.rhq.core.domain.auth.Subject subject,
                                                                                   int bundleDeploymentId,
                                                                                   int resourceId)
                                                                                   throws Exception
This is typically not called directly, typically scheduleBundleResourceDeployment() is called externally. This executes in a New Transaction and supports scheduleBundleResourceDeployment.

Throws:
Exception

createBundleDeploymentInNewTrans

org.rhq.core.domain.bundle.BundleDeployment createBundleDeploymentInNewTrans(org.rhq.core.domain.auth.Subject subject,
                                                                             int bundleVersionId,
                                                                             int bundleDestinationId,
                                                                             String name,
                                                                             String description,
                                                                             org.rhq.core.domain.configuration.Configuration configuration)
                                                                             throws Exception
Similar to BundleManagerRemote.createBundleDeployment(Subject, int, int, String, Configuration) but supplies the internally generated deploymentName and has different transaction semantics. Useful when an slsb method needs to both create a deployment and schedules it prior to returning to an external caller.

Throws:
Exception

getAllBundleVersionFilenames

HashMap<String,Boolean> getAllBundleVersionFilenames(org.rhq.core.domain.auth.Subject subject,
                                                     int bundleVersionId)
                                                     throws Exception
Throws:
Exception

getBundleDeploymentName

String getBundleDeploymentName(org.rhq.core.domain.auth.Subject subject,
                               int bundleDestinationId,
                               int bundleVersionId,
                               int prevDeploymentId)
Needed by the Bundle Deploy and Revert wizards GUI to generate a deployment name for display.

Parameters:
subject -
bundleDestinationId - required
bundleVersionId - required for progressive deployment, -1 for revert
prevDeploymentId - required for revert deployment, -1 for progressive
Returns:

getScheduleRequest

BundleScheduleRequest getScheduleRequest(org.rhq.core.domain.auth.Subject subject,
                                         int resourceDeploymentId,
                                         boolean isCleanDeployment,
                                         boolean isRevert)
                                         throws Exception
Not for general consumption. A special case method to build the pojo that can be sent to the agent to schedule the deployment request. Uses NOT_SUPPORTED transaction attribute to avoid having the cleaned pojo affect the persistence context.

Throws:
Exception

deleteBundleDeployment

void deleteBundleDeployment(org.rhq.core.domain.auth.Subject subject,
                            int bundleDeploymentId)
                            throws Exception
This is a simple attempt at delete, typically used for removing a poorly defined deployment before it is actually scheduled for deployment. The status must be PENDING. It will fail if anything actually refers to it.

Parameters:
subject -
bundleDeploymentId -
Throws:
Exception - if any part of the removal fails.

deleteBundleDestination

void deleteBundleDestination(org.rhq.core.domain.auth.Subject subject,
                             int bundleDestinationId)
                             throws Exception
This is a simple attempt at delete, typically used for removing a poorly defined destination. It will fail if any actual deployments are referring to the destination.

Parameters:
subject -
bundleDestinationId -
Throws:
Exception - if any part of the removal fails.

setBundleResourceDeploymentStatus

org.rhq.core.domain.bundle.BundleResourceDeployment setBundleResourceDeploymentStatus(org.rhq.core.domain.auth.Subject subject,
                                                                                      int resourceDeploymentId,
                                                                                      org.rhq.core.domain.bundle.BundleDeploymentStatus status)
                                                                                      throws Exception
Called internally to set deployment status. Typically to a completion status when deployment ends.

Parameters:
subject -
resourceDeploymentId - id of the resource deployment appending the history record
status -
Returns:
the updated BundleResourceDeployment
Throws:
Exception

_finalizePurge

void _finalizePurge(org.rhq.core.domain.auth.Subject subject,
                    org.rhq.core.domain.bundle.BundleDeployment bundleDeployment,
                    Map<org.rhq.core.domain.bundle.BundleResourceDeployment,String> failedToPurge)
                    throws Exception
This is for internal use only - when BundleManagerRemote.purgeBundleDestination(Subject, int) is done, it calls this so the purge can be finalized. This is required because this method is called with a transactional context, as opposed to the main purge method.

Parameters:
subject -
bundleDeployment -
failedToPurge -
Throws:
Exception

findBundlesByCriteriaWithDestinationFilter

org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.Bundle> findBundlesByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject,
                                                                                                                org.rhq.core.domain.criteria.BundleCriteria criteria)
Fetch bundles by criteria and then on the result objects

Parameters:
subject - Caller
criteria - criteria to fetch the bundles
Returns:
List of bundles with destinations filtered.

findBundleVersionsByCriteriaWithDestinationFilter

org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.BundleVersion> findBundleVersionsByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject,
                                                                                                                              org.rhq.core.domain.criteria.BundleVersionCriteria criteria)
Fetch bundle versions by criteria and then filter destination on the result objects to limit what the user can see

Parameters:
subject - Caller
criteria - criteria to fetch the bundles
Returns:
List of bundles with destinations filtered.

findBundleDeploymentsByCriteriaWithDestinationFilter

org.rhq.core.domain.util.PageList<org.rhq.core.domain.bundle.BundleDeployment> findBundleDeploymentsByCriteriaWithDestinationFilter(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                    org.rhq.core.domain.criteria.BundleDeploymentCriteria criteria)
Fetch bundle deployments by criteria and then filter on destinations on the result objects to limit what the user can see

Parameters:
subject - Caller
criteria - criteria to fetch the deployments
Returns:
List of deployments with destinations filtered.


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