Package org.rhq.core.domain.criteria

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


                if (0 == numDeployments) {
                    continue;
                }

                Bundle bundle = bundleVersion.getBundle();
                BundleDestinationCriteria destinationCriteria = new BundleDestinationCriteria();
                destinationCriteria.clearPaging(); //disable paging as the code assumes all the results will be returned.
                destinationCriteria.addFilterBundleId(bundle.getId());

                // get the viewable destinations and use to filter the deployments
                List<BundleDestination> destinations = findBundleDestinationsByCriteria(subject, destinationCriteria);
                List<BundleDeployment> filteredDeployments = new ArrayList<BundleDeployment>(numDeployments);
                entityManager.detach(bundleVersion); // make sure we don't persist the filtered data
View Full Code Here


            // this works because findBundleDestinationsByCriteria() authorizes against resource group associations
            for (Bundle bundle : result) {
                if (bundle.getDestinations().isEmpty()) {
                    continue;
                }
                BundleDestinationCriteria destinationCriteria = new BundleDestinationCriteria();
                destinationCriteria.clearPaging(); //disable paging as the code assumes all the results will be returned.
                destinationCriteria.addFilterBundleId(bundle.getId());
                List<BundleDestination> destinations = findBundleDestinationsByCriteria(subject, destinationCriteria);
                entityManager.detach(bundle); // make sure the narrowed set of destinations does not get persisted
                bundle.setDestinations(destinations);
            }
        }
View Full Code Here

            });
    }

    @Override
    protected BundleDestinationCriteria getFetchCriteria(final DSRequest request) {
        BundleDestinationCriteria criteria = new BundleDestinationCriteria();

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

        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"));
        }

        criteria.fetchBundle(true);
        criteria.fetchDeployments(true);
        criteria.fetchGroup(true);
        criteria.fetchTags(true);
        return criteria;
    }
View Full Code Here

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

        BundleDestinationCriteria criteria = new BundleDestinationCriteria();
        criteria.addFilterId(bundleDestinationId);
        criteria.fetchBundle(true);
        criteria.fetchDeployments(true);
        criteria.fetchTags(true);

        BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
        bundleService.findBundleDestinationsByCriteria(criteria, new AsyncCallback<PageList<BundleDestination>>() {
            @Override
            public void onFailure(Throwable caught) {
View Full Code Here

                                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

TOP

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

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.