Package org.rhq.core.domain.criteria

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


        BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(subject, bd1.getId(), false);
        assertNotNull(bd1d);
        assertEquals(bd1.getId(), bd1d.getId());

        BundleDeploymentCriteria bdc = new BundleDeploymentCriteria();
        bdc.addFilterId(bd1d.getId());
        bdc.fetchBundleVersion(true);
        bdc.fetchDestination(true);
        bdc.fetchResourceDeployments(true);
        bdc.fetchTags(true);
        List<BundleDeployment> bds = bundleManager.findBundleDeploymentsByCriteria(subject, bdc);
        assertEquals(1, bds.size());
        bd1d = bds.get(0);

        assertEquals(platformResourceGroup, bd1d.getDestination().getGroup());
View Full Code Here


        deployment3.setStatus(BundleDeploymentStatus.SUCCESS);
        deployment3.setReplacedBundleDeploymentId(deployment2.getId());
        em.merge(deployment3);
        getTransactionManager().commit();

        BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
        criteria.addFilterBundleId(b1.getId());
        List<BundleDeployment> deployments = bundleManager.findBundleDeploymentsByCriteria(
            subjectManager.getOverlord(), criteria);
        assertNotNull("List of bundle deployments should not be null", deployments);
        assertEquals(3, deployments.size());
View Full Code Here

        BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(overlord, bd1.getId(), false);
        assertNotNull(bd1d);
        assertEquals(bd1.getId(), bd1d.getId());

        BundleDeploymentCriteria bdc = new BundleDeploymentCriteria();
        bdc.addFilterId(bd1d.getId());
        bdc.fetchBundleVersion(true);
        bdc.fetchDestination(true);
        bdc.fetchResourceDeployments(true);
        bdc.fetchTags(true);
        List<BundleDeployment> bds = bundleManager.findBundleDeploymentsByCriteria(overlord, bdc);
        assertEquals(1, bds.size());
        bd1d = bds.get(0);

        assertEquals(platformResourceGroup, bd1d.getDestination().getGroup());
View Full Code Here

        }
    }

    private BundleDeploymentCriteria getCriteriaFromContext(JobExecutionContext context) {
        int bundleDeploymentId = context.getJobDetail().getJobDataMap().getInt(BUNDLE_DEPLOYMENT_ID_KEY);
        BundleDeploymentCriteria crit = new BundleDeploymentCriteria();
        crit.addFilterId(bundleDeploymentId);
        return crit;
    }
View Full Code Here

    }

    private String getBundleDeploymentNameImpl(Subject subject, BundleDestination bundleDestination,
        BundleVersion bundleVersion, BundleDeployment prevDeployment) {

        BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
        criteria.addFilterDestinationId(bundleDestination.getId());
        criteria.addFilterIsLive(true);
        criteria.fetchBundleVersion(true);

        List<BundleDeployment> liveDeployments = bundleManager.findBundleDeploymentsByCriteria(subject, criteria);
        BundleDeployment liveDeployment = (liveDeployments.isEmpty()) ? null : liveDeployments.get(0);

        String deploymentName;
View Full Code Here

    @Override
    @TransactionAttribute(TransactionAttributeType.NEVER)
    public void purgeBundleDestination(final Subject subject, int bundleDestinationId) throws Exception {
        // find the live bundle deployment for this destination, and get all the resource deployments for that live deployment
        BundleDeploymentCriteria bdc = new BundleDeploymentCriteria();
        bdc.addFilterDestinationId(bundleDestinationId);
        bdc.addFilterIsLive(true);
        bdc.fetchBundleVersion(true);
        bdc.fetchResourceDeployments(true);
        bdc.fetchDestination(true);
        bdc.fetchConfiguration(true);
        List<BundleDeployment> liveDeployments = bundleManager.findBundleDeploymentsByCriteria(subject, bdc);
        if (1 != liveDeployments.size()) {
            throw new IllegalArgumentException("No live deployment to purge is found for destinationId ["
                + bundleDestinationId + "]");
        }
View Full Code Here

    @Override
    public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId,
        String deploymentDescription, boolean isCleanDeployment) throws Exception {

        BundleDeploymentCriteria c = new BundleDeploymentCriteria();
        c.addFilterDestinationId(bundleDestinationId);
        c.addFilterIsLive(true);
        c.fetchDestination(true);
        List<BundleDeployment> liveDeployments = bundleManager.findBundleDeploymentsByCriteria(subject, c);
        if (1 != liveDeployments.size()) {
            throw new IllegalArgumentException("No live deployment found for destinationId [" + bundleDestinationId
                + "]");
        }
View Full Code Here

        rc.fetchTags(true);
        Resource resource = resourceManager.findResourcesByCriteria(subject, rc).get(0);
        resourceDeployment.setResource(resource);

        // make sure the deployment contains the info required by the schedule service
        BundleDeploymentCriteria bdc = new BundleDeploymentCriteria();
        bdc.addFilterId(resourceDeployment.getBundleDeployment().getId());
        bdc.fetchBundleVersion(true);
        bdc.fetchConfiguration(true);
        bdc.fetchDestination(true);
        BundleDeployment deployment = bundleManager.findBundleDeploymentsByCriteria(subject, bdc).get(0);

        BundleCriteria bc = new BundleCriteria();
        bc.addFilterDestinationId(deployment.getDestination().getId());
        Bundle bundle = bundleManager.findBundlesByCriteria(subject, bc).get(0);
View Full Code Here

                            latestVersion = bundleVersion;
                        }
                        selectVersionValues.put(bundleVersion.getVersion(), bundleVersion.getVersion());
                    }

                    BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
                    criteria.addFilterDestinationId(wizard.getDestination().getId());
                    criteria.addFilterIsLive(true);
                    criteria.fetchBundleVersion(true);
                    criteria.fetchConfiguration(true);
                    bundleServer.findBundleDeploymentsByCriteria(criteria, //
                        new AsyncCallback<PageList<BundleDeployment>>() {

                            public void onSuccess(PageList<BundleDeployment> result) {
                                radioGroupValues.put(LATEST_VERSION,
View Full Code Here

        if (layout == null) {
            layout = new EnhancedVLayout();
            layout.setMembersMargin(15);

            // Get the Live Deployment
            BundleDeploymentCriteria c = new BundleDeploymentCriteria();
            c.addFilterDestinationId(this.wizard.getDestination().getId());
            c.addFilterIsLive(true);
            c.fetchBundleVersion(true);
            bundleServer.findBundleDeploymentsByCriteria(c, //
                new AsyncCallback<PageList<BundleDeployment>>() {

                    public void onSuccess(PageList<BundleDeployment> liveDeployments) {
                        if (1 != liveDeployments.size()) {
                            nextPage = false;
                            String messageConcise = MSG.view_bundle_revertWizard_confirmStep_noLiveDeployment_concise();
                            String message = MSG.view_bundle_revertWizard_confirmStep_noLiveDeployment(wizard
                                .getDestination().toString());
                            wizard.getView().showMessage(message);
                            CoreGUI.getMessageCenter().notify(
                                new Message(messageConcise, message, Message.Severity.Warning));
                        }

                        wizard.setLiveDeployment(liveDeployments.get(0));
                        Integer replacedBundleDeploymentId = wizard.getLiveDeployment().getReplacedBundleDeploymentId();

                        if (null == replacedBundleDeploymentId) {
                            nextPage = false;
                            String messageConcise = MSG
                                .view_bundle_revertWizard_confirmStep_noPriorDeployment_concise();
                            String message = MSG.view_bundle_revertWizard_confirmStep_noPriorDeployment(wizard
                                .getLiveDeployment().toString(), wizard.getDestination().toString());
                            wizard.getView().showMessage(message);
                            CoreGUI.getMessageCenter().notify(
                                new Message(messageConcise, message, Message.Severity.Warning));
                        }

                        // Get the Replaced Deployment (the one we want to revert to_
                        BundleDeploymentCriteria c = new BundleDeploymentCriteria();
                        c.addFilterId(replacedBundleDeploymentId);
                        bundleServer.findBundleDeploymentsByCriteria(c, //
                            new AsyncCallback<PageList<BundleDeployment>>() {

                                public void onSuccess(PageList<BundleDeployment> replacedBundleDeployments) {
                                    if (1 != replacedBundleDeployments.size()) {
View Full Code Here

TOP

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

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.