Package org.rhq.core.domain.criteria

Examples of org.rhq.core.domain.criteria.RepoCriteria


       
        when(repoManager.findReposByCriteria(any(Subject.class), any(RepoCriteria.class))).then(
            new Answer<List<Repo>>() {
                @Override
                public List<Repo> answer(InvocationOnMock invocation) throws Throwable {
                    RepoCriteria crit = (RepoCriteria) invocation.getArguments()[1];

                    //this is so wrong...
                    Field f = RepoCriteria.class.getDeclaredField("filterName");
                    f.setAccessible(true);
                    String name = (String) f.get(crit);
View Full Code Here


        });
    }

    @Override
    protected RepoCriteria getFetchCriteria(final DSRequest request) {
        RepoCriteria criteria = new RepoCriteria();
        return criteria;
    }
View Full Code Here

                // Test
                repoManager.addRepoRelationship(overlord, repo.getId(), relatedRepo.getId(), relationshipTypeName);

                // Verify
                RepoCriteria repoCriteria = new RepoCriteria();
                repoCriteria.fetchRepoRepoGroups(true);
                repoCriteria.addFilterId(repo.getId());

                PageList<Repo> repoPageList = repoManager.findReposByCriteria(overlord, repoCriteria);
                assert repoPageList.size() == 1;

                Repo persistedRepo = repoPageList.get(0);
View Full Code Here

                candidateRepo.setCandidate(true);
                candidateRepo.addContentSource(contentSource);
                candidateRepo = repoManager.createRepo(overlord, candidateRepo);

                // Test
                RepoCriteria criteria = new RepoCriteria();
                criteria.addFilterCandidate(true);
                criteria.addFilterContentSourceIds(contentSource.getId());
                criteria.fetchRepoContentSources(true);

                PageList<Repo> foundRepos = repoManager.findReposByCriteria(overlord, criteria);

                // Verify
View Full Code Here

                List<Integer> repoIds = new ArrayList<Integer>(1);
                repoIds.add(created.getId());
                repoManager.importCandidateRepo(overlord, repoIds);

                // Verify
                RepoCriteria repoCriteria = new RepoCriteria();
                repoCriteria.addFilterId(created.getId());

                PageList<Repo> repoList = repoManager.findReposByCriteria(overlord, repoCriteria);
                assert repoList.size() == 1;

                Repo verify = repoList.get(0);
View Full Code Here

                // Test
                repo.setName(newName);
                repoManager.updateRepo(overlord, repo);

                // Verify
                RepoCriteria byName = new RepoCriteria();
                byName.addFilterName(newName);
                PageList<Repo> reposWithNewName = repoManager.findReposByCriteria(overlord, byName);

                assert reposWithNewName.size() == 1;

                byName = new RepoCriteria();
                byName.addFilterName(oldName);
                PageList<Repo> reposWithOldName = repoManager.findReposByCriteria(overlord, byName);

                assert reposWithOldName.size() == 0;
            }
        });
View Full Code Here

    }

    private void syncImportedRepos(ContentSource contentSource) throws InterruptedException {
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        final Subject overlord = subjectManager.getOverlord();
        final RepoCriteria repoCriteria = new RepoCriteria();
        repoCriteria.addFilterContentSourceIds(contentSource.getId());
        repoCriteria.addFilterCandidate(false);

        final RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();

        //Use CriteriaQuery to automatically chunk/page through criteria query results
        CriteriaQueryExecutor<Repo, RepoCriteria> queryExecutor = new CriteriaQueryExecutor<Repo, RepoCriteria>() {
View Full Code Here

            //
            // Following same sort of workaround done in ContentProviderManager for synchronizeContentProvider
            // Assume this will need to be updated when we place syncing in repo layer
            //
            final RepoCriteria reposForContentSource = new RepoCriteria();
            reposForContentSource.addFilterContentSourceIds(contentSourceId);
            reposForContentSource.addFilterCandidate(false); // Don't sync distributions for candidates

            final Subject overlord = LookupUtil.getSubjectManager().getOverlord();
            //Use CriteriaQuery to automatically chunk/page through criteria query results
            CriteriaQueryExecutor<Repo, RepoCriteria> queryExecutor = new CriteriaQueryExecutor<Repo, RepoCriteria>() {
                @Override
View Full Code Here

        }

        // Hold on to all current candidate repos for the content source. If any were not present in this
        // report, remove them from the system (the rationale being, the content source no longer knows
        // about them and thus they cannot be imported).
        RepoCriteria candidateReposCriteria = new RepoCriteria();
        candidateReposCriteria.addFilterContentSourceIds(contentSourceId);
        candidateReposCriteria.addFilterCandidate(true);
        candidateReposCriteria.clearPaging();//disable paging as the code assumes all the results will be returned.

        PageList<Repo> candidatesForThisProvider = findReposByCriteria(subject, candidateReposCriteria);

        // Once the groups are in the system, import any repos that were added
        List<RepoDetails> repos = report.getRepos();
View Full Code Here

            } else {
                ret = ret.replace("$packageName", "unknown script with package id " + config.packageId);
                ret = ret.replace("$packageVersion", "no version");
            }

            RepoCriteria criteria = new RepoCriteria();
            criteria.addFilterId(config.repoId);
            criteria.clearPaging();//disable paging as the code assumes all the results will be returned.

            List<Repo> repos = rm.findReposByCriteria(overlord, criteria);

            String repoName;
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.criteria.RepoCriteria

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.