org.rhq.enterprise.server.bundle
Class BundleManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.bundle.BundleManagerBean
All Implemented Interfaces:
BundleManagerLocal, BundleManagerRemote

public class BundleManagerBean
extends Object
implements BundleManagerLocal, BundleManagerRemote

Manages the creation and usage of bundles.

Author:
John Mazzitelli, Ian Springer, Jay Shaughnessy

Constructor Summary
BundleManagerBean()
           
 
Method Summary
 void _finalizePurge(Subject subject, BundleDeployment bundleDeployment, Map<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.
 BundleFile addBundleFile(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, InputStream fileStream)
          Adds a BundleFile to the BundleVersion and implicitly creates the backing PackageVersion.
 BundleFile addBundleFileViaByteArray(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, byte[] fileBytes)
          A convenience method taking a byte array as opposed to a stream for the file bits.
 BundleFile addBundleFileViaPackageVersion(Subject subject, int bundleVersionId, String name, int packageVersionId)
          A convenience method taking an existing PackageVersion as opposed to a stream for the file bits.
 BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, String bundleFileUrl)
          A convenience method taking a URL String whose content will be streamed to the server and used for the file bits.
 BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(Subject subject, int bundleDeploymentId, BundleResourceDeploymentHistory history)
          Called internally to add history when action is taken against a deployment.
 Bundle createBundle(Subject subject, String name, String description, int bundleTypeId)
          Mainly Used For Testing
 BundleVersion createBundleAndBundleVersion(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).
 BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, String description, Configuration configuration)
          Create a new bundle deployment.
 BundleDeployment createBundleDeploymentInNewTrans(Subject subject, int bundleVersionId, int bundleDestinationId, String name, String description, Configuration configuration)
          Similar to BundleManagerRemote.createBundleDeployment(Subject, int, int, String, Configuration) but supplies the internally generated deploymentName and has different transaction semantics.
 BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, String deployDir, Integer groupId)
           
 BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId)
          This is typically not called directly, typically scheduleBundleResourceDeployment() is called externally.
 BundleType createBundleType(Subject subject, String name, int resourceTypeId)
          Not generally called.
 BundleVersion createBundleVersion(Subject subject, int bundleId, String name, String description, String version, String recipe)
          Mainly Used For Testing
 BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile)
          Creates a bundle version based on a Bundle Distribution file.
 BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe)
          Creates a bundle version based on single recipe string.
 BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl)
          Creates a bundle version based on a Bundle Distribution file.
 void deleteBundle(Subject subject, int bundleId)
          Remove everything associated with the Bundle with the exception of files laid down by related deployments.
 void deleteBundleDeployment(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(Subject subject, int destinationId)
          This is a simple attempt at delete, typically used for removing a poorly defined destination.
 void deleteBundles(Subject subject, int[] bundleIds)
          Remove everything associated with the Bundles with the exception of files laid down by related deployments.
 void deleteBundleVersion(Subject subject, int bundleVersionId, boolean deleteBundleIfEmpty)
          Remove everything associated with the BundleVersion with the exception of files laid down by related deployments.
 PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject, BundleDeploymentCriteria criteria)
           
 PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, BundleDestinationCriteria criteria)
           
 PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria)
           
 PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, BundleResourceDeploymentCriteria criteria)
           
 PageList<Bundle> findBundlesByCriteria(Subject subject, BundleCriteria criteria)
           
 PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject, BundleCriteria criteria)
           
 PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject, BundleVersionCriteria criteria)
           
 List<BundleType> getAllBundleTypes(Subject subject)
           
 HashMap<String,Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId)
           
 String getBundleDeploymentName(Subject subject, int bundleDestinationId, int bundleVersionId, int prevDeploymentId)
          Needed by the Bundle Deploy and Revert wizards GUI to generate a deployment name for display.
 BundleType getBundleType(Subject subject, String bundleTypeName)
           
 Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly)
          Determine the files required for a BundleVersion and return all of the filenames or optionally, just those that lack BundleFiles for the BundleVersion.
 BundleScheduleRequest getScheduleRequest(Subject subject, int resourceDeploymentId, boolean isCleanDeployment, boolean isRevert)
          Not for general consumption.
 void purgeBundleDestination(Subject subject, int bundleDestinationId)
          Purges the destination's live deployment content from the remote platforms.
 BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment)
          Deploy the bundle to the destination, as described in the provided deployment.
 BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, String deploymentDescription, boolean isCleanDeployment)
          For the specified destination, revert from the current live deployment to the deployment it had replaced.
 BundleResourceDeployment setBundleResourceDeploymentStatus(Subject subject, int resourceDeploymentId, BundleDeploymentStatus status)
          Called internally to set deployment status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleManagerBean

