org.rhq.enterprise.server.content
Interface RepoManagerRemote

All Known Subinterfaces:
WebservicesRemote
All Known Implementing Classes:
RepoManagerBean, WebservicesManagerBean

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.
 RepoGroup createRepoGroup(Subject subject, RepoGroup repoGroup)
          Creates a new RepoGroup in the server.
 void deleteRepo(Subject subject, int repoId)
          Deletes the indicated repo.
 void deleteRepoGroup(Subject subject, int repoGroupId)
          Deletes the indicated repo group.
 PageList<Distribution> findAssociatedDistributions(Subject subject, int repoId, PageControl pc)
          gets a list of all associated distributions
 PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, java.lang.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.
 Repo getRepo(Subject subject, int repoId)
          Returns the repo with the given id; throws an error if one does not exist at that id.
 RepoGroup getRepoGroup(Subject subject, int repoGroupId)
          Returns the repo group with the given id; throws an error if one does not exist at that id.
 RepoGroupType getRepoGroupTypeByName(Subject subject, java.lang.String name)
          Returns the repo group type with the given name.
 void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds)
          Subscribes the identified resource to the set of identified repos.
 int synchronizeRepos(Subject subject, java.lang.Integer[] 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 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

createRepoGroup

RepoGroup createRepoGroup(Subject subject,
                          RepoGroup repoGroup)
                          throws RepoException
Creates a new RepoGroup in the server.

Parameters:
subject - represents the user creating the group
repoGroup - group data to create
Returns:
group instance populated after persisting
Throws:
RepoException - if a repo group already exists with this 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

deleteRepoGroup

void deleteRepoGroup(Subject subject,
                     int repoGroupId)
Deletes the indicated repo group.

Parameters:
subject - user deleting the group
repoGroupId - identifies the group being deleted

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

getRepoGroup

RepoGroup getRepoGroup(Subject subject,
                       int repoGroupId)
Returns the repo group 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
repoGroupId - identifies the repo group to be retrieved
Returns:
details describing the repo group

getRepoGroupTypeByName

RepoGroupType getRepoGroupTypeByName(Subject subject,
                                     java.lang.String name)
Returns the repo group type with the given name.

Parameters:
subject - user whose permissions will be checked for access to the group type
name - identifies the repo group type
Returns:
details of the group type; null if no group is found with the name

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:
java.lang.IllegalArgumentException - for invalid repoId filter

updateRepo

Repo updateRepo(Subject subject,
                Repo repo)
                throws 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:
RepoException

findPackageVersionsInRepo

PageList<PackageVersion> findPackageVersionsInRepo(Subject subject,
                                                   int repoId,
                                                   java.lang.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

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

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.

findAssociatedDistributions

PageList<Distribution> findAssociatedDistributions(Subject subject,
                                                   int repoId,
                                                   PageControl pc)
gets a list of all associated distributions

Parameters:
subject -
resourceId -
pc -
Returns:

synchronizeRepos

int synchronizeRepos(Subject subject,
                     java.lang.Integer[] repoIds)


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