org.rhq.enterprise.server.content
Interface RepoManagerLocal

All Known Implementing Classes:
RepoManagerBean

public interface RepoManagerLocal


Method Summary
 void addContentSourcesToRepo(Subject subject, int repoId, int[] contentSourceIds)
           
 void addPackageVersionsToRepo(Subject subject, int repoId, int[] packageVersionIds)
           
 void addRepoRelationship(Subject subject, int repoId, int relatedRepoId, java.lang.String relationshipTypeName)
          Creates a relationship between two repos.
 java.lang.String calculateSyncStatus(Subject subject, int repoId)
          Get the overall sync status of this Repository.
 Repo createCandidateRepo(Subject subject, Repo repo)
          Functions similar to RepoManagerRemote.createRepo(Subject, Repo) except that it will ensure the candidate bit on the repo parameter is correctly set.
 Repo createRepo(Subject subject, Repo repo)
           
 RepoGroup createRepoGroup(Subject subject, RepoGroup repoGroup)
           
 void deleteCandidatesWithOnlyContentSource(Subject subject, int contentSourceId)
          Removes candidate repos whose only content source is the indicated content source.
 void deleteRepo(Subject subject, int repoId)
           
 void deleteRepoGroup(Subject subject, int repoGroupId)
           
 PageList<ContentSource> findAssociatedContentSources(Subject subject, int repoId, PageControl pc)
           
 PageList<Distribution> findAssociatedDistributions(Subject subject, int repoid, PageControl pc)
           
 java.util.List<RepoComposite> findAvailableResourceSubscriptions(int resourceId)
          Gets all repos that aren't subscribed to for the given resource.
 PageList<RepoComposite> findAvailableResourceSubscriptions(Subject subject, int resourceId, PageControl pc)
          Gets all repos that aren't subscribed to for the given resource.
 PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, PageControl pc)
          Returns the set of package versions that can currently be accessed via the given repo.
 PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, java.lang.String filter, PageControl pc)
           
 PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject, PackageVersionCriteria criteria)
           
 PageList<Repo> findRepos(Subject subject, PageControl pc)
           
 PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria)
           
 java.util.List<RepoComposite> findResourceSubscriptions(int resourceId)
          Gets all repos that are subscribed to by the given resource.
 PageList<RepoComposite> findResourceSubscriptions(Subject subject, int resourceId, PageControl pc)
          Gets all repos that are subscribed to by the given resource.
 PageList<Resource> findSubscribedResources(Subject subject, int repoId, PageControl pc)
           
 long getPackageVersionCountFromRepo(Subject subject, int repoId)
           
 Repo getRepo(Subject subject, int repoId)
           
 java.util.List<Repo> getRepoByName(java.lang.String name)
          Returns all repos that match the given name.
 RepoGroup getRepoGroup(Subject subject, int repoGroupId)
           
 RepoGroup getRepoGroupByName(java.lang.String name)
          Returns the repo group with the given name if it exists.
 RepoGroupType getRepoGroupTypeByName(Subject subject, java.lang.String name)
           
 void importCandidateRepo(Subject subject, java.util.List<java.lang.Integer> repoIds)
          Changes the specified repos from being candidates in the system into full blown repositories, allowing their packages to be syncced and resources to subscribe to them.
 void processRepoImportReport(Subject subject, RepoImportReport report, int contentSourceId, java.lang.StringBuilder result)
          Handles a repo report from a content provider, adding and removing candidate repos as necessary into the database.
 void removeContentSourcesFromRepo(Subject subject, int repoId, int[] contentSourceIds)
           
 void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds)
           
 int synchronizeRepos(Subject subject, java.lang.Integer[] repoIds)
          Syncronize the content associated with the repoIds passed in.
 void unsubscribeResourceFromRepos(Subject subject, int resourceId, int[] repoIds)
           
 Repo updateRepo(Subject subject, Repo repo)
           
 

Method Detail

findRepos

PageList<Repo> findRepos(Subject subject,
                         PageControl pc)
See Also:
RepoManagerRemote.findRepos(Subject, PageControl)

findAssociatedContentSources

PageList<ContentSource> findAssociatedContentSources(Subject subject,
                                                     int repoId,
                                                     PageControl pc)

findResourceSubscriptions

