|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.bundle.BundleManagerBean
public class BundleManagerBean
Manages the creation and usage of bundles.
| 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 |
|---|
public BundleManagerBean()
| Method Detail |
|---|
public BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(Subject subject,
int bundleDeploymentId,
BundleResourceDeploymentHistory history)
throws Exception
BundleManagerLocal
addBundleResourceDeploymentHistory in interface BundleManagerLocalbundleDeploymentId - id of the deployment appending the history record
Exception
public Bundle createBundle(Subject subject,
String name,
String description,
int bundleTypeId)
throws Exception
BundleManagerLocal
createBundle in interface BundleManagerLocalsubject - user that must have proper permissionsname - not null or emptydescription - optional long description of the bundlebundleTypeId - valid bundleType
Exception
public BundleDeployment createBundleDeploymentInNewTrans(Subject subject,
int bundleVersionId,
int bundleDestinationId,
String name,
String description,
Configuration configuration)
throws Exception
BundleManagerLocalBundleManagerRemote.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.
createBundleDeploymentInNewTrans in interface BundleManagerLocalException
public BundleDeployment createBundleDeployment(Subject subject,
int bundleVersionId,
int bundleDestinationId,
String description,
Configuration configuration)
throws Exception
BundleManagerRemote
createBundleDeployment in interface BundleManagerRemotesubject - user that must have proper permissionsdescription - an optional longer description describing this deploymentconfiguration - a Configuration (pojo) to be associated with this deployment. Although
it is not enforceable must be that of the associated BundleVersion.
Exception
public BundleDestination createBundleDestination(Subject subject,
int bundleId,
String name,
String description,
String deployDir,
Integer groupId)
throws Exception
createBundleDestination in interface BundleManagerRemotesubject - user must have MANAGE_INVENTORY permissionname - a name for this destination. not null or emptydescription - an optional longer description describing this destinationdeployDir - the root dir for deployments to this destination
Exception
public String getBundleDeploymentName(Subject subject,
int bundleDestinationId,
int bundleVersionId,
int prevDeploymentId)
BundleManagerLocal
getBundleDeploymentName in interface BundleManagerLocalbundleDestinationId - requiredbundleVersionId - required for progressive deployment, -1 for revertprevDeploymentId - required for revert deployment, -1 for progressive
public BundleType createBundleType(Subject subject,
String name,
int resourceTypeId)
throws Exception
BundleManagerLocal
createBundleType in interface BundleManagerLocalsubject - must be InventoryManagername - not null or emptyresourceTypeId - id of the ResourceType that handles this BundleType
Exception
public BundleVersion createBundleAndBundleVersion(Subject subject,
String bundleName,
String bundleDescription,
int bundleTypeId,
String bundleVersionName,
String bundleVersionDescription,
String version,
String recipe)
throws Exception
BundleManagerLocal#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.
createBundleAndBundleVersion in interface BundleManagerLocalsubject - user that must have proper permissionsbundleName - name of the bundle to use (if not found, it will be created)bundleDescription - optional long description of the bundlebundleTypeId - the bundle type for the new bundle (if it is created) for which this will be the first versionbundleVersionName - name of the bundle versionbundleVersionDescription - optional long description of the bundle versionversion - optional. If not supplied set to 1.0 for first version, or incremented (as best as possible) for subsequent version
Exception
public BundleVersion createBundleVersion(Subject subject,
int bundleId,
String name,
String description,
String version,
String recipe)
throws Exception
BundleManagerLocal
createBundleVersion in interface BundleManagerLocalsubject - user that must have proper permissionsbundleId - the bundle for which this will be the next versionname - not null or emptydescription - optional long description of the bundle versionversion - optional. If not supplied set to 1.0 for first version, or incremented (as best as possible) for subsequent version
Exception
public BundleVersion createBundleVersionViaRecipe(Subject subject,
String recipe)
throws Exception
BundleManagerRemote
createBundleVersionViaRecipe in interface BundleManagerRemoterecipe - the recipe that defines the bundle version to be created
Exception
public BundleVersion createBundleVersionViaFile(Subject subject,
File distributionFile)
throws Exception
BundleManagerRemote
createBundleVersionViaFile in interface BundleManagerRemotedistributionFile - a local Bundle Distribution file. It must be read accessible by the RHQ server process.
Exception
public BundleVersion createBundleVersionViaURL(Subject subject,
String distributionFileUrl)
throws Exception
BundleManagerRemoteBundleManagerRemote.createBundleVersionViaFile(Subject,File).
createBundleVersionViaURL in interface BundleManagerRemotedistributionFileUrl - a URL String to the Bundle Distribution file. It must be live, resolvable and read accessible
by the RHQ server process.
Exception
public BundleFile addBundleFile(Subject subject,
int bundleVersionId,
String name,
String version,
Architecture architecture,
InputStream fileStream)
throws Exception
BundleManagerRemoteaddBundleFile(Subject, int, String, int, boolean)
addBundleFile in interface BundleManagerRemotesubject - user that must have proper permissionsbundleVersionId - id of the BundleVersion incorporating this BundleFilename - name of the BundleFile (and the resulting Package)version - version of the backing packagearchitecture - architecture appropriate for the backing package. Defaults to noarch (i.e. any architecture).fileStream - the file bits
Exception
public BundleFile addBundleFileViaByteArray(Subject subject,
int bundleVersionId,
String name,
String version,
Architecture architecture,
byte[] fileBytes)
throws Exception
BundleManagerRemote
addBundleFileViaByteArray in interface BundleManagerRemoteExceptionaddBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}
public BundleFile addBundleFileViaURL(Subject subject,
int bundleVersionId,
String name,
String version,
Architecture architecture,
String bundleFileUrl)
throws Exception
BundleManagerRemote
addBundleFileViaURL in interface BundleManagerRemoteExceptionaddBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}
public BundleFile addBundleFileViaPackageVersion(Subject subject,
int bundleVersionId,
String name,
int packageVersionId)
throws Exception
BundleManagerRemote
addBundleFileViaPackageVersion in interface BundleManagerRemoteExceptionaddBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)}
public void purgeBundleDestination(Subject subject,
int bundleDestinationId)
throws Exception
BundleManagerRemote
purgeBundleDestination in interface BundleManagerRemotesubject - user that must have proper permissionsbundleDestinationId - the ID of the destination that is to be purged of bundle content
Exception
public void _finalizePurge(Subject subject,
BundleDeployment bundleDeployment,
Map<BundleResourceDeployment,String> failedToPurge)
throws Exception
BundleManagerLocalBundleManagerRemote.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.
_finalizePurge in interface BundleManagerLocalException
public BundleDeployment scheduleBundleDeployment(Subject subject,
int bundleDeploymentId,
boolean isCleanDeployment)
throws Exception
BundleManagerRemote
scheduleBundleDeployment in interface BundleManagerRemotesubject - user that must have proper permissionsbundleDeploymentId - the BundleDeployment being used to guide the deploymentsisCleanDeployment - 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.
Exception
public BundleDeployment scheduleRevertBundleDeployment(Subject subject,
int bundleDestinationId,
String deploymentDescription,
boolean isCleanDeployment)
throws Exception
BundleManagerRemote
scheduleRevertBundleDeployment in interface BundleManagerRemotesubject - user that must have proper permissionsdeploymentDescription - 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.
Exception
public BundleScheduleRequest getScheduleRequest(Subject subject,
int resourceDeploymentId,
boolean isCleanDeployment,
boolean isRevert)
throws Exception
BundleManagerLocal
getScheduleRequest in interface BundleManagerLocalException
public BundleResourceDeployment createBundleResourceDeployment(Subject subject,
int bundleDeploymentId,
int resourceId)
throws Exception
BundleManagerLocal
createBundleResourceDeployment in interface BundleManagerLocalException
public BundleResourceDeployment setBundleResourceDeploymentStatus(Subject subject,
int resourceDeploymentId,
BundleDeploymentStatus status)
throws Exception
BundleManagerLocal
setBundleResourceDeploymentStatus in interface BundleManagerLocalresourceDeploymentId - id of the resource deployment appending the history record
BundleResourceDeployment
Exception
public Set<String> getBundleVersionFilenames(Subject subject,
int bundleVersionId,
boolean withoutBundleFileOnly)
throws Exception
BundleManagerRemote
getBundleVersionFilenames in interface BundleManagerRemotesubject - user that must have proper permissionsbundleVersionId - the BundleVersion being queriedwithoutBundleFileOnly - if true omit any filenames that already have a corresponding BundleFile for
the BundleVersion.
Exception
public HashMap<String,Boolean> getAllBundleVersionFilenames(Subject subject,
int bundleVersionId)
throws Exception
getAllBundleVersionFilenames in interface BundleManagerLocalExceptionpublic List<BundleType> getAllBundleTypes(Subject subject)
getAllBundleTypes in interface BundleManagerRemote
public BundleType getBundleType(Subject subject,
String bundleTypeName)
getBundleType in interface BundleManagerRemote
public PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject,
BundleDeploymentCriteria criteria)
findBundleDeploymentsByCriteria in interface BundleManagerRemote
public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject,
BundleDestinationCriteria criteria)
findBundleDestinationsByCriteria in interface BundleManagerRemote
public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject,
BundleResourceDeploymentCriteria criteria)
findBundleResourceDeploymentsByCriteria in interface BundleManagerRemote
public PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject,
BundleVersionCriteria criteria)
findBundleVersionsByCriteria in interface BundleManagerRemote
public PageList<BundleFile> findBundleFilesByCriteria(Subject subject,
BundleFileCriteria criteria)
findBundleFilesByCriteria in interface BundleManagerRemote
public PageList<Bundle> findBundlesByCriteria(Subject subject,
BundleCriteria criteria)
findBundlesByCriteria in interface BundleManagerRemote
public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject,
BundleCriteria criteria)
findBundlesWithLatestVersionCompositesByCriteria in interface BundleManagerRemote
public void deleteBundles(Subject subject,
int[] bundleIds)
throws Exception
BundleManagerRemote
deleteBundles in interface BundleManagerRemotebundleIds - IDs of all bundles to be deleted
Exception - if any part of the removal fails.
public void deleteBundle(Subject subject,
int bundleId)
throws Exception
BundleManagerRemote
deleteBundle in interface BundleManagerRemoteException - if any part of the removal fails.
public void deleteBundleDeployment(Subject subject,
int bundleDeploymentId)
throws Exception
BundleManagerLocal
deleteBundleDeployment in interface BundleManagerLocalException - if any part of the removal fails.
public void deleteBundleDestination(Subject subject,
int destinationId)
throws Exception
BundleManagerLocal
deleteBundleDestination in interface BundleManagerLocalException - if any part of the removal fails.
public void deleteBundleVersion(Subject subject,
int bundleVersionId,
boolean deleteBundleIfEmpty)
throws Exception
BundleManagerRemote
deleteBundleVersion in interface BundleManagerRemotedeleteBundleIfEmpty - if true and if this method deletes the last bundle version for its
bundle, then that bundle entity itself will be completely purged
Exception - if any part of the removal fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||