public BundleManagerBean()
Method Detail

addBundleResourceDeploymentHistory

public BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(Subject subject,
                                                                          int bundleDeploymentId,
                                                                          BundleResourceDeploymentHistory history)
                                                                   throws Exception
Description copied from interface: BundleManagerLocal
Called internally to add history when action is taken against a deployment. This executes in a New Transaction and supports deployBundle and Agent requests.

Specified by:
addBundleResourceDeploymentHistory in interface BundleManagerLocal
bundleDeploymentId - id of the deployment appending the history record
Returns:
the persisted history
Throws:
Exception

createBundle

public Bundle createBundle(Subject subject,
                           String name,
                           String description,
                           int bundleTypeId)
                    throws Exception
Description copied from interface: BundleManagerLocal
Mainly Used For Testing

Specified by:
createBundle in interface BundleManagerLocal
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

createBundleDeploymentInNewTrans

public BundleDeployment createBundleDeploymentInNewTrans(Subject subject,
                                                         int bundleVersionId,
                                                         int bundleDestinationId,
                                                         String name,
                                                         String description,
                                                         Configuration configuration)
                                                  throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
createBundleDeploymentInNewTrans in interface BundleManagerLocal
Throws:
Exception

createBundleDeployment

public BundleDeployment createBundleDeployment(Subject subject,
                                               int bundleVersionId,
                                               int bundleDestinationId,
                                               String description,
                                               Configuration configuration)
                                        throws Exception
Description copied from interface: BundleManagerRemote
Create a new bundle deployment. Note that bundle deployment names are generated by this call. This provides useful, uniform naming for display. An optional, custom description can be added. This call defines a deployment. The defined deployment can then be scheduled in a separate call.

Specified by:
createBundleDeployment in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
description - an optional longer description describing this deployment
configuration - a Configuration (pojo) to be associated with this deployment. Although it is not enforceable must be that of the associated BundleVersion.
Returns:
the persisted deployment
Throws:
Exception

createBundleDestination

public BundleDestination createBundleDestination(Subject subject,
                                                 int bundleId,
                                                 String name,
                                                 String description,
                                                 String deployDir,
                                                 Integer groupId)
                                          throws Exception
Specified by:
createBundleDestination in interface BundleManagerRemote
Parameters:
subject - user must have MANAGE_INVENTORY permission
name - a name for this destination. not null or empty
description - an optional longer description describing this destination
deployDir - the root dir for deployments to this destination
Returns:
the persisted destination
Throws:
Exception

getBundleDeploymentName

public String getBundleDeploymentName(Subject subject,
                                      int bundleDestinationId,
                                      int bundleVersionId,
                                      int prevDeploymentId)
Description copied from interface: BundleManagerLocal
Needed by the Bundle Deploy and Revert wizards GUI to generate a deployment name for display.

Specified by:
getBundleDeploymentName in interface BundleManagerLocal
bundleDestinationId - required
bundleVersionId - required for progressive deployment, -1 for revert
prevDeploymentId - required for revert deployment, -1 for progressive
Returns:

createBundleType

public BundleType createBundleType(Subject subject,
                                   String name,
                                   int resourceTypeId)
                            throws Exception
Description copied from interface: BundleManagerLocal
Not generally called. For use by Server Side Plugins when registering a Bundle Plugin.

Specified by:
createBundleType in interface BundleManagerLocal
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

createBundleAndBundleVersion

public BundleVersion createBundleAndBundleVersion(Subject subject,
                                                  String bundleName,
                                                  String bundleDescription,
                                                  int bundleTypeId,
                                                  String bundleVersionName,
                                                  String bundleVersionDescription,
                                                  String version,
                                                  String recipe)
                                           throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
createBundleAndBundleVersion in interface BundleManagerLocal
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

public BundleVersion createBundleVersion(Subject subject,
                                         int bundleId,
                                         String name,
                                         String description,
                                         String version,
                                         String recipe)
                                  throws Exception
Description copied from interface: BundleManagerLocal
Mainly Used For Testing

Specified by:
createBundleVersion in interface BundleManagerLocal
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

createBundleVersionViaRecipe

public BundleVersion createBundleVersionViaRecipe(Subject subject,
                                                  String recipe)
                                           throws Exception