PageList<RepoComposite> findResourceSubscriptions(Subject subject,
                                                  int resourceId,
                                                  PageControl pc)
Gets all repos that are subscribed to by the given resource.

Parameters:
subject -
resourceId -
pc -
Returns:
the list of subscriptions

findAvailableResourceSubscriptions

PageList<RepoComposite> findAvailableResourceSubscriptions(Subject subject,
                                                           int resourceId,
                                                           PageControl pc)
Gets all repos that aren't subscribed to for the given resource.

Parameters:
subject -
resourceId -
pc -
Returns:
the list of available repos for the given resource

findResourceSubscriptions

java.util.List<RepoComposite> findResourceSubscriptions(int resourceId)
Gets all repos that are subscribed to by the given resource.

Parameters:
resourceId -
Returns:
the list of subscriptions

findAvailableResourceSubscriptions

java.util.List<RepoComposite> findAvailableResourceSubscriptions(int resourceId)
Gets all repos that aren't subscribed to for the given resource.

Parameters:
resourceId -
Returns:
the list of available repos for the given resource

findPackageVersionsInRepo

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

Parameters:
subject - user asking to perform this
repoId - identifies the repo
pc - pagination controls
Returns:
the package versions that are available in the repo

findPackageVersionsInRepo

PageList<PackageVersion> findPackageVersionsInRepo(Subject subject,
                                                   int repoId,
                                                   java.lang.String filter,
                                                   PageControl pc)
See Also:
RepoManagerRemote.findPackageVersionsInRepo(Subject, int, String, PageControl)

calculateSyncStatus

java.lang.String calculateSyncStatus(Subject subject,
                                     int repoId)
Get the overall sync status of this Repository. This is a summation of all the syncs. There is a weight to the status since this returns the most 'relevant' status: 1) ContentSourceSyncStatus.FAILURE 2) ContentSourceSyncStatus.INPROGRESS 3) ContentSourceSyncStatus.SUCCESS

Parameters:
subject - caller
repoId - to calc status for
Returns:
String summary of the status of this Repository

addContentSourcesToRepo

void addContentSourcesToRepo(Subject subject,
                             int repoId,
                             int[] contentSourceIds)
                             throws java.lang.Exception
Throws:
java.lang.Exception

removeContentSourcesFromRepo

void removeContentSourcesFromRepo(Subject subject,
                                  int repoId,
                                  int[] contentSourceIds)
                                  throws RepoException
Throws:
RepoException

getPackageVersionCountFromRepo

long getPackageVersionCountFromRepo(Subject subject,
                                    int repoId)

addRepoRelationship

void addRepoRelationship(Subject subject,
                         int repoId,
                         int relatedRepoId,
                         java.lang.String relationshipTypeName)
Creates a relationship between two repos. The relationship will be marked as being the specified type. For relationships where the order matters, think of the repoId as being the source of the relationship and relatedRepoId as being the destination or target of it.

Parameters:
subject - user making the relationship
repoId - must reference a valid repo in the system the user has permissions to access
relatedRepoId - must reference a valid repo in the system the user has permissions to access
relationshipTypeName - must identify an existing relationship in the database

createCandidateRepo

Repo createCandidateRepo(Subject subject,
                         Repo repo)
                         throws RepoException
Functions similar to RepoManagerRemote.createRepo(Subject, Repo) except that it will ensure the candidate bit on the repo parameter is correctly set.

Parameters:
subject - user creating the repo
repo - repo data to create
Returns:
persisted repo (ID will be populated)
Throws:
RepoException - if the repo contains invalid data

deleteCandidatesWithOnlyContentSource

void deleteCandidatesWithOnlyContentSource(Subject subject,
                                           int contentSourceId)
Removes candidate repos whose only content source is the indicated content source.

Parameters:
subject - user performing the delete
contentSourceId - identifies the content source

processRepoImportReport

void processRepoImportReport(Subject subject,
                             RepoImportReport report,
                             int contentSourceId,
                             java.lang.StringBuilder result)
Handles a repo report from a content provider, adding and removing candidate repos as necessary into the database.

Parameters:
subject - user triggering the report processing
report - cannot be null
contentSourceId - identifies the content source that
result - buffer used to store the results of dealing with the report

importCandidateRepo

void importCandidateRepo(Subject subject,
                         java.util.List<java.lang.Integer> repoIds)
                         throws RepoException
