Package org.rhq.enterprise.server.content

Examples of org.rhq.enterprise.server.content.RepoManagerLocal


    public void deleteSelectedPackages() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        String[] selectedPackages = FacesContextUtility.getRequest().getParameterValues("selectedPackages");
        int repoId = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));

        RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();
       
        int[] packageIds = new int[selectedPackages.length];
        for (int i = 0; i < packageIds.length; i++) {
            packageIds[i] = Integer.parseInt(selectedPackages[i]);
        }
       
        try {
            if (!repoManager.deletePackageVersionsFromRepo(subject, repoId, packageIds)) {
                FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Not all packages where deleted because some of them are provided by content sources.");
            }
           
            //force reload of the package version list
            dataModel = null;
View Full Code Here


        public PageList<PackageVersion> fetchPage(PageControl pc) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            int id = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));
            RepoPackageVersionsUIBean.this.init();

            RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();

            PageList<PackageVersion> results;
            results = manager.findPackageVersionsInRepo(subject, id, getPackageFilter(), pc);
            return results;
        }
View Full Code Here

        int repoId = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));
        int[] contentSourceIds = getIntegerArray(selected);

        if ((contentSourceIds != null) && (contentSourceIds.length > 0)) {
            try {
                RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();
                manager.addContentSourcesToRepo(subject, repoId, contentSourceIds);

                FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Associated [" + contentSourceIds.length
                    + "] content sources with repository");
            } catch (Exception e) {
                FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR,
View Full Code Here

    public Map<Integer, Boolean> getAssociatedList() {
        if (associatedList == null) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            int id = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));
            RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();

            PageList<ContentSource> results = manager.findAssociatedContentSources(subject, id, PageControl
                .getUnlimitedInstance());
            associatedList = new HashMap<Integer, Boolean>(results.getTotalSize());
            for (ContentSource contentSource : results) {
                associatedList.put(contentSource.getId(), Boolean.TRUE);
            }
View Full Code Here

        @Override
        @SuppressWarnings("unchecked")
        public PageList<Distribution> fetchPage(PageControl pc) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            int id = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));
            RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();
            PageList<Distribution> results = manager.findAssociatedDistributions(subject, id, pc);
            return results;
        }
View Full Code Here

        return "success";
    }

    public String save() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();

        try {
            updateRepoOwner(subject);
            manager.updateRepo(subject, repo);
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "The repository has been updated.");
        } catch (ContentException ce) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Error: " + ce.getMessage());
            return "edit"; // stay in edit mode on failure
        }
View Full Code Here

        return "success";
    }

    public String cancelSync() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();
        Integer repoId = FacesContextUtility.getRequiredRequestParameter("id", Integer.class);
        try {
            manager.cancelSync(subject, repoId);
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "The synchronization has been cancelled.");
        } catch (Exception ce) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Error: " + ce.getMessage());
            return "success"; // stay in edit mode on failure
        }
View Full Code Here

    private void loadRepo() {
        if (this.repo == null) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            Integer id = FacesContextUtility.getRequiredRequestParameter("id", Integer.class);
            RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();
            this.repo = manager.getRepo(subject, id);
            this.repo.setSyncStatus(manager.calculateSyncStatus(subject, id));
            if (repo.getOwner() == null) {
                repo.setOwner(new Subject());
            }
        }
    }
View Full Code Here

        return LookupUtil.getAuthorizationManager().hasGlobalPermission(subject, Permission.MANAGE_REPOSITORIES);
    }

    public String save() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();

        try {
            updateRepoOwner(subject);
            newRepo.setCandidate(false);
            Repo created = manager.createRepo(subject, newRepo);
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Saved [" + created.getName()
                + "] with the ID of [" + created.getId() + "]");
        } catch (RepoException ce) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Error: " + ce.getMessage());
            return "failed";
View Full Code Here

        int contentSourceId = Integer.valueOf(FacesContextUtility.getRequiredRequestParameter("id"));
        int[] repoIds = getIntegerArray(selected);

        if ((repoIds != null) && (repoIds.length > 0)) {
            try {
                RepoManagerLocal manager = LookupUtil.getRepoManagerLocal();
                for (int repoId : repoIds) {
                    manager.removeContentSourcesFromRepo(subject, repoId, new int[] { contentSourceId });
                }

                FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Disassociated [" + repoIds.length
                    + "] repositories from content source");
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.content.RepoManagerLocal

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.