Description copied from interface: BundleManagerRemote
Creates a bundle version based on single recipe string. The recipe specifies the bundle name, version, version name and version description. If this is the initial version for the named bundle the bundle will be implicitly created. The bundle type is discovered by the bundle server plugin that can parse the recipe.

Specified by:
createBundleVersionViaRecipe in interface BundleManagerRemote
recipe - the recipe that defines the bundle version to be created
Returns:
the persisted BundleVersion with alot of the internal relationships filled in to help the caller understand all that this method did.
Throws:
Exception

createBundleVersionViaFile

public BundleVersion createBundleVersionViaFile(Subject subject,
                                                File distributionFile)
                                         throws Exception
Description copied from interface: BundleManagerRemote
Creates a bundle version based on a Bundle Distribution file. Typically a zip file, the bundle distribution contains the recipe for a supported bundle type, along with 0, 1 or more bundle files that will be associated with the bundle version. The recipe specifies the bundle name, version, version name and version description. If this is the initial version for the named bundle the bundle will be implicitly created. The bundle type is discovered by inspecting the distribution file.

Specified by:
createBundleVersionViaFile in interface BundleManagerRemote
distributionFile - a local Bundle Distribution file. It must be read accessible by the RHQ server process.
Returns:
the persisted BundleVersion with alot of the internal relationships filled in to help the caller understand all that this method did. Bundle files specifically are returned.
Throws:
Exception

createBundleVersionViaURL

public BundleVersion createBundleVersionViaURL(Subject subject,
                                               String distributionFileUrl)
                                        throws Exception
Description copied from interface: BundleManagerRemote
Creates a bundle version based on a Bundle Distribution file. Typically a zip file, the bundle distribution contains the recipe for a supported bundle type, along with 0, 1 or more bundle files that will be associated with the bundle version. The recipe specifies the bundle name, version, version name and version description. If this is the initial version for the named bundle the bundle will be implicitly created. The bundle type is discovered by inspecting the distribution file.

Note, if the file is local it is more efficient to use BundleManagerRemote.createBundleVersionViaFile(Subject,File).

Specified by:
createBundleVersionViaURL in interface BundleManagerRemote
distributionFileUrl - a URL String to the Bundle Distribution file. It must be live, resolvable and read accessible by the RHQ server process.
Returns:
the persisted BundleVersion with alot of the internal relationships filled in to help the caller understand all that this method did. Bundle files specifically are returned.
Throws:
Exception

addBundleFile

public BundleFile addBundleFile(Subject subject,
                                int bundleVersionId,
                                String name,
                                String version,
                                Architecture architecture,
                                InputStream fileStream)
                         throws Exception
Description copied from interface: BundleManagerRemote
Adds a BundleFile to the BundleVersion and implicitly creates the backing PackageVersion. If the PackageVersion already exists use addBundleFile(Subject, int, String, int, boolean)

Specified by:
addBundleFile in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
bundleVersionId - id of the BundleVersion incorporating this BundleFile
name - name of the BundleFile (and the resulting Package)
version - version of the backing package
architecture - architecture appropriate for the backing package. Defaults to noarch (i.e. any architecture).
fileStream - the file bits
Returns:
the new BundleFile
Throws:
Exception

addBundleFileViaByteArray

public BundleFile addBundleFileViaByteArray(Subject subject,
                                            int bundleVersionId,
                                            String name,
                                            String version,
                                            Architecture architecture,
                                            byte[] fileBytes)
                                     throws Exception
Description copied from interface: BundleManagerRemote
A convenience method taking a byte array as opposed to a stream for the file bits.

Specified by:
addBundleFileViaByteArray in interface BundleManagerRemote
Throws:
Exception
See Also:
addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}

addBundleFileViaURL

public BundleFile addBundleFileViaURL(Subject subject,
                                      int bundleVersionId,
                                      String name,
                                      String version,
                                      Architecture architecture,
                                      String bundleFileUrl)
                               throws Exception
Description copied from interface: BundleManagerRemote
A convenience method taking a URL String whose content will be streamed to the server and used for the file bits.

Specified by:
addBundleFileViaURL in interface BundleManagerRemote
Throws:
Exception
See Also:
addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}

addBundleFileViaPackageVersion

public BundleFile addBundleFileViaPackageVersion(Subject subject,
                                                 int bundleVersionId,
                                                 String name,
                                                 int packageVersionId)
                                          throws Exception
Description copied from interface: BundleManagerRemote
A convenience method taking an existing PackageVersion as opposed to a stream for the file bits.

