Package org.rhq.core.domain.content

Examples of org.rhq.core.domain.content.Repo


        return true;
    }

    private void removeRepoFromList(String repoName, List<Repo> repoList) {
        Repo deleteMe = null;
        for (Repo checkMe : repoList) {
            if (checkMe.getName().equals(repoName)) {
                deleteMe = checkMe;
                break;
            }
View Full Code Here


        return (Long) countQuery.getSingleResult();
    }

    public String calculateSyncStatus(Subject subject, int repoId) {
        Repo found = this.getRepo(subject, repoId);
        List<RepoSyncResults> syncResults = found.getSyncResults();
        // Add the most recent sync results status
        int latestIndex = syncResults.size() - 1;
        if (!syncResults.isEmpty() && syncResults.get(latestIndex) != null) {
            RepoSyncResults results = syncResults.get(latestIndex);
            return results.getStatus().toString();
View Full Code Here

        }
    }

    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public RepoSyncResults getMostRecentSyncResults(Subject subject, int repoId) {
        Repo found = this.getRepo(subject, repoId);
        List<RepoSyncResults> syncResults = found.getSyncResults();

        int latestIndex = syncResults.size() - 1;
        if (syncResults != null && (!syncResults.isEmpty()) && syncResults.get(latestIndex) != null) {
            return syncResults.get(latestIndex);
        } else {
View Full Code Here

        ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();

        for (int id : repoIds) {
            try {
                Repo repo = getRepo(subject, id);
                pc.syncRepoNow(repo);
                syncCount++;
            } catch (SchedulerException e) {
                log.error("Error synchronizing repo with id [" + id + "]", e);
            }
View Full Code Here

            pc = ContentManagerHelper.getPluginContainer();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        Repo repo = this.getRepo(subject, repoId);
        try {
            pc.cancelRepoSync(subject, repo);

        } catch (SchedulerException e) {
            throw new ContentException(e);
        }
        RepoSyncResults results = this.getMostRecentSyncResults(subject, repo.getId());
        results.setStatus(ContentSyncStatus.CANCELLING);
        repoManager.mergeRepoSyncResults(results);
    }
View Full Code Here

        List<RepoComposite> repos = repoManager.findResourceSubscriptions(resource.getId());

        SelectItem[] items = new SelectItem[repos.size()];
        int itemCounter = 0;
        for (RepoComposite repoComposite : repos) {
            Repo repo = repoComposite.getRepo();
            SelectItem item = new SelectItem(repo.getId(), repo.getName());
            items[itemCounter++] = item;
        }

        return items;
    }
View Full Code Here

        List<RepoComposite> repos = repoManager.findAvailableResourceSubscriptions(resource.getId());

        SelectItem[] items = new SelectItem[repos.size()];
        int itemCounter = 0;
        for (RepoComposite repoComposite : repos) {
            Repo repo = repoComposite.getRepo();
            SelectItem item = new SelectItem(repo.getId(), repo.getName());
            items[itemCounter++] = item;
        }

        return items;
    }
View Full Code Here

            // new repo
            subscribedRepoId = repoId;
        } else if (repoOption.equals(REPO_OPTION_NEW)) {
            RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();

            Repo newRepo = new Repo(newRepoName);
            newRepo.setCandidate(false);
            newRepo = repoManager.createRepo(subject, newRepo);

            repoId = Integer.toString(newRepo.getId());

            repoManager.subscribeResourceToRepos(subject, resourceId, new int[] { newRepo.getId() });

            // Change the subscribedRepoId so if we fall back to the page with a different error,
            // the drop down for selecting an existing subscribed repo will be populated with this
            // new repo
            subscribedRepoId = repoId;
View Full Code Here

            Map<Repo, Map<String, Distribution>> reposDistributions = getAllDistributions(); // RHQ distros

            CobblerConnection conn = getConnection();

            for (Map.Entry<Repo, Map<String, Distribution>> repoEntry : reposDistributions.entrySet()) {
                Repo repo = repoEntry.getKey();
                String repoName = repo.getName();

                for (Distribution distribution : repoEntry.getValue().values()) {

                    Distro existingCobblerDistro = cobblerDistros.get(distribution.getLabel());
                    Distro desiredCobblerDistro = instantiateCobblerDistro(conn, distribution, repoName, rootUrl);
View Full Code Here

            // Create the repo to be synced
            List<Repo> repos = repoManager.getRepoByName(TestContentProvider.REPO_WITH_PACKAGES);
            if (!repos.isEmpty()) {
                repoToSync = repos.get(0);
            } else {
                Repo repo = new Repo(TestContentProvider.REPO_WITH_PACKAGES);
                repo.addContentSource(cs1);
                //        repo.addContentSource(cs2);  Disabled until we implement a second test content source to return new stuff
                repoToSync = repoManager.createRepo(overlord, repo);
            }

            tx.commit();
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.content.Repo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.