org.rhq.enterprise.server.content
Interface ContentManagerLocal

All Known Implementing Classes:
ContentManagerBean

public interface ContentManagerLocal

EJB interface to the server content subsystem.

Author:
Jason Dobies

Method Summary
 void checkForTimedOutRequests(Subject subject)
          For internal use only - Will check to see if any in progress content request jobs are taking too long to finish and if so marks them as failed.
 void completeDeletePackageRequest(RemovePackagesResponse response)
          For documentation, see ContentServerService.completeDeletePackageRequest(org.rhq.core.domain.content.transfer.RemovePackagesResponse) .
 void completeDeployPackageRequest(DeployPackagesResponse response)
          For documentation, see ContentServerService.completeDeployPackageRequest(org.rhq.core.domain.content.transfer.DeployPackagesResponse) .
 void completeRetrievePackageBitsRequest(ContentServiceResponse response, java.io.InputStream bitStream)
          For documentation, see ContentServerService.completeRetrievePackageBitsRequest(org.rhq.core.clientapi.server.content.ContentServiceResponse, java.io.InputStream) )}.
 ContentServiceRequest createDeployRequest(int resourceId, java.lang.String username, java.util.Set<ResourcePackageDetails> packages, java.lang.String requestNotes)
          For internal use only - Adds a request entry to the database to track the deployment of a group of packages.
 PackageVersion createPackageVersion(java.lang.String packageName, int packageTypeId, java.lang.String version, int architectureId, java.io.InputStream packageBitStream)
          Creates a new package version in the system.
 PackageVersion createPackageVersion(Subject subject, java.lang.String packageName, int packageTypeId, java.lang.String version, java.lang.Integer architectureId, byte[] packageBytes)
           
 ContentServiceRequest createRemoveRequest(int resourceId, java.lang.String username, int[] installedPackageIds, java.lang.String requestNotes)
          For internal use only - Adds a request entry to the database to track the deleting of currently installed packages from the resource.
 ContentServiceRequest createRetrieveBitsRequest(int resourceId, java.lang.String username, int installedPackageId)
          For internal use only - Adds a request entry to the database to track the request for a package's bits.
 void deletePackages(Subject user, int[] resourceIds, int[] installedPackageIds)
          Deletes the specified package from the resource.
 void deletePackages(Subject subject, int resourceId, int[] installedPackageIds, java.lang.String requestNotes)
           
 void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds)
           
 void deployPackages(Subject user, int resourceId, java.util.Set<ResourcePackageDetails> packages, java.lang.String requestNotes)
          Deploys a package on the specified resource.
 void failRequest(int requestId, java.lang.Throwable error)
          For internal use only - Updates a persisted ContentServiceRequest in the case a failure is encountered during one of the use case methods (i.e.
 java.util.List<Architecture> findArchitectures(Subject subject)
           
 PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria)
           
 java.util.List<java.lang.String> findInstalledPackageVersions(Subject subject, int resourceId)
          Returns list of version strings for installed packages on the resource.
 java.util.List<PackageType> findPackageTypes(Subject subject, java.lang.String resourceTypeName, java.lang.String pluginName)
           
 PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject, PackageVersionCriteria criteria)
           
 InstalledPackage getBackingPackageForResource(Subject subject, int resourceId)
           
 Architecture getNoArchitecture()
          Returns the entity associated with no architecture.
 byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId)
           
 PackageType getResourceCreationPackageType(int resourceTypeId)
          Returns the package type that backs resources of the specified type.
 java.util.Set<ResourcePackageDetails> loadDependencies(int requestId, java.util.Set<PackageDetailsKey> keys)
          For documentation, see ContentServerService.loadDependencies(int, java.util.Set)
 void mergeDiscoveredPackages(ContentDiscoveryReport report)
          For documentation, see ContentServerService.mergeDiscoveredPackages(org.rhq.core.domain.content.transfer.ContentDiscoveryReport) .
 Package persistOrMergePackageSafely(Package pkg)
          Finds, and if it doesn't exist, persists the package.
 PackageVersion persistOrMergePackageVersionSafely(PackageVersion pv)
          Finds, and if it doesn't exist, persists the package version.
 Package persistPackage(Package pkg)
          Very simple method that pesists the given package within its own transaction.
 PackageVersion persistPackageVersion(PackageVersion pv)
          Very simple method that persists the given package version within its own transaction.
 void retrieveBitsFromResource(Subject user, int resourceId, int installedPackageId)
          Requests the plugin load and send the actual bits for the specified package.
 java.util.List<DeployPackageStep> translateInstallationSteps(int resourceId, ResourcePackageDetails packageDetails)
          Requests the plugin translate the installation steps of the specified package.
 

Method Detail

deployPackages

