Package org.rhq.core.domain.content

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


    }

    public String getPercentComplete() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        Integer id = FacesContextUtility.getRequiredRequestParameter("id", Integer.class);
        RepoSyncResults r = LookupUtil.getRepoManagerLocal().getMostRecentSyncResults(subject, id);
        String retval;
        if (r != null && r.getPercentComplete() != null) {
            retval = r.getPercentComplete().toString();
        } else {
            retval = "0";
        }
        return retval;
    }
View Full Code Here


        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();
        } else {
            return ContentSyncStatus.NONE.toString();
        }
    }
View Full Code Here

            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

        ContentManagerHelper helper = new ContentManagerHelper(entityManager);
        Query q = entityManager.createNamedQuery(RepoSyncResults.QUERY_GET_INPROGRESS_BY_REPO_ID);
        q.setParameter("repoId", results.getRepo().getId());

        RepoSyncResults persistedSyncResults = (RepoSyncResults) helper.persistSyncResults(q, results);
        return (null != persistedSyncResults) ? persistedSyncResults : results;
    }
View Full Code Here

    }

    // we want this in its own tx so other tx's can see it immediately, even if calling method is already in a tx
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public RepoSyncResults mergeRepoSyncResults(RepoSyncResults results) {
        RepoSyncResults retval = entityManager.merge(results);
        return retval;
    }
View Full Code Here

TOP

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

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.