Specified by:
addBundleFileViaPackageVersion in interface BundleManagerRemote
Throws:
Exception
See Also:
addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}

purgeBundleDestination

public void purgeBundleDestination(Subject subject,
                                   int bundleDestinationId)
                            throws Exception
Description copied from interface: BundleManagerRemote
Purges the destination's live deployment content from the remote platforms.

Specified by:
purgeBundleDestination in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
bundleDestinationId - the ID of the destination that is to be purged of bundle content
Throws:
Exception

_finalizePurge

public void _finalizePurge(Subject subject,
                           BundleDeployment bundleDeployment,
                           Map<BundleResourceDeployment,String> failedToPurge)
                    throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
_finalizePurge in interface BundleManagerLocal
Throws:
Exception

scheduleBundleDeployment

public BundleDeployment scheduleBundleDeployment(Subject subject,
                                                 int bundleDeploymentId,
                                                 boolean isCleanDeployment)
                                          throws Exception
Description copied from interface: BundleManagerRemote
Deploy the bundle to the destination, as described in the provided deployment. Deployment is asynchronous so return of this method does not indicate individual resource deployments are complete. The returned BundleDeployment can be used to track the history of the individual deployments.

TODO: Add the scheduling capability, currently it's Immediate.

Specified by:
scheduleBundleDeployment in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
bundleDeploymentId - the BundleDeployment being used to guide the deployments
isCleanDeployment - if true perform a wipe of the deploy directory prior to the deployment. If false perform as an upgrade to the existing deployment, if any.
Returns:
the BundleDeployment record, updated with status and (resource) deployments.
Throws:
Exception

scheduleRevertBundleDeployment

public BundleDeployment scheduleRevertBundleDeployment(Subject subject,
                                                       int bundleDestinationId,
                                                       String deploymentDescription,
                                                       boolean isCleanDeployment)
                                                throws Exception
Description copied from interface: BundleManagerRemote
For the specified destination, revert from the current live deployment to the deployment it had replaced. A revert first rolls back to the previous deployment (bundle version and configuration) and then rolls forward by replacing changed files that had been backed up during the most recent (live) deployment. The returned BundleDeployment represents the new live deployment and can be used to track the history of the individual revert deployments. Note that bundle deployment names are generated by this call. This provides useful, uniform naming for display. An optional, custom description can be added.

TODO: Add the scheduling capability, currently it's Immediate.

Specified by:
scheduleRevertBundleDeployment in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
deploymentDescription - an optional longer description describing this deployment. If null defaults to the description of the previous deployment.
isCleanDeployment - if true perform a wipe of the deploy directory prior to the revert deployment. Backed up files will still be applied. If false perform as an upgrade to the existing deployment.
Returns:
the BundleDeployment record, updated with status and (resource) deployments.
Throws:
Exception

getScheduleRequest

public BundleScheduleRequest getScheduleRequest(Subject subject,
                                                int resourceDeploymentId,
                                                boolean isCleanDeployment,
                                                boolean isRevert)
                                         throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
getScheduleRequest in interface BundleManagerLocal
Throws:
Exception

createBundleResourceDeployment

public BundleResourceDeployment createBundleResourceDeployment(Subject subject,
                                                               int bundleDeploymentId,
                                                               int resourceId)
                                                        throws Exception
Description copied from interface: BundleManagerLocal
This is typically not called directly, typically scheduleBundleResourceDeployment() is called externally. This executes in a New Transaction and supports scheduleBundleResourceDeployment.

Specified by:
createBundleResourceDeployment in interface BundleManagerLocal
Throws:
Exception

setBundleResourceDeploymentStatus

public BundleResourceDeployment setBundleResourceDeploymentStatus(Subject subject,
                                                                  int resourceDeploymentId,
                                                                  BundleDeploymentStatus status)
                                                           throws Exception
Description copied from interface: BundleManagerLocal
Called internally to set deployment status. Typically to a completion status when deployment ends.

Specified by:
setBundleResourceDeploymentStatus in interface BundleManagerLocal
resourceDeploymentId - id of the resource deployment appending the history record
Returns:
the updated BundleResourceDeployment
Throws:
Exception

getBundleVersionFilenames

public Set<String> getBundleVersionFilenames(Subject subject,
                                             int bundleVersionId,
                                             boolean withoutBundleFileOnly)
                                      throws Exception
Description copied from interface: BundleManagerRemote
Determine the files required for a BundleVersion and return all of the filenames or optionally, just those that lack BundleFiles for the BundleVersion. The recipe may be parsed as part of this call.

