org.rhq.enterprise.server.content
Interface ContentManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface ContentManagerRemote


Method Summary
 PackageVersion createPackageVersion(Subject subject, String packageName, int packageTypeId, String version, Integer architectureId, byte[] packageBytes)
          Creates a new package version in the system.
 PackageVersion createPackageVersionWithDisplayVersion(Subject subject, String packageName, int packageTypeId, String version, String displayVersion, 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 deletePackageVersion(Subject subject, int resourceId)
          Deletes the specified PackageVersion from the system.
 void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds)
          Deprecated. 
 void deployPackagesWithNote(Subject subject, int[] resourceIds, int[] packageVersionIds, String requestNotes)
          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)
           
 PageList<Package> findPackagesByCriteria(Subject subject, PackageCriteria criteria)
          If the criteria object filters on repo id, the subject needs to be able to access that repo.
 PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(Subject subject, PackageCriteria criteria)
          Akin to findPackagesByCriteria(Subject, PackageCriteria) but also determines the latest version of the returned packages.
 PackageType findPackageType(Subject subject, Integer resourceTypeId, String packageTypeName)
          This re tries to find a package type of given name defined by the resource type provided.
 List<PackageType> findPackageTypes(Subject subject, String resourceTypeName, String pluginName)
          This gets the package types that can be deployed to the given resource.
 PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat(Subject subject, Integer resourceTypeId, String packageTypeName)
          Similar to findPackageType(Subject, Integer, String) but returns the package type along with the version format specification.
 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)
          This can be a dangerous call for large packages as the entire package will attempt to be loaded.
 

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

createPackageVersionWithDisplayVersion

PackageVersion createPackageVersionWithDisplayVersion(Subject subject,
                                                      String packageName,
                                                      int packageTypeId,
                                                      String version,
                                                      String displayVersion,
                                                      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

deletePackageVersion

void deletePackageVersion(Subject subject,
                          int resourceId)
Deletes the specified PackageVersion from the system. The PackageVersion must be an orphan to be deleted. If it is referenced by a content source, repo or installed package it must be removed via the higher level construct and this call will have no effect.

Parameters:
subject - The logged in subject
packageVersionId - The PackageVersion to delete.

deployPackages

@Deprecated
void deployPackages(Subject subject,
                               int[] resourceIds,
                               int[] packageVersionIds)
Deprecated. 

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

deployPackagesWithNote

void deployPackagesWithNote(Subject subject,
                            int[] resourceIds,
                            int[] packageVersionIds,
                            String requestNotes)
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
requestNotes - request notes

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

findPackageType

PackageType findPackageType(Subject subject,
                            Integer resourceTypeId,
                            String packageTypeName)
This re tries to find a package type of given name defined by the resource type provided.

The resource type id can be null, in which case only the serverside defined package types are searched for.

Parameters:
subject - the authenticated user
resourceTypeId - the id of the resource type associated with the package type or null if only server-side package types should be searched for
packageTypeName - the name of the package type to find
Returns:

findPackageTypeWithVersionFormat

PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat(Subject subject,
                                                                      Integer resourceTypeId,
                                                                      String packageTypeName)
Similar to findPackageType(Subject, Integer, String) but returns the package type along with the version format specification.

Parameters:
subject -
resourceTypeId -
packageTypeName -
Returns:

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

findPackagesByCriteria

PageList<Package> findPackagesByCriteria(Subject subject,
                                         PackageCriteria criteria)
If the criteria object filters on repo id, the subject needs to be able to access that repo. If there is no filter on repos, the subject needs to have MANAGE_REPOSITORIES permission.

Parameters:
subject -
criteria -
Returns:

findPackagesWithLatestVersion

PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(Subject subject,
                                                                         PackageCriteria criteria)
Akin to findPackagesByCriteria(Subject, PackageCriteria) but also determines the latest version of the returned packages.

The provided criteria has to be limited to a specific repo using PackageCriteria.addFilterRepoId(Integer).

Parameters:
subject -
criteria -
Returns:
Throws:
IllegalArgumentException - if the criteria doesn't define a repo 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)
This can be a dangerous call for large packages as the entire package will attempt to be loaded.

Parameters:
user -
resourceId -
installedPackageId -
Returns:
the package bytes


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