Package org.rhq.enterprise.server.plugin.pc.content

Examples of org.rhq.enterprise.server.plugin.pc.content.ContentServerPluginContainer


     * @return the new plugin containers created by this method
     */
    protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
        ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(5);
        pcs.add(new GenericServerPluginContainer(this));
        pcs.add(new ContentServerPluginContainer(this));
        pcs.add(new AlertServerPluginContainer(this));
        pcs.add(new BundleServerPluginContainer(this));
        pcs.add(new PackageTypeServerPluginContainer(this));
        pcs.add(new DriftServerPluginContainer(this));
        return pcs;
View Full Code Here


        log.debug("User [" + subject + "] is updating [" + repo + "]...");
        repo = entityManager.merge(repo);
        log.debug("User [" + subject + "] updated [" + repo + "].");

        try {
            ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
            pc.unscheduleRepoSyncJob(repo);
            pc.scheduleRepoSyncJob(repo);
        } catch (Exception e) {
            log.warn("Failed to reschedule repository synchronization job for [" + repo + "].", e);
        }

        return repo;
View Full Code Here

        log.info("User [" + subject + "] created [" + repo + "].");

        // If this repo is imported, schedule the repo sync job.
        if (!repo.isCandidate()) {
            try {
                ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
                pc.scheduleRepoSyncJob(repo);
            } catch (Exception e) {
                log.error("Failed to schedule repository synchronization job for [" + repo + "].", e);
                throw new RuntimeException(e);
            }
        }
View Full Code Here

        repo.setLastModifiedDate(System.currentTimeMillis());

        log.debug("User [" + subject + "] is adding content sources to repo [" + repo + "]");

        ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
        Query q = entityManager.createNamedQuery(PackageVersionContentSource.QUERY_FIND_BY_CONTENT_SOURCE_ID_NO_FETCH);

        for (int id : contentSourceIds) {
            ContentSource contentSource = entityManager.find(ContentSource.class, id);
            if (contentSource == null) {
View Full Code Here

    @RequiredPermission(Permission.MANAGE_REPOSITORIES)
    public int synchronizeRepos(Subject subject, int[] repoIds) throws Exception {
        int syncCount = 0;

        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

    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    // TEMPORARY TIMEOUT DEFINED WHILE WE PROPERLY FIGURE OUT TIMEOUTS
    @TransactionTimeout(86400)
    public int internalSynchronizeRepos(Subject subject, Integer[] repoIds) throws InterruptedException {
        ContentServerPluginContainer pc;
        try {
            pc = ContentManagerHelper.getPluginContainer();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ContentProviderManager providerManager = pc.getAdapterManager();

        int syncCount = 0;
        for (Integer id : repoIds) {
            boolean syncExecuted = providerManager.synchronizeRepo(id);
View Full Code Here

        return syncCount;
    }

    @RequiredPermission(Permission.MANAGE_REPOSITORIES)
    public void cancelSync(Subject subject, int repoId) throws ContentException {
        ContentServerPluginContainer pc;
        try {
            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());
View Full Code Here

    public ContentManagerHelper(EntityManager managerIn) {
        this.entityManager = managerIn;
    }

    public static ContentServerPluginContainer getPluginContainer() throws Exception {
        ContentServerPluginContainer pc = null;

        try {
            ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
            if (!mbean.isMasterPluginContainerStarted()) {
                throw new IllegalStateException("The master plugin container is not started!");
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugin.pc.content.ContentServerPluginContainer

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.