Package org.rhq.core.domain.content

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


                RepoGroupType groupType = new RepoGroupType("testCreateDeleteRepoGroupType");
                entityManager.persist(groupType);
                entityManager.flush();

                String groupName = "testCreateDeleteRepoGroup";
                RepoGroup group = repoManager.getRepoGroupByName(groupName);
                assert group == null;

                // Test
                group = new RepoGroup(groupName);
                group.setRepoGroupType(groupType);
                group = repoManager.createRepoGroup(overlord, group);

                // Verify
                int id = group.getId();
                group = repoManager.getRepoGroup(overlord, id);
                assert group != null;
                assert group.getName().equals(groupName);

                // Cleanup
                repoManager.deleteRepoGroup(overlord, id);
                group = repoManager.getRepoGroup(overlord, id);
                assert group == null;
View Full Code Here


                entityManager.persist(groupType);
                entityManager.flush();

                String groupName = "testCreateDuplicateRepoGroup";

                RepoGroup existing = new RepoGroup(groupName);
                existing.setRepoGroupType(groupType);
                repoManager.createRepoGroup(overlord, existing);

                existing = repoManager.getRepoGroupByName(groupName);
                assert existing != null;

                // Test
                RepoGroup duplicate = new RepoGroup(groupName);
                duplicate.setRepoGroupType(groupType);

                try {
                    repoManager.createRepoGroup(overlord, existing);
                    assert false;
                } catch (RepoException e) {
View Full Code Here

    public void getRepoGroupByNameNoGroup() throws Exception {
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {

                RepoGroup group = repoManager.getRepoGroupByName("foo");

                assert group == null;
            }
        });
    }
View Full Code Here

        contentSourceManager.purgeOrphanedPackageVersions(subjectManager.getOverlord());
    }

    @RequiredPermission(Permission.MANAGE_REPOSITORIES)
    public void deleteRepoGroup(Subject subject, int repoGroupId) {
        RepoGroup deleteMe = getRepoGroup(subject, repoGroupId);
        entityManager.remove(deleteMe);
    }
View Full Code Here

        return repo;
    }

    @RequiredPermission(Permission.MANAGE_REPOSITORIES)
    public RepoGroup getRepoGroup(Subject subject, int repoGroupId) {
        RepoGroup repoGroup = entityManager.find(RepoGroup.class, repoGroupId);
        return repoGroup;
    }
View Full Code Here

        List<RepoGroupDetails> importedRepoGroups = new ArrayList<RepoGroupDetails>();
        for (RepoGroupDetails createMe : repoGroups) {
            String name = createMe.getName();

            RepoGroup existingGroup = getRepoGroupByName(name);
            if (existingGroup == null) {
                existingGroup = new RepoGroup(name);
                existingGroup.setDescription(createMe.getDescription());

                RepoGroupType groupType = getRepoGroupTypeByName(subject, createMe.getTypeName());
                existingGroup.setRepoGroupType(groupType);

                // Don't let the whole report blow up if one of these fails,
                // but be sure to mention it in the report.
                try {
                    createRepoGroup(subject, existingGroup);
View Full Code Here

    private void validateRepoGroup(RepoGroup repoGroup) throws RepoException {
        if (repoGroup.getName() == null || repoGroup.getName().trim().equals("")) {
            throw new RepoException("Repo group name is required");
        }

        RepoGroup existingRepoGroup = getRepoGroupByName(repoGroup.getName());
        if (existingRepoGroup != null) {
            RepoException e = new RepoException("There is already a repo group with the name [" + repoGroup.getName()
                + "]");
            e.setType(RepoException.RepoExceptionType.NAME_ALREADY_EXISTS);
            throw e;
View Full Code Here

        addMe.setCandidate(!autoImport);
        addMe.setDescription(createMe.getDescription());

        String createMeGroup = createMe.getRepoGroup();
        if (createMeGroup != null) {
            RepoGroup group = getRepoGroupByName(createMeGroup);
            addMe.addRepoGroup(group);
        }

        // Add the new candidate to the database
        addMe = createRepo(overlord, addMe);
View Full Code Here

            boolean completed = pluginService.getContentProviderManager()
                .synchronizeContentProvider(syncSource.getId());
            assert completed;

            // Verify RepoGroups
            RepoGroup repoGroup = repoManager.getRepoGroupByName("testRepoGroup");
            assert repoGroup != null;
            repoGroupsToDelete.add(repoGroup.getId());

            // Verify Repos
            // --------------------------------------------
            List<Repo> retrievedRepos;
View Full Code Here

TOP

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

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.