Specified by:
getBundleVersionFilenames in interface BundleManagerRemote
Parameters:
subject - user that must have proper permissions
bundleVersionId - the BundleVersion being queried
withoutBundleFileOnly - if true omit any filenames that already have a corresponding BundleFile for the BundleVersion.
Returns:
The List of filenames.
Throws:
Exception

getAllBundleVersionFilenames

public HashMap<String,Boolean> getAllBundleVersionFilenames(Subject subject,
                                                            int bundleVersionId)
                                                     throws Exception
Specified by:
getAllBundleVersionFilenames in interface BundleManagerLocal
Throws:
Exception

getAllBundleTypes

public List<BundleType> getAllBundleTypes(Subject subject)
Specified by:
getAllBundleTypes in interface BundleManagerRemote

getBundleType

public BundleType getBundleType(Subject subject,
                                String bundleTypeName)
Specified by:
getBundleType in interface BundleManagerRemote

findBundleDeploymentsByCriteria

public PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject,
                                                                  BundleDeploymentCriteria criteria)
Specified by:
findBundleDeploymentsByCriteria in interface BundleManagerRemote

findBundleDestinationsByCriteria

public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject,
                                                                    BundleDestinationCriteria criteria)
Specified by:
findBundleDestinationsByCriteria in interface BundleManagerRemote

findBundleResourceDeploymentsByCriteria

public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject,
                                                                                  BundleResourceDeploymentCriteria criteria)
Specified by:
findBundleResourceDeploymentsByCriteria in interface BundleManagerRemote

findBundleVersionsByCriteria

public PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject,
                                                            BundleVersionCriteria criteria)
Specified by:
findBundleVersionsByCriteria in interface BundleManagerRemote

findBundleFilesByCriteria

public PageList<BundleFile> findBundleFilesByCriteria(Subject subject,
                                                      BundleFileCriteria criteria)
Specified by:
findBundleFilesByCriteria in interface BundleManagerRemote

findBundlesByCriteria

public PageList<Bundle> findBundlesByCriteria(Subject subject,
                                              BundleCriteria criteria)
Specified by:
findBundlesByCriteria in interface BundleManagerRemote

findBundlesWithLatestVersionCompositesByCriteria

public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject,
                                                                                                   BundleCriteria criteria)
Specified by:
findBundlesWithLatestVersionCompositesByCriteria in interface BundleManagerRemote

deleteBundles

public void deleteBundles(Subject subject,
                          int[] bundleIds)
                   throws Exception
Description copied from interface: BundleManagerRemote
Remove everything associated with the Bundles with the exception of files laid down by related deployments. Deployed files are left as is on the deployment platforms but the bundle mechanism will no longer track the deployment of all bundles that have been deleted.

Specified by:
deleteBundles in interface BundleManagerRemote
bundleIds - IDs of all bundles to be deleted
Throws:
Exception - if any part of the removal fails.

deleteBundle

public void deleteBundle(Subject subject,
                         int bundleId)
                  throws Exception
Description copied from interface: BundleManagerRemote
Remove everything associated with the Bundle with the exception of files laid down by related deployments. Deployed files are left as is on the deployment platforms but the bundle mechanism will no longer track the deployment.

Specified by:
deleteBundle in interface BundleManagerRemote
Throws:
Exception - if any part of the removal fails.

deleteBundleDeployment

public void deleteBundleDeployment(Subject subject,
                                   int bundleDeploymentId)
                            throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
deleteBundleDeployment in interface BundleManagerLocal
Throws:
Exception - if any part of the removal fails.

deleteBundleDestination

public void deleteBundleDestination(Subject subject,
                                    int destinationId)
                             throws Exception
Description copied from interface: BundleManagerLocal
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.

Specified by:
deleteBundleDestination in interface BundleManagerLocal
Throws:
Exception - if any part of the removal fails.

deleteBundleVersion

public void deleteBundleVersion(Subject subject,
                                int bundleVersionId,
                                boolean deleteBundleIfEmpty)
                         throws Exception
Description copied from interface: BundleManagerRemote
Remove everything associated with the BundleVersion with the exception of files laid down by related deployments. Deployed files are left as is on the deployment platforms but the bundle mechanism will no longer track the deployment.

Specified by:
deleteBundleVersion in interface BundleManagerRemote
deleteBundleIfEmpty - if true and if this method deletes the last bundle version for its bundle, then that bundle entity itself will be completely purged
Throws:
Exception - if any part of the removal fails.


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