org.rhq.enterprise.server.content
Interface RepoManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface RepoManagerRemote


Method Summary
 void addPackageVersionsToRepo(Subject subject, int repoId, int[] packageVersionIds)
          Associates the package versions (identified by their IDs) to the given repo (also identified by its ID).
 Repo createRepo(Subject subject, Repo repo)
          Creates a new Repo.
 boolean deletePackageVersionsFromRepo(Subject subject, int repoId, int[] packageVersionId)
          Deletes package versions from a repo if they are not referenced by a content source.
 void deleteRepo(Subject subject, int repoId)
          Deletes the indicated repo.
 PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, String filter, PageControl pc)
          Returns the set of package versions that can currently be accessed via the given repo.
 PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject, PackageVersionCriteria criteria)
           
 PageList<Repo> findRepos(Subject subject, PageControl pc)
          Returns all imported repos in the server.
 PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria)
          Returns all repos that match the given criteria.
 PageList<Resource> findSubscribedResources(Subject subject, int repoId, PageControl pc)
          Gets all resources that are subscribed to the given repo.
 List<SubscribedRepo> findSubscriptions(Subject subject, int resourceId)
          Get a list of truncated Repo objects that represent the subscriptions for the specified resource.
 PackageVersion getLatestPackageVersion(Subject subject, int packageId, int repoId)
          Returns the latest package version of the supplied package.
 Repo getRepo(Subject subject, int repoId)
          Returns the repo with the given id; throws an error if one does not exist at that id.
 void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds)
          Subscribes the identified resource to the set of identified repos.
 int synchronizeRepos(Subject subject, int[] repoIds)
           
 void unsubscribeResourceFromRepos(Subject subject, int resourceId, int[] repoIds)
          Unsubscribes the identified resource from the set of identified repos.
 Repo updateRepo(Subject subject, Repo repo)
          Update an existing Repo object's basic fields, like name, description, etc.
 

Method Detail

addPackageVersionsToRepo

void addPackageVersionsToRepo(Subject subject,
                              int repoId,
                              int[] packageVersionIds)
Associates the package versions (identified by their IDs) to the given repo (also identified by its ID).

Parameters:
subject - The logged in user's subject.
repoId - the ID of the repo
packageVersionIds - the list of package version IDs to add to the repo

createRepo

Repo createRepo(Subject subject,
                Repo repo)
                throws org.rhq.enterprise.server.content.RepoException
Creates a new Repo. Note that the created repo will not have any content sources assigned and no resources will be subscribed. It is a virgin repo.

Parameters:
subject - The logged in user's subject.
repo - a new repo object.
Returns:
the newly created repo
Throws:
RepoException - if a repo already exists with the same name

deleteRepo

void deleteRepo(Subject subject,
                int repoId)
Deletes the indicated repo. If this deletion orphans package versions (that is, its originating resource or content source has been deleted), this will also purge those orphaned package versions.

Parameters:
subject - The logged in user's subject.
repoId - identifies the repo to delete

getRepo

Repo getRepo(Subject subject,
             int repoId)
Returns the repo with the given id; throws an error if one does not exist at that id.

Parameters:
subject - user whose permissions will be checked for access to the repo
repoId - identifies the repo to be retrieved
Returns:
details describing the repo

findReposByCriteria

PageList<Repo> findReposByCriteria(Subject subject,
                                   RepoCriteria criteria)
Returns all repos that match the given criteria.

Parameters:
subject - user making the query
criteria - describes how the query should function; may not be null
Returns:
any repos that match the given criteria; empty list if none match

findRepos

PageList<Repo> findRepos(Subject subject,
                         PageControl pc)
Returns all imported repos in the server.

Parameters:
subject - user making the request
pc - used for pagination
Returns:
paged list

findPackageVersionsInRepoByCriteria

PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject,
                                                             PackageVersionCriteria criteria)
Parameters:
subject -
criteria - Caller must add a valid repoId via PackageVersionCriteria.addFilterRepoId(Integer)}
Returns:
PackageVersions for the repo
Throws:
IllegalArgumentException - for invalid repoId filter

getLatestPackageVersion

PackageVersion getLatestPackageVersion(Subject subject,
                                       int packageId,
                                       int repoId)
Returns the latest package version of the supplied package. The latest version is determined using a comparator which is found using the following rules:
  1. determine the comparator using the package type behavior if one is setup for the package type
  2. If no package behavior exists, use PackageVersion.DEFAULT_COMPARATOR

Parameters:
subject - the authenticated user
packageId - the id of the package to find the latest version for.
repoId - the repo where to take the package versions of the package from
Returns:

updateRepo

Repo updateRepo(Subject subject,
                Repo repo)
                throws org.rhq.enterprise.server.content.RepoException
Update an existing Repo object's basic fields, like name, description, etc. Note that the given repo's relationships will be ignored and not merged with the existing repo (e.g. is subscribed resources will not be changed, regardless of what the given repo's subscribed resources set it).

Parameters:
subject - The logged in user's subject.
repo - to be updated
Returns:
Repo that was updated
Throws:
org.rhq.enterprise.server.content.RepoException

findPackageVersionsInRepo

PageList<PackageVersion> findPackageVersionsInRepo(Subject subject,
                                                   int repoId,
                                                   String filter,
                                                   PageControl pc)
Returns the set of package versions that can currently be accessed via the given repo.

Parameters:
subject - The logged in user's subject.
repoId - identifies the repo
filter - A repo filter.
pc - pagination controls
Returns:
the package versions that are available in the repo

deletePackageVersionsFromRepo

boolean deletePackageVersionsFromRepo(Subject subject,
                                      int repoId,
                                      int[] packageVersionId)
Deletes package versions from a repo if they are not referenced by a content source.

The package versions themselves are not deleted until some content source or repository is deleted at which point orphans detection is performed.

Parameters:
subject -
repoId -
packageVersionIds -
Returns:
true if all the package versions were successfully deleted, false if some references exist.

findSubscribedResources

PageList<Resource> findSubscribedResources(Subject subject,
                                           int repoId,
                                           PageControl pc)
Gets all resources that are subscribed to the given repo.

Parameters:
subject - The logged in user's subject.
repoId -
pc -
Returns:
the list of subscribers

findSubscriptions

List<SubscribedRepo> findSubscriptions(Subject subject,
                                       int resourceId)
Get a list of truncated Repo objects that represent the subscriptions for the specified resource.

Parameters:
subject - The logged in user's subject.
resourceId - The id of the resource.
Returns:
A list of repos.

subscribeResourceToRepos

void subscribeResourceToRepos(Subject subject,
                              int resourceId,
                              int[] repoIds)
Subscribes the identified resource to the set of identified repos. Once complete, the resource will be able to access all package content from all content sources that are assigned to the given repos.

Parameters:
subject - The logged in user's subject.
resourceId - The id of the resource to be subscribed.
repoIds - A list of repos to which the resource is subscribed.

unsubscribeResourceFromRepos

void unsubscribeResourceFromRepos(Subject subject,
                                  int resourceId,
                                  int[] repoIds)
Unsubscribes the identified resource from the set of identified repos.

Parameters:
subject - The logged in user's subject.
resourceId - The id of the resource to be subscribed.
repoIds - A list of repos to which the resource is subscribed.

synchronizeRepos

int synchronizeRepos(Subject subject,
                     int[] repoIds)
                     throws Exception
Throws:
Exception


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