Changes the specified repos from being candidates in the system into full blown repositories, allowing their packages to be syncced and resources to subscribe to them.

Parameters:
subject - user performing the import
repoIds - the repos being imported; they must refer to repos in the database and must be flagged as candidates (i.e. an error will occur if an already imported repo is specified)
Throws:
RepoException - if one or more of the repo IDs does not exist in the DB or is not a candidate

addPackageVersionsToRepo

void addPackageVersionsToRepo(Subject subject,
                              int repoId,
                              int[] packageVersionIds)
See Also:
RepoManagerRemote.addPackageVersionsToRepo(Subject, int, int[])

createRepo

Repo createRepo(Subject subject,
                Repo repo)
                throws RepoException
Throws:
RepoException
See Also:
RepoManagerRemote.createRepo(Subject, Repo)

deleteRepo

void deleteRepo(Subject subject,
                int repoId)
See Also:
RepoManagerRemote.deleteRepo(Subject, int)

createRepoGroup

RepoGroup createRepoGroup(Subject subject,
                          RepoGroup repoGroup)
                          throws RepoException
Throws:
RepoException
See Also:
RepoManagerRemote.createRepoGroup(Subject, RepoGroup)

deleteRepoGroup

void deleteRepoGroup(Subject subject,
                     int repoGroupId)
See Also:
RepoManagerRemote.deleteRepoGroup(Subject, int)

getRepo

Repo getRepo(Subject subject,
             int repoId)
See Also:
RepoManagerRemote.getRepo(Subject, int)

getRepoGroup

RepoGroup getRepoGroup(Subject subject,
                       int repoGroupId)
See Also:
RepoManagerRemote.getRepoGroup(Subject, int)

getRepoGroupTypeByName

RepoGroupType getRepoGroupTypeByName(Subject subject,
                                     java.lang.String name)
See Also:
RepoManagerRemote.getRepoGroupTypeByName(Subject, String)

getRepoByName

java.util.List<Repo> getRepoByName(java.lang.String name)
Returns all repos that match the given name. The returned list should only be of size 0 or 1.

Parameters:
name - name of the repo to match
Returns:
list of matching repos; presumably of size 0 or 1

getRepoGroupByName

RepoGroup getRepoGroupByName(java.lang.String name)
Returns the repo group with the given name if it exists.

Parameters:
name - name of the repo group to match
Returns:
repo group with the given name; null if one does not

findReposByCriteria

PageList<Repo> findReposByCriteria(Subject subject,
                                   RepoCriteria criteria)
See Also:
RepoManagerRemote.findPackageVersionsInRepoByCriteria(Subject, PackageVersionCriteria)

findPackageVersionsInRepoByCriteria

PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject,
                                                             PackageVersionCriteria criteria)
See Also:
RepoManagerRemote.findPackageVersionsInRepo(Subject, int, String, PageControl)

subscribeResourceToRepos

void subscribeResourceToRepos(Subject subject,
                              int resourceId,
                              int[] repoIds)
See Also:
RepoManagerRemote.subscribeResourceToRepos(Subject, int, int[])

unsubscribeResourceFromRepos

void unsubscribeResourceFromRepos(Subject subject,
                                  int resourceId,
                                  int[] repoIds)
See Also:
RepoManagerRemote.unsubscribeResourceFromRepos(Subject, int, int[])

findSubscribedResources

PageList<Resource> findSubscribedResources(Subject subject,
                                           int repoId,
                                           PageControl pc)
See Also:
RepoManagerRemote.findSubscribedResources(Subject, int, PageControl)

updateRepo

Repo updateRepo(Subject subject,
                Repo repo)
                throws RepoException
Throws:
RepoException
See Also:
RepoManagerRemote.updateRepo(Subject, Repo)

findAssociatedDistributions

PageList<Distribution> findAssociatedDistributions(Subject subject,
                                                   int repoid,
                                                   PageControl pc)
See Also:
RepoManagerRemote.findAssociatedDistributions(Subject, int, PageControl)

synchronizeRepos

int synchronizeRepos(Subject subject,
                     java.lang.Integer[] repoIds)
Syncronize the content associated with the repoIds passed in.

Parameters:
repoIds - to syncronize
Returns:
count of the number of repositories synced.


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