Package org.rhq.core.domain.criteria

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


                            });
                    }
                });

        } else if (request.getCriteria().getValues().containsKey("resourceGroupId")) {
            ResourceGroupCriteria rgCriteria = new ResourceGroupCriteria();
            rgCriteria.addFilterId(request.getCriteria().getAttributeAsInt("resourceGroupId"));
            rgCriteria.fetchResourceType(true);

            GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(rgCriteria,
                new AsyncCallback<PageList<ResourceGroup>>() {
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(MSG.dataSource_schedules_loadFailed(), caught);
View Full Code Here


        LargeGroupEnvironment lgeWithTypes = null;
        env.add(createLargeGroupWithNormalUserRoleAccessWithInventoryStatus(lgeWithTypes, gac.total, gac.down,
                gac.unknown, gac.disabled, gac.uncommitted, Permission.CONFIGURE_READ));

        ResourceGroupCriteria criteria;
        PageList<ResourceGroupComposite> pageList;
        long start;

        // test findResourceGroupCompositesByCriteria where the criteria will use the search bar feature
        SessionTestHelper.simulateLogin(env.get(0).normalSubject);
        criteria = new ResourceGroupCriteria();
        criteria.setSearchExpression(searchExpression);
        start = System.currentTimeMillis();
        pageList = groupManager.findResourceGroupCompositesByCriteria(env.get(0).normalSubject, criteria);
        System.out.println("criteria with search==>" + (System.currentTimeMillis() - start) + "ms");
        return pageList;
    }
View Full Code Here

            env.add(createLargeGroupWithNormalUserRoleAccessWithInventoryStatus(lgeWithTypes, gac.total, gac.down,
                gac.unknown, gac.disabled, gac.uncommitted, Permission.CONFIGURE_READ));
            lgeWithTypes = env.get(0);
        }

        ResourceGroupCriteria criteria;
        PageList<ResourceGroupComposite> pageList;
        ResourceGroupComposite groupComp;
        long start;

        // test findResourceGroupCompositesByCriteria
        for (int i = 0; i < groupAvailCounts.size(); i++) {
            LargeGroupEnvironment lge = env.get(i);
            GroupAvailCounts gac = groupAvailCounts.get(i);

            SessionTestHelper.simulateLogin(lge.normalSubject);
            criteria = new ResourceGroupCriteria();
            start = System.currentTimeMillis();
            pageList = groupManager.findResourceGroupCompositesByCriteria(lge.normalSubject, criteria);
            System.out.println("findResourceGroupCompositesByCriteria #" + i + "==>"
                + (System.currentTimeMillis() - start) + "ms");
            assert pageList.size() == 1 : "the query should only have selected the one group for our user";
View Full Code Here

        final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
        final Configuration portletConfig = storedPortlet.getConfiguration();

        //populate composite data
        //locate resourceGroupRef
        ResourceGroupCriteria criteria = new ResourceGroupCriteria();
        criteria.addFilterId(this.groupId);
        criteria.fetchConfigurationUpdates(false);
        criteria.fetchExplicitResources(false);
        criteria.fetchGroupDefinition(false);
        criteria.fetchOperationHistories(false);

        // for autoclusters and autogroups we need to add more criteria
        final boolean isAutoCluster = isAutoCluster();
        final boolean isAutoGroup = isAutoGroup();
        if (isAutoCluster) {
            criteria.addFilterVisible(false);
        } else if (isAutoGroup) {
            criteria.addFilterVisible(false);
            criteria.addFilterPrivate(true);
        }

        //locate the resource group
        GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
            new AsyncCallback<PageList<ResourceGroupComposite>>() {
View Full Code Here

                    if (groupIds.isEmpty()) {
                        callback.onSuccess(new Favorites(resources, new PageList<ResourceGroupComposite>()));
                        return;
                    }

                    ResourceGroupCriteria criteria = new ResourceGroupCriteria();
                    criteria.addFilterIds(groupIds.toArray(new Integer[groupIds.size()]));
                    GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
                        new AsyncCallback<PageList<ResourceGroupComposite>>() {
                            public void onFailure(Throwable caught) {
                                callback.onFailure(caught);
                            }
View Full Code Here

                }
            }
        });
        toolStrip.addMember(saveButton);

        ResourceGroupCriteria c = new ResourceGroupCriteria();
        c.addFilterId(this.resourceGroupId);
        c.fetchExplicitResources(true);
        c.fetchResourceType(true);
        GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(c,
            new AsyncCallback<PageList<ResourceGroup>>() {
                public void onFailure(Throwable caught) {
                    CoreGUI.getErrorHandler().handleError(MSG.view_group_membership_failFetch(), caught);
                }
View Full Code Here

        PropertySimple property = portletConfig.getSimple(Constant.RESULT_COUNT);
        String currentSetting = property.getStringValue();
        final int resultCountFinal = (currentSetting.trim().isEmpty() || currentSetting.equalsIgnoreCase("5")) ? 5: Integer.valueOf(currentSetting);

        //locate resourceGroupRef
        ResourceGroupCriteria criteria = new ResourceGroupCriteria();
        criteria.addFilterId(groupId);
        criteria.fetchConfigurationUpdates(false);
        criteria.fetchExplicitResources(false);
        criteria.fetchGroupDefinition(false);
        criteria.fetchOperationHistories(false);

        // for autoclusters and autogroups we need to add more criteria
        final boolean isAutoCluster = isAutoCluster();
        final boolean isAutoGroup = isAutoGroup();
        if (isAutoCluster) {
            criteria.addFilterVisible(false);
        } else if (isAutoGroup) {
            criteria.addFilterVisible(false);
            criteria.addFilterPrivate(true);
        }

        //locate the resource group
        GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
                new AsyncCallback<PageList<ResourceGroupComposite>>() {
View Full Code Here

            }
        }
    }

    public void testAddResorceToGroup() {
        ResourceGroupCriteria criteria = new ResourceGroupCriteria();
        criteria.addFilterId(newGroup.getId());
        criteria.fetchExplicitResources(true);
        PageList<ResourceGroup> persistedGroups = groupManager.findResourceGroupsByCriteria(getOverlord(), criteria);
        assertEquals("There should be just one group with id " + newGroup.getId(), 1,
            persistedGroups.size());

        // equals is based on the name of a group
View Full Code Here

            .size());
    }

    public void testResourceUninventorization() {
        // partly a regression test for BZ 878117
        ResourceGroupCriteria criteria = new ResourceGroupCriteria();
        criteria.addFilterId(newGroup.getId());
        criteria.fetchExplicitResources(true);
        PageList<ResourceGroup> persistedGroups = groupManager.findResourceGroupsByCriteria(getOverlord(), criteria);
        assertEquals("There should be just one group with id " + newGroup.getId(), 1,
            persistedGroups.size());
        assertEquals("An empty group is considered as MIXED.", GroupCategory.MIXED, persistedGroups.get(0)
            .getGroupCategory());
View Full Code Here

            });
    }

    protected void fetchResourceType(final CountDownLatch latch, final VLayout layout) {
        //locate resourceGroupRef
        ResourceGroupCriteria criteria = new ResourceGroupCriteria();
        criteria.addFilterId(context.getGroupId());
        // for autoclusters and autogroups we need to add more criteria
        if (context.isAutoCluster()) {
            criteria.addFilterVisible(false);
        } else if (context.isAutoGroup()) {
            criteria.addFilterVisible(false);
            criteria.addFilterPrivate(true);
        }

        criteria.fetchConfigurationUpdates(false);
        criteria.fetchExplicitResources(false);
        criteria.fetchGroupDefinition(false);
        criteria.fetchOperationHistories(false);

        //locate the resource group
        GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
            new AsyncCallback<PageList<ResourceGroupComposite>>() {
                @Override
View Full Code Here

TOP

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

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.