org.rhq.enterprise.server.content
Interface ContentManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface ContentManagerRemote

Author:
Jay Shaughnessy

Method Summary
 PackageVersion createPackageVersion(Subject subject, String packageName, int packageTypeId, String version, Integer architectureId, byte[] packageBytes)
          Creates a new package version in the system.
 void deletePackages(Subject subject, int resourceId, int[] installedPackageIds, String requestNotes)
          Deletes the specified package from the resource.
 void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds)
          Deploys packages on the specified resources.
 List<Architecture> findArchitectures(Subject subject)
          Returns all architectures known to the system.
 PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria)
           
 List<PackageType> findPackageTypes(Subject subject, String resourceTypeName, String pluginName)
          This gets the package types that can be deployed to the given resource.
 PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject, PackageVersionCriteria criteria)
          If a resourceId filter is not set via PackageVersionCriteria.addFilterResourceId() then this method requires InventoryManager permissions.
 InstalledPackage getBackingPackageForResource(Subject subject, int resourceId)
          For a resource that is content-backed (aka package-backed), this call will return InstalledPackage information for the backing content (package).
 byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId)
           
 

Method Detail

createPackageVersion

PackageVersion createPackageVersion(Subject subject,
                                    String packageName,
                                    int packageTypeId,
                                    String version,
                                    Integer architectureId,
                                    byte[] packageBytes)
Creates a new package version in the system. If the parent package (identified by the packageName parameter) does not exist, it will be created. If a package version exists with the specified version ID, a new one will not be created and the existing package version instance will be returned.

Parameters:
subject - The logged in subject
packageName - parent package name; uniquely identifies the package under which this version goes
packageTypeId - identifies the type of package in case the general package needs to be created
version - identifies the version to be create
architectureId - architecture of the newly created package version. If null then no architecture restriction.
Returns:
newly created package version if one did not exist; existing package version that matches these data if one was found

deletePackages

void deletePackages(Subject subject,
                    int resourceId,
                    int[] installedPackageIds,
                    String requestNotes)
Deletes the specified package from the resource.

Parameters:
subject - The logged in subject
resourceId - identifies the resource from which the packages should be deleted
installedPackageIds - identifies all of the packages to be deleted

deployPackages

void deployPackages(Subject subject,
                    int[] resourceIds,
                    int[] packageVersionIds)
Deploys packages on the specified resources. Each installed package entry should be populated with the PackageVersion being installed, along with the deployment configuration values if any. This method will take care of populating the rest of the values in each installed package object.

Parameters:
subject - The logged in subject
resourceIds - identifies the resources against which the package will be deployed
packageVersionIds - packageVersions we want to install

findArchitectures

List<Architecture> findArchitectures(Subject subject)
Returns all architectures known to the system.

Parameters:
subject - The logged in subject
Returns:
list of all architectures in the database

findPackageTypes

List<PackageType> findPackageTypes(Subject subject,
                                   String resourceTypeName,
                                   String pluginName)
                                   throws org.rhq.enterprise.server.resource.ResourceTypeNotFoundException
This gets the package types that can be deployed to the given resource. It is a function of the resource type of the resource.

Parameters:
subject - The logged in subject
resourceTypeName - The resource type in question
Returns:
The requested list of package types. Can be empty.
Throws:
org.rhq.enterprise.server.resource.ResourceTypeNotFoundException

findInstalledPackagesByCriteria

PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject,
                                                           InstalledPackageCriteria criteria)
Parameters:
subject -
criteria - InstalledPackageCriteria
Returns:
InstalledPackages for the criteria

findPackageVersionsByCriteria

PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject,
                                                       PackageVersionCriteria criteria)
If a resourceId filter is not set via PackageVersionCriteria.addFilterResourceId() then this method requires InventoryManager permissions. When set the user must have permission to view the resource.

Parameters:
subject -
criteria -
Returns:
Installed PackageVersions for the resource
Throws:
IllegalArgumentException - for invalid resourceId filter

getBackingPackageForResource

InstalledPackage getBackingPackageForResource(Subject subject,
                                              int resourceId)
For a resource that is content-backed (aka package-backed), this call will return InstalledPackage information for the backing content (package).

Parameters:
resourceId - a valid resource
Returns:
The InstalledPackage object for the content-packed resource. Or null for non-existent or non-package backed resource.

getPackageBytes

byte[] getPackageBytes(Subject user,
                       int resourceId,
                       int installedPackageId)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.