void deployPackages(Subject user,
                    int resourceId,
                    java.util.Set<ResourcePackageDetails> packages,
                    java.lang.String requestNotes)
Deploys a package on the specified resource. 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:
user - the user who is requesting the creation
resourceId - identifies the resource against which the package will be deployed
packages - packages (with their deployment time configuration values) to deploy
requestNotes - user-specified notes on what is contained in this request

deletePackages

void deletePackages(Subject user,
                    int[] resourceIds,
                    int[] installedPackageIds)
Deletes the specified package from the resource.

Parameters:
user - the user who is requesting the delete
resourceIds - identifies the resources from which the packages should be deleted
installedPackageIds - identifies all of the packages to be deleted

retrieveBitsFromResource

void retrieveBitsFromResource(Subject user,
                              int resourceId,
                              int installedPackageId)
Requests the plugin load and send the actual bits for the specified package.

Parameters:
user - the user who is requesting the update
resourceId - identifies the resource against which the package exists
installedPackageId - id of the installed package to retrieve bits

translateInstallationSteps

java.util.List<DeployPackageStep> translateInstallationSteps(int resourceId,
                                                             ResourcePackageDetails packageDetails)
                                                             throws java.lang.Exception
Requests the plugin translate the installation steps of the specified package.

Parameters:
resourceId - resource against which the package is being installed
packageDetails - package being installed
Returns:
list of deployment steps if the plugin specified them; null if they cannot be determined for this package
Throws:
java.lang.Exception - if there is an error either contacting the agent or in the plugin's generation of the steps

mergeDiscoveredPackages

void mergeDiscoveredPackages(ContentDiscoveryReport report)
For documentation, see ContentServerService.mergeDiscoveredPackages(org.rhq.core.domain.content.transfer.ContentDiscoveryReport) .


completeDeployPackageRequest

void completeDeployPackageRequest(DeployPackagesResponse response)
For documentation, see ContentServerService.completeDeployPackageRequest(org.rhq.core.domain.content.transfer.DeployPackagesResponse) .


completeDeletePackageRequest

void completeDeletePackageRequest(RemovePackagesResponse response)
For documentation, see ContentServerService.completeDeletePackageRequest(org.rhq.core.domain.content.transfer.RemovePackagesResponse) .


completeRetrievePackageBitsRequest

void completeRetrievePackageBitsRequest(ContentServiceResponse response,
                                        java.io.InputStream bitStream)
For documentation, see ContentServerService.completeRetrievePackageBitsRequest(org.rhq.core.clientapi.server.content.ContentServiceResponse, java.io.InputStream) )}.


loadDependencies

java.util.Set<ResourcePackageDetails> loadDependencies(int requestId,
                                                       java.util.Set<PackageDetailsKey> keys)
For documentation, see ContentServerService.loadDependencies(int, java.util.Set)


createDeployRequest

ContentServiceRequest createDeployRequest(int resourceId,
                                          java.lang.String username,
                                          java.util.Set<ResourcePackageDetails> packages,
                                          java.lang.String requestNotes)
For internal use only - Adds a request entry to the database to track the deployment of a group of packages. This will be performed in a new transaction.

Parameters:
resourceId - resource against which the package request was executed
username - user who made the request
packages - packages being deployed in the request
requestNotes - user-specified notes on what the request entails
Returns:
request entity after being persisted to the database (it's ID will be populated)

createRemoveRequest

ContentServiceRequest createRemoveRequest(int resourceId,
                                          java.lang.String username,
                                          int[] installedPackageIds,
                                          java.lang.String requestNotes)
For internal use only - Adds a request entry to the database to track the deleting of currently installed packages from the resource. This will be performed in a new transaction.

Parameters:
resourceId - resource against which the package request was executed
username - user who made the request
installedPackageIds - identifies the installed packages that are to be deleted; ids in this list must be of valid InstalledPackage objects on the resource
requestNotes - user-specified notes on what the request entails
Returns:
request entity after being persisted to the database (it's ID will be populated)

createRetrieveBitsRequest

ContentServiceRequest createRetrieveBitsRequest(int resourceId,
                                                java.lang.String username,
                                                int installedPackageId)
For internal use only - Adds a request entry to the database to track the request for a package's bits. This will be performed in a new transaction.

Parameters:
resourceId - resource against which the package request was executed
username - user who made the request
installedPackageId - package whose bits are being retrieved by the request; this must be the ID of a valid InstalledPackage on the resource.
Returns:
request entity after being persisted to the database (it's ID will be populated)

failRequest

void failRequest(int requestId,
                 java.lang.Throwable error)
For internal use only - Updates a persisted ContentServiceRequest in the case a failure is encountered during one of the use case methods (i.e. create, delete).

Parameters:
requestId - identifies the previously persisted request
error - error encountered to cause the failure

checkForTimedOutRequests

void checkForTimedOutRequests(Subject subject)
For internal use only - Will check to see if any in progress content request jobs are taking too long to finish and if so marks them as failed. This method will be periodically called by the Server.

Parameters:
subject - only the overlord may execute this system operation

createPackageVersion

PackageVersion createPackageVersion(java.lang.String packageName,
                                    int packageTypeId,
                                    java.lang.String version,
                                    int architectureId,
                                    java.io.InputStream packageBitStream)
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:
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
Returns:
newly created package version if one did not exist; existing package version that matches these data if one was found

persistPackageVersion

PackageVersion persistPackageVersion(PackageVersion pv)
Very simple method that persists the given package version within its own transaction.

This method is here to support persistOrMergePackageVersionSafely(PackageVersion), it is not meant for general consumption.

Parameters:
pv - the package version to persist
Returns:
the newly persisted package version

persistOrMergePackageVersionSafely

PackageVersion persistOrMergePackageVersionSafely(PackageVersion pv)
Finds, and if it doesn't exist, persists the package version. If it already exists, it will return the merge the given PV with the object it found and return the merged PV. This performs its tasks safely; that is, it makes sure that no contraint violations occur if the package version already exists.

This method is for a very specific use case - that is, when creating a package version in a place where, concurrently, someone else might try to create the same package version. It is not for general persisting/merging of package versions.

Parameters:
pv - the package version to find and possibly persist to the database
Returns:
the package version that was found/persisted

persistPackage

Package persistPackage(Package pkg)
Very simple method that pesists the given package within its own transaction.

This method is here to support persistOrMergePackageSafely(Package), it is not meant for general consumption.

Parameters:
pkg - the package to persist
Returns:
the newly persisted package

persistOrMergePackageSafely

Package persistOrMergePackageSafely(Package pkg)
Finds, and if it doesn't exist, persists the package. If it already exists, it will return the merge the given package with the object it found and return the merged package. This performs its tasks safely; that is, it makes sure that no contraint violations occur if the package already exists.

This method is for a very specific use case - that is, when creating a package in a place where, concurrently, someone else might try to create the same package. It is not for general persisting/merging of packages.

Parameters:
pkg - the package to find and possibly persist to the database
Returns:
the package that was found/persisted

getNoArchitecture

Architecture getNoArchitecture()
Returns the entity associated with no architecture.

Returns:
no architecture entity

findInstalledPackageVersions

java.util.List<java.lang.String> findInstalledPackageVersions(Subject subject,
                                                              int resourceId)
Returns list of version strings for installed packages on the resource.

Parameters:
subject -
resourceId -
Returns:
List of InstalledPackage versions

getResourceCreationPackageType

PackageType getResourceCreationPackageType(int resourceTypeId)
Returns the package type that backs resources of the specified type.

Parameters:
resourceTypeId - identifies the resource type.
Returns:
backing package type if one exists; null otherwise

createPackageVersion

PackageVersion createPackageVersion(Subject subject,
                                    java.lang.String packageName,
                                    int packageTypeId,
                                    java.lang.String version,
                                    java.lang.Integer architectureId,
                                    byte[] packageBytes)
See Also:
createPackageVersion(Subject, String, int, String, int, byte[]);

deletePackages

void deletePackages(Subject subject,
                    int resourceId,
                    int[] installedPackageIds,
                    java.lang.String requestNotes)
See Also:
ContentManagerRemote#deletePackages(Subject, int, int[], String)}

deployPackages

void deployPackages(Subject subject,
                    int[] resourceIds,
                    int[] packageVersionIds)
See Also:
ContentManagerRemote#deployPackages(Subject, int[], int[])}

findArchitectures

java.util.List<Architecture> findArchitectures(Subject subject)
See Also:
ContentManagerRemote#findArchitectures(Subject)}

findPackageTypes

java.util.List<PackageType> findPackageTypes(Subject subject,
                                             java.lang.String resourceTypeName,
                                             java.lang.String pluginName)
                                             throws ResourceTypeNotFoundException
Throws:
ResourceTypeNotFoundException
See Also:
ContentManagerRemote#findPackageTypes(Subject, String, String)}

findInstalledPackagesByCriteria

PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject,
                                                           InstalledPackageCriteria criteria)
See Also:
ContentManagerRemote#findInstalledPackagesByCriteria(Subject, InstalledPackageCriteria)}

findPackageVersionsByCriteria

PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject,
                                                       PackageVersionCriteria criteria)
See Also:
ContentManagerRemote#findPackageVersionsByCriteria(Subject, PackageVersionCriteria)}

getBackingPackageForResource

InstalledPackage getBackingPackageForResource(Subject subject,
                                              int resourceId)
See Also:
ContentManagerRemote#getBackingPackageForResource(Subject, int)

getPackageBytes

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


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