public interface ContentManagerLocal extends ContentManagerRemote
| Modifier and Type | Field and Description |
|---|---|
static String |
UPLOAD_DISPLAY_VERSION |
static String |
UPLOAD_FILE_INSTALL_DATE |
static String |
UPLOAD_FILE_NAME |
static String |
UPLOAD_FILE_SIZE
This is currently ignored as the file size is computed
upon persist.
|
static String |
UPLOAD_MD5 |
static String |
UPLOAD_OWNER
This doesn't seem to serve any purpose.
|
static String |
UPLOAD_SHA256
This is currently ignored as the SHA is computed upon
persist.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkForTimedOutRequests(org.rhq.core.domain.auth.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(org.rhq.core.domain.content.transfer.RemovePackagesResponse response)
|
void |
completeDeployPackageRequest(org.rhq.core.domain.content.transfer.DeployPackagesResponse response)
|
void |
completeRetrievePackageBitsRequest(ContentServiceResponse response,
InputStream bitStream)
|
org.rhq.core.domain.content.ContentServiceRequest |
createDeployRequest(int resourceId,
String username,
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> packages,
String requestNotes)
For internal use only - Adds a request entry to the database to track the deployment of a group of packages.
|
org.rhq.core.domain.content.PackageVersion |
createPackageVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
Integer architectureId,
byte[] packageBytes)
Creates a new package version in the system.
|
org.rhq.core.domain.content.PackageVersion |
createPackageVersionWithDisplayVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
String displayVersion,
Integer architectureId,
byte[] packageBytes)
Creates a new package version in the system.
|
org.rhq.core.domain.content.PackageVersion |
createPackageVersionWithDisplayVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
String displayVersion,
int architectureId,
InputStream packageBitStream)
Creates a new package version in the system.
|
org.rhq.core.domain.content.ContentServiceRequest |
createRemoveRequest(int resourceId,
String username,
int[] installedPackageIds,
String requestNotes)
For internal use only - Adds a request entry to the database to track the deleting of currently installed
packages from the resource.
|
org.rhq.core.domain.content.ContentServiceRequest |
createRetrieveBitsRequest(int resourceId,
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(org.rhq.core.domain.auth.Subject user,
int[] resourceIds,
int[] installedPackageIds)
Deletes the specified package from the resource.
|
void |
deletePackages(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] installedPackageIds,
String requestNotes)
Deletes the specified package from the resource.
|
void |
deletePackageVersion(org.rhq.core.domain.auth.Subject subject,
int packageVersionId)
Deletes the specified PackageVersion from the system.
|
void |
deployPackages(org.rhq.core.domain.auth.Subject user,
int resourceId,
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> packages,
String requestNotes)
Deploys a package on the specified resource.
|
void |
deployPackagesWithNote(org.rhq.core.domain.auth.Subject subject,
int[] resourceIds,
int[] packageVersionIds,
String requestNotes)
Deploys packages on the specified resources.
|
void |
failRequest(int requestId,
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. |
List<org.rhq.core.domain.content.Architecture> |
findArchitectures(org.rhq.core.domain.auth.Subject subject)
Returns all architectures known to the system.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.InstalledPackage> |
findInstalledPackagesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.InstalledPackageCriteria criteria) |
List<String> |
findInstalledPackageVersions(org.rhq.core.domain.auth.Subject subject,
int resourceId)
Returns list of version strings for installed packages on the resource.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.Package> |
findPackagesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageCriteria criteria)
If the criteria object filters on repo id, the subject needs to be able to
access that repo.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.composite.PackageAndLatestVersionComposite> |
findPackagesWithLatestVersion(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageCriteria criteria)
Akin to
ContentManagerRemote.findPackagesByCriteria(Subject, PackageCriteria) but also
determines the latest version of the returned packages. |
org.rhq.core.domain.content.PackageType |
findPackageType(org.rhq.core.domain.auth.Subject subject,
Integer resourceTypeId,
String packageTypeName)
This re tries to find a package type of given name defined by the resource type provided.
|
List<org.rhq.core.domain.content.PackageType> |
findPackageTypes(org.rhq.core.domain.auth.Subject subject,
String resourceTypeName,
String pluginName)
This gets the package types that can be deployed to the given resource.
|
org.rhq.core.domain.content.composite.PackageTypeAndVersionFormatComposite |
findPackageTypeWithVersionFormat(org.rhq.core.domain.auth.Subject subject,
Integer resourceTypeId,
String packageTypeName)
Similar to
ContentManagerRemote.findPackageType(Subject, Integer, String) but
returns the package type along with the version format specification. |
org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.PackageVersion> |
findPackageVersionsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageVersionCriteria criteria)
If a resourceId filter is not set via
PackageVersionCriteria.addFilterResourceId(Integer) then
this method requires InventoryManager permissions. |
org.rhq.core.domain.content.InstalledPackage |
getBackingPackageForResource(org.rhq.core.domain.auth.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).
|
org.rhq.core.domain.content.Architecture |
getNoArchitecture()
Returns the entity associated with no architecture.
|
byte[] |
getPackageBytes(org.rhq.core.domain.auth.Subject user,
int resourceId,
int installedPackageId)
This can be a dangerous call for large packages as the entire package will attempt to be loaded.
|
org.rhq.core.domain.content.PackageType |
getResourceCreationPackageType(int resourceTypeId)
Returns the package type that backs resources of the specified type.
|
File |
getTemporaryContentFile(String temporaryContentHandle)
Get the file denoted by this
temporaryContentHandle. |
org.rhq.core.domain.content.PackageVersion |
getUploadedPackageVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
int architectureId,
InputStream packageBitStream,
Map<String,String> packageUploadDetails,
Integer repoId)
This method is essentially the same as
#createPackageVersion(Subject, String, int, String, int, InputStream)
but will update the package bits if a package version with the provided identification already exists. |
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> |
loadDependencies(int requestId,
Set<org.rhq.core.domain.content.PackageDetailsKey> keys)
For documentation, see
ContentServerService.loadDependencies(int, java.util.Set) |
void |
mergeDiscoveredPackages(ContentDiscoveryReport report)
|
org.rhq.core.domain.content.Package |
persistOrMergePackageSafely(org.rhq.core.domain.content.Package pkg)
Finds, and if it doesn't exist, persists the package.
|
org.rhq.core.domain.content.PackageVersion |
persistOrMergePackageVersionSafely(org.rhq.core.domain.content.PackageVersion pv)
Finds, and if it doesn't exist, persists the package version.
|
org.rhq.core.domain.content.Package |
persistPackage(org.rhq.core.domain.content.Package pkg)
Very simple method that pesists the given package within its own transaction.
|
org.rhq.core.domain.content.PackageVersion |
persistPackageVersion(org.rhq.core.domain.content.PackageVersion pv)
Very simple method that persists the given package version within its own transaction.
|
org.rhq.core.domain.content.PackageType |
persistServersidePackageType(org.rhq.core.domain.content.PackageType packageType)
This method is used to persist new package types that are defined on the server-side
by some kind of plugin.
|
void |
retrieveBitsFromResource(org.rhq.core.domain.auth.Subject user,
int resourceId,
int installedPackageId)
Requests the plugin load and send the actual bits for the specified package.
|
List<org.rhq.core.domain.content.transfer.DeployPackageStep> |
translateInstallationSteps(int resourceId,
org.rhq.core.domain.content.transfer.ResourcePackageDetails packageDetails)
Requests the plugin translate the installation steps of the specified package.
|
void |
updateBlobStream(InputStream stream,
org.rhq.core.domain.content.PackageBits bits,
Map<String,String> contentDetails) |
void |
writeBlobOutToStream(OutputStream stream,
org.rhq.core.domain.content.PackageBits bits,
boolean closeStreams) |
createPackageVersionWithDisplayVersion, createTemporaryContentHandle, deployPackages, uploadContentFragmentstatic final String UPLOAD_FILE_SIZE
static final String UPLOAD_FILE_INSTALL_DATE
static final String UPLOAD_OWNER
static final String UPLOAD_FILE_NAME
static final String UPLOAD_MD5
static final String UPLOAD_DISPLAY_VERSION
static final String UPLOAD_SHA256
void deployPackages(org.rhq.core.domain.auth.Subject user,
int resourceId,
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> packages,
String requestNotes)
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.user - the user who is requesting the creationresourceId - identifies the resource against which the package will be deployedpackages - packages (with their deployment time configuration values) to deployrequestNotes - user-specified notes on what is contained in this requestvoid deletePackages(org.rhq.core.domain.auth.Subject user,
int[] resourceIds,
int[] installedPackageIds)
user - the user who is requesting the deleteresourceIds - identifies the resources from which the packages should be deletedinstalledPackageIds - identifies all of the packages to be deletedvoid retrieveBitsFromResource(org.rhq.core.domain.auth.Subject user,
int resourceId,
int installedPackageId)
user - the user who is requesting the updateresourceId - identifies the resource against which the package existsinstalledPackageId - id of the installed package to retrieve bitsList<org.rhq.core.domain.content.transfer.DeployPackageStep> translateInstallationSteps(int resourceId, org.rhq.core.domain.content.transfer.ResourcePackageDetails packageDetails) throws Exception
resourceId - resource against which the package is being installedpackageDetails - package being installednull if they cannot be determined
for this packageException - if there is an error either contacting the agent or in the plugin's generation of the stepsvoid mergeDiscoveredPackages(ContentDiscoveryReport report)
void completeDeployPackageRequest(org.rhq.core.domain.content.transfer.DeployPackagesResponse response)
void completeDeletePackageRequest(org.rhq.core.domain.content.transfer.RemovePackagesResponse response)
void completeRetrievePackageBitsRequest(ContentServiceResponse response, InputStream bitStream)
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> loadDependencies(int requestId, Set<org.rhq.core.domain.content.PackageDetailsKey> keys)
ContentServerService.loadDependencies(int, java.util.Set)org.rhq.core.domain.content.ContentServiceRequest createDeployRequest(int resourceId,
String username,
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> packages,
String requestNotes)
resourceId - resource against which the package request was executedusername - user who made the requestpackages - packages being deployed in the requestrequestNotes - user-specified notes on what the request entailsorg.rhq.core.domain.content.ContentServiceRequest createRemoveRequest(int resourceId,
String username,
int[] installedPackageIds,
String requestNotes)
resourceId - resource against which the package request was executedusername - user who made the requestinstalledPackageIds - identifies the installed packages that are to be deleted; ids in this list must be of
valid InstalledPackage objects on the resourcerequestNotes - user-specified notes on what the request entailsorg.rhq.core.domain.content.ContentServiceRequest createRetrieveBitsRequest(int resourceId,
String username,
int installedPackageId)
resourceId - resource against which the package request was executedusername - user who made the requestinstalledPackageId - package whose bits are being retrieved by the request; this must be the ID of a valid
InstalledPackage on the resource.void failRequest(int requestId,
Throwable error)
ContentServiceRequest in the case a failure is
encountered during one of the use case methods (i.e. create, delete).requestId - identifies the previously persisted requesterror - error encountered to cause the failurevoid checkForTimedOutRequests(org.rhq.core.domain.auth.Subject subject)
subject - only the overlord may execute this system operationorg.rhq.core.domain.content.PackageVersion createPackageVersionWithDisplayVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
String displayVersion,
int architectureId,
InputStream packageBitStream)
subject - the user requesting the package creationpackageName - parent package name; uniquely identifies the package under which this version goespackageTypeId - identifies the type of package in case the general package needs to be createdversion - identifies the version to be createdisplayVersion - package display versionarchitectureId - architecture of the newly created package versionorg.rhq.core.domain.content.PackageVersion getUploadedPackageVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
int architectureId,
InputStream packageBitStream,
Map<String,String> packageUploadDetails,
Integer repoId)
#createPackageVersion(Subject, String, int, String, int, InputStream)
but will update the package bits if a package version with the provided identification already exists.subject - the current userpackageName - the name of the package (the general package will be created if none exists)packageTypeId - the id of the package type. This is ignored if the newResourceTypeId is not nullversion - the version of the package version being createdarchitectureId - the architecture of the package versionpackageBitStream - the input stream with the package bitspackageUploadDetails - additional details about the package. See the constants defined in this interfacerepoId - an optional id of the repo to insert the package version inorg.rhq.core.domain.content.PackageVersion persistPackageVersion(org.rhq.core.domain.content.PackageVersion pv)
This method is here to support persistOrMergePackageVersionSafely(PackageVersion),
it is not meant for general consumption.
pv - the package version to persistorg.rhq.core.domain.content.PackageVersion persistOrMergePackageVersionSafely(org.rhq.core.domain.content.PackageVersion pv)
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.
pv - the package version to find and possibly persist to the databaseorg.rhq.core.domain.content.Package persistPackage(org.rhq.core.domain.content.Package pkg)
This method is here to support persistOrMergePackageSafely(Package),
it is not meant for general consumption.
pkg - the package to persistorg.rhq.core.domain.content.Package persistOrMergePackageSafely(org.rhq.core.domain.content.Package pkg)
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.
pkg - the package to find and possibly persist to the databaseorg.rhq.core.domain.content.Architecture getNoArchitecture()
List<String> findInstalledPackageVersions(org.rhq.core.domain.auth.Subject subject, int resourceId)
subject - resourceId - org.rhq.core.domain.content.PackageType getResourceCreationPackageType(int resourceTypeId)
resourceTypeId - identifies the resource type.null otherwiseorg.rhq.core.domain.content.PackageVersion createPackageVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
Integer architectureId,
byte[] packageBytes)
ContentManagerRemotecreatePackageVersion in interface ContentManagerRemotesubject - The logged in subjectpackageName - parent package name; uniquely identifies the package under which this version goespackageTypeId - identifies the type of package in case the general package needs to be createdversion - identifies the version to be createarchitectureId - architecture of the newly created package version. If null then no architecture restriction.createPackageVersion(Subject, String, int, String, int, byte[]);org.rhq.core.domain.content.PackageVersion createPackageVersionWithDisplayVersion(org.rhq.core.domain.auth.Subject subject,
String packageName,
int packageTypeId,
String version,
String displayVersion,
Integer architectureId,
byte[] packageBytes)
ContentManagerRemoteContentManagerRemote.createPackageVersionWithDisplayVersion(org.rhq.core.domain.auth.Subject, String, int, String, String, Integer, String)
instead.createPackageVersionWithDisplayVersion in interface ContentManagerRemotesubject - The logged in subjectpackageName - parent package name; uniquely identifies the package under which this version goespackageTypeId - identifies the type of package in case the general package needs to be createdversion - identifies the version to be createarchitectureId - architecture of the newly created package version. If null then no architecture restriction.createPackageVersion(Subject, String, int, String, int, byte[]);void deletePackages(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] installedPackageIds,
String requestNotes)
ContentManagerRemotedeletePackages in interface ContentManagerRemotesubject - The logged in subjectresourceId - identifies the resource from which the packages should be deletedinstalledPackageIds - identifies all of the packages to be deletedContentManagerRemote#deletePackages(Subject, int, int[], String)}void deletePackageVersion(org.rhq.core.domain.auth.Subject subject,
int packageVersionId)
ContentManagerRemotedeletePackageVersion in interface ContentManagerRemotesubject - The logged in subjectpackageVersionId - The package version to deleteContentManagerRemote#deletePackageVersion(Subject, int)}void deployPackagesWithNote(org.rhq.core.domain.auth.Subject subject,
int[] resourceIds,
int[] packageVersionIds,
String requestNotes)
ContentManagerRemote
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.deployPackagesWithNote in interface ContentManagerRemotesubject - The logged in subjectresourceIds - identifies the resources against which the package will be deployedpackageVersionIds - packageVersions we want to installrequestNotes - request notesContentManagerRemote#deployPackagesWithNote(Subject, int[], int[], String)}List<org.rhq.core.domain.content.Architecture> findArchitectures(org.rhq.core.domain.auth.Subject subject)
ContentManagerRemotefindArchitectures in interface ContentManagerRemotesubject - The logged in subjectContentManagerRemote#findArchitectures(Subject)}List<org.rhq.core.domain.content.PackageType> findPackageTypes(org.rhq.core.domain.auth.Subject subject, String resourceTypeName, String pluginName) throws ResourceTypeNotFoundException
ContentManagerRemotefindPackageTypes in interface ContentManagerRemotesubject - The logged in subjectresourceTypeName - The resource type in questionResourceTypeNotFoundExceptionContentManagerRemote#findPackageTypes(Subject, String, String)}org.rhq.core.domain.content.PackageType findPackageType(org.rhq.core.domain.auth.Subject subject,
Integer resourceTypeId,
String packageTypeName)
ContentManagerRemoteThe resource type id can be null, in which case only the server-side defined package types are searched for.
findPackageType in interface ContentManagerRemotesubject - the authenticated userresourceTypeId - the id of the resource type associated with the package type or null if only server-side package types should be searched forpackageTypeName - the name of the package type to findContentManagerRemote#findPackageType(Subject, Integer, String)}org.rhq.core.domain.content.composite.PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat(org.rhq.core.domain.auth.Subject subject,
Integer resourceTypeId,
String packageTypeName)
ContentManagerRemoteContentManagerRemote.findPackageType(Subject, Integer, String) but
returns the package type along with the version format specification.findPackageTypeWithVersionFormat in interface ContentManagerRemoteContentManagerRemote#findPackageTypeWithVersionFormat(Subject, Integer, String)}org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.InstalledPackage> findInstalledPackagesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.InstalledPackageCriteria criteria)
findInstalledPackagesByCriteria in interface ContentManagerRemotecriteria - InstalledPackageCriteriaContentManagerRemote#findInstalledPackagesByCriteria(Subject, InstalledPackageCriteria)}org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.PackageVersion> findPackageVersionsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageVersionCriteria criteria)
ContentManagerRemotePackageVersionCriteria.addFilterResourceId(Integer) then
this method requires InventoryManager permissions. When set the user must have permission to view
the resource.findPackageVersionsByCriteria in interface ContentManagerRemoteContentManagerRemote#findPackageVersionsByCriteria(Subject, PackageVersionCriteria)}org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.Package> findPackagesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageCriteria criteria)
ContentManagerRemotefindPackagesByCriteria in interface ContentManagerRemoteContentManagerRemote.findPackagesByCriteria(Subject, PackageCriteria)org.rhq.core.domain.util.PageList<org.rhq.core.domain.content.composite.PackageAndLatestVersionComposite> findPackagesWithLatestVersion(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PackageCriteria criteria)
ContentManagerRemoteContentManagerRemote.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).
findPackagesWithLatestVersion in interface ContentManagerRemoteContentManagerRemote.findPackagesWithLatestVersion(Subject, PackageCriteria)org.rhq.core.domain.content.InstalledPackage getBackingPackageForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId)
ContentManagerRemotegetBackingPackageForResource in interface ContentManagerRemoteresourceId - a valid resourceContentManagerRemote#getBackingPackageForResource(Subject, int)byte[] getPackageBytes(org.rhq.core.domain.auth.Subject user,
int resourceId,
int installedPackageId)
ContentManagerRemotegetPackageBytes in interface ContentManagerRemoteContentManagerRemote#getPackageBytes(Subject, int, int)}org.rhq.core.domain.content.PackageType persistServersidePackageType(org.rhq.core.domain.content.PackageType packageType)
Server-side package types are used to identify data stored in the content subsystem
which don't have any agent-side counter-part. Such package types are required to have
the resource type set to null.
packageType - the package type to persistIllegalArgumentException - if the supplied package type has non-null resource typevoid writeBlobOutToStream(OutputStream stream, org.rhq.core.domain.content.PackageBits bits, boolean closeStreams)
void updateBlobStream(InputStream stream, org.rhq.core.domain.content.PackageBits bits, Map<String,String> contentDetails)
File getTemporaryContentFile(String temporaryContentHandle)
temporaryContentHandle.temporaryContentHandle - temporaryContentHandleContentManagerRemote.createTemporaryContentHandle()Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.