Package org.rhq.core.domain.criteria

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


                public void onFailure(Throwable caught) {
                    CoreGUI.getErrorHandler().handleError(MSG.view_bundle_dest_loadFailure(), caught);
                }

                public void onSuccess(final PageList<BundleDestination> result) {
                    BundleVersionCriteria versionCriteria = new BundleVersionCriteria();
                    if (request.getCriteria().getValues().containsKey(FIELD_BUNDLE_ID)) {
                        versionCriteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttributeAsString(
                            FIELD_BUNDLE_ID)));
                    }
                    GWTServiceLookup.getBundleService().findBundleVersionsByCriteria(versionCriteria,
                        new AsyncCallback<PageList<BundleVersion>>() {
                            public void onFailure(Throwable caught) {
View Full Code Here


        return form;
    }

    private void setItemValues() {
        BundleVersionCriteria criteria = new BundleVersionCriteria();
        criteria.addFilterBundleId(wizard.getBundleId());
        criteria.fetchConfigurationDefinition(true);
        bundleServer.findBundleVersionsByCriteria(criteria, //
            new AsyncCallback<PageList<BundleVersion>>() {

                public void onSuccess(PageList<BundleVersion> result) {
                    bundleVersions = result;
                    if (null == bundleVersions || bundleVersions.isEmpty()) {
                        onFailure(new IllegalArgumentException("No bundle versions defined for bundle."));
                    }

                    int highVersionOrder = -1;
                    for (BundleVersion bundleVersion : result) {
                        int versionOrder = bundleVersion.getVersionOrder();
                        if (versionOrder > highVersionOrder) {
                            highVersionOrder = versionOrder;
                            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

            prevVersionItem.setTitleAlign(Alignment.LEFT);
            prevVersionItem.setAlign(Alignment.LEFT);
            prevVersionItem.setWrap(false);
            prevVersionItem.setWrapTitle(false);
            if (prev.getBundleVersion().getVersion() == null) {
                BundleVersionCriteria c = new BundleVersionCriteria();
                c.addFilterId(prev.getBundleVersion().getId());
                bundleServer.findBundleVersionsByCriteria(c, new AsyncCallback<PageList<BundleVersion>>() {

                    @Override
                    public void onSuccess(PageList<BundleVersion> result) {
                        if (result != null && result.size() == 1) {
View Full Code Here

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

        BundleVersionCriteria criteria = new BundleVersionCriteria();
        criteria.addFilterId(bundleVersionId);
        criteria.fetchBundle(true);
        criteria.fetchBundleFiles(true);
        criteria.fetchBundleDeployments(true);
        criteria.fetchConfigurationDefinition(true);
        criteria.fetchTags(true);

        bundleManager.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() {
            @Override
            public void onFailure(Throwable caught) {
                getErrorHandler().handleError(MSG.view_bundle_version_loadFailure(), caught);
View Full Code Here

        });
    }

    @Override
    protected BundleVersionCriteria getFetchCriteria(final DSRequest request) {
        BundleVersionCriteria criteria = new BundleVersionCriteria();
        criteria.fetchBundleFiles(true);
        criteria.fetchBundle(true);

        if (request.getCriteria().getValues().get("bundleId") != null) {
            criteria.addFilterBundleId(Integer.parseInt(String.valueOf(request.getCriteria().getValues()
                .get("bundleId"))));
        }

        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

            }
            final Integer bundleId = tmp;

            // we are at an inner node, being asked to get the children of it
            if (parentId.endsWith("_versions")) {
                BundleVersionCriteria criteria = new BundleVersionCriteria();
                criteria.addFilterBundleId(bundleId);
                bundleService.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() {
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
                        response.setStatus(DSResponse.STATUS_FAILURE);
                        processResponse(request.getRequestId(), response);
                    }

                    public void onSuccess(PageList<BundleVersion> result) {
                        response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
                        response.setTotalRows(result.getTotalSize());
                        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

                handleBundleNotFoundException(new BundleNotFoundException(
                    uploadDistroForm.getCreateInitialBundleVersionToken()));

            } else {
                int bvId = uploadDistroForm.getBundleVersionId();
                BundleVersionCriteria criteria = new BundleVersionCriteria();
                criteria.addFilterId(bvId);
                criteria.fetchBundle(true);
                BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
                bundleServer.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() {
                    @Override
                    public void onSuccess(PageList<BundleVersion> result) {
                        BundleVersion bv = result.get(0);
View Full Code Here

TOP

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

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.