Package org.rhq.core.domain.criteria

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


        bd1d = bds.get(0);

        assertEquals(platformResourceGroup, bd1d.getDestination().getGroup());
        assertEquals(dest1.getId(), bd1d.getDestination().getId());

        BundleResourceDeploymentCriteria c = new BundleResourceDeploymentCriteria();
        c.addFilterBundleDeploymentId(bd1d.getId());
        c.fetchBundleDeployment(true);
        c.fetchHistories(true);
        c.fetchResource(true);
        List<BundleResourceDeployment> brds = bundleManager.findBundleResourceDeploymentsByCriteria(overlord, c);
        assertEquals(1, brds.size());
        assertEquals(1, bd1d.getResourceDeployments().size());
        assertEquals(bd1d.getResourceDeployments().get(0).getId(), brds.get(0).getId());
        BundleResourceDeployment brd = brds.get(0);
View Full Code Here


        bd1d = bds.get(0);

        assertEquals(platformResourceGroup, bd1d.getDestination().getGroup());
        assertEquals(dest1.getId(), bd1d.getDestination().getId());

        BundleResourceDeploymentCriteria c = new BundleResourceDeploymentCriteria();
        c.addFilterBundleDeploymentId(bd1d.getId());
        c.fetchBundleDeployment(true);
        c.fetchHistories(true);
        c.fetchResource(true);
        List<BundleResourceDeployment> brds = bundleManager.findBundleResourceDeploymentsByCriteria(subject, c);
        assertEquals(1, brds.size());
        assertEquals(1, bd1d.getResourceDeployments().size());
        assertEquals(bd1d.getResourceDeployments().get(0).getId(), brds.get(0).getId());
        BundleResourceDeployment brd = brds.get(0);
View Full Code Here

    public List<BundleResourceDeploymentHistory> getBundleResourceDeploymentHistories(Subject subject,
        int resourceDeploymentId) {

        // First check if this user can actually see this resource deployment
        // by calling #findBundleResourceDeploymentsByCriteria)
        BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria();
        criteria.addFilterId(resourceDeploymentId);
        criteria.fetchHistories(true);
        criteria.setPageControl(PageControl.getSingleRowInstance());
        PageList<BundleResourceDeployment> bundleResourceDeploymentsByCriteria = findBundleResourceDeploymentsByCriteria(
            subject, criteria);

        if (bundleResourceDeploymentsByCriteria.isEmpty()) {
            return Collections.emptyList();
View Full Code Here

        // we need to obtain the resources for all resource deployments - our first criteria can't fetch this deep, we have to do another query.
        List<Integer> resourceDeployIds = new ArrayList<Integer>();
        for (BundleResourceDeployment resourceDeploy : resourceDeploys) {
            resourceDeployIds.add(resourceDeploy.getId());
        }
        final BundleResourceDeploymentCriteria brdc = new BundleResourceDeploymentCriteria();
        brdc.addFilterIds(resourceDeployIds.toArray(new Integer[resourceDeployIds.size()]));
        brdc.fetchResource(true);

        //Use CriteriaQuery to automatically chunk/page through criteria query results
        CriteriaQueryExecutor<BundleResourceDeployment, BundleResourceDeploymentCriteria> queryExecutor = new CriteriaQueryExecutor<BundleResourceDeployment, BundleResourceDeploymentCriteria>() {
            @Override
            public PageList<BundleResourceDeployment> execute(BundleResourceDeploymentCriteria criteria) {
View Full Code Here

    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public BundleScheduleRequest getScheduleRequest(Subject subject, int resourceDeploymentId,
        boolean isCleanDeployment, boolean isRevert) throws Exception {

        // make sure the deployment contains the info required by the schedule service
        BundleResourceDeploymentCriteria brdc = new BundleResourceDeploymentCriteria();
        brdc.addFilterId(resourceDeploymentId);
        brdc.fetchResource(true);
        brdc.fetchBundleDeployment(true);
        List<BundleResourceDeployment> resourceDeployments = bundleManager.findBundleResourceDeploymentsByCriteria(
            subject, brdc);
        if (null == resourceDeployments || resourceDeployments.isEmpty()) {
            throw new IllegalArgumentException("Can not deploy using invalid resourceDeploymentId ["
                + resourceDeploymentId + "].");
View Full Code Here

                    @Override
                    public void onSuccess(PageList<Bundle> result) {
                        final Bundle bundle = result.get(0);
                        deployment.getBundleVersion().setBundle(bundle);
                        BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria();
                        criteria.addFilterBundleDeploymentId(deployment.getId());
                        criteria.fetchResource(true);
                        criteria.fetchBundleDeployment(true);
                        bundleService.findBundleResourceDeploymentsByCriteria(criteria,
                            new AsyncCallback<PageList<BundleResourceDeployment>>() {
                                @Override
                                public void onFailure(Throwable caught) {
                                    getErrorHandler().handleError(MSG.view_bundle_deploy_loadFailure(), caught);
View Full Code Here

            });
    }

    @Override
    protected BundleResourceDeploymentCriteria getFetchCriteria(final DSRequest request) {
        BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria();
        criteria.fetchResource(true);
        criteria.fetchBundleDeployment(true);
        criteria.fetchHistories(true);

        if (request.getCriteria().getValues().containsKey("bundleDeploymentId")) {
            criteria.addFilterBundleDeploymentId(Integer.parseInt(request.getCriteria().getAttribute(
                "bundleDeploymentId")));
        }
        return criteria;
    }
View Full Code Here

TOP

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

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.