Package org.rhq.core.domain.criteria

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


        });
    }

    private void checkIfDisabled(final IButton purgeButton) {
        BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
        BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
        criteria.addFilterDestinationId(destination.getId());
        criteria.addFilterIsLive(Boolean.TRUE);
        criteria.setPageControl(PageControl.getSingleRowInstance());
        bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() {
            @Override
            public void onFailure(Throwable caught) {
                purgeButton.setDisabled(false);
            }
View Full Code Here


        });
    }

    @Override
    protected BundleDeploymentCriteria getFetchCriteria(final DSRequest request) {
        BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
        criteria.fetchBundleVersion(true);

        if (request.getCriteria().getValues().containsKey(FIELD_BUNDLE_ID)) {
            criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttribute(FIELD_BUNDLE_ID)));
        }

        if (request.getCriteria().getValues().containsKey(FIELD_BUNDLE_VERSION_ID)) {
            criteria.addFilterBundleVersionId(Integer.parseInt(request.getCriteria().getAttribute(
                FIELD_BUNDLE_VERSION_ID)));
        }

        if (request.getCriteria().getValues().containsKey("bundleDestinationId")) {
            criteria
                .addFilterDestinationId(Integer.parseInt(request.getCriteria().getAttribute("bundleDestinationId")));
        }

        if (request.getCriteria().getValues().get("tagNamespace") != null) {
            criteria.addFilterTagNamespace((String) request.getCriteria().getValues().get("tagNamespace"));
        }

        if (request.getCriteria().getValues().get("tagSemantic") != null) {
            criteria.addFilterTagSemantic((String) request.getCriteria().getValues().get("tagSemantic"));
        }

        if (request.getCriteria().getValues().get("tagName") != null) {
            criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName"));
        }
        return criteria;
    }
View Full Code Here

                        processResponse(request.getRequestId(), response);
                    }
                });

            } else if (parentId.endsWith("_deployments")) {
                BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
                criteria.fetchBundleVersion(true);
                criteria.addFilterBundleId(bundleId);
                bundleService.findBundleDeploymentsByCriteria(criteria,
                        new AsyncCallback<PageList<BundleDeployment>>() {
                            public void onFailure(Throwable caught) {
                                CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
                            }

                            public void onSuccess(PageList<BundleDeployment> result) {
                                response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
                                processResponse(request.getRequestId(), response);
                            }
                        });

            } else if (parentId.endsWith("_destinations")) {
                BundleDestinationCriteria criteria = new BundleDestinationCriteria();
                criteria.addFilterBundleId(bundleId);
                criteria.fetchDeployments(true);
                bundleService.findBundleDestinationsByCriteria(criteria,
                    new AsyncCallback<PageList<BundleDestination>>() {
                        public void onFailure(Throwable caught) {
                            CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
                        }

                        public void onSuccess(PageList<BundleDestination> result) {
                            response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
                            processResponse(request.getRequestId(), response);
                        }
                    });
            } else {
                // we are at a child node under a bundle node - its an individual destination or deployment node
                BundleCriteria criteria = new BundleCriteria();
                criteria.addFilterId(bundleId);
                criteria.fetchDestinations(true);

                bundleService.findBundlesByCriteria(criteria, new AsyncCallback<PageList<Bundle>>() {
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
                        response.setStatus(DSResponse.STATUS_FAILURE);
View Full Code Here

        // no deployments.  This should be rare, or maybe impossible, but in an odd case that
        // the deployment fails and they user wants to Cancel as opposed to Finish, let's
        // clean up as best as possible.
        if ((null != getNewDeployment()) && (0 < getNewDeployment().getId())) {
            BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
            BundleDeploymentCriteria c = new BundleDeploymentCriteria();
            c.addFilterId(getNewDeployment().getId());
            c.fetchResourceDeployments(true);
            bundleServer.findBundleDeploymentsByCriteria(c, //
                new AsyncCallback<PageList<BundleDeployment>>() {
                    public void onSuccess(PageList<BundleDeployment> newDeploymentList) {
                        if (!newDeploymentList.isEmpty()) {
                            BundleDeployment newDeployment = newDeploymentList.get(0);
View Full Code Here

    @Override
    public void renderView(final ViewPath viewPath) {
        int bundleDeploymentId = Integer.parseInt(viewPath.getCurrent().getPath());

        BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
        criteria.addFilterId(bundleDeploymentId);
        criteria.fetchBundleVersion(true);
        criteria.fetchConfiguration(true);
        criteria.fetchResourceDeployments(true);
        criteria.fetchDestination(true);
        criteria.fetchTags(true);

        final BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
        bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() {
            @Override
            public void onFailure(Throwable caught) {
                getErrorHandler().handleError(MSG.view_bundle_deploy_loadFailure(), caught);
            }

            @Override
            public void onSuccess(PageList<BundleDeployment> result) {
                final BundleDeployment deployment = result.get(0);
                BundleCriteria bundleCriteria = new BundleCriteria();
                bundleCriteria.addFilterId(deployment.getBundleVersion().getBundle().getId());
                bundleService.findBundlesByCriteria(bundleCriteria, new AsyncCallback<PageList<Bundle>>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        getErrorHandler().handleError(MSG.view_bundle_deploy_loadBundleFailure(), caught);
                    }

                    @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

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.