Package org.rhq.core.domain.criteria

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


                assertTrue("The number of created servers should be " + serverCount + ". Was: " + serverNames.size(),
                    serverCount == serverNames.size());

                // query the results and delete the servers
                final int pageSize = 42;
                ServerCriteria criteria = new ServerCriteria();
                criteria.addFilterName(prefix);
                criteria.addSortName(PageOrdering.DESC); // use DESC just to make sure sorting on name is different than insert order
                criteria.setPaging(0, pageSize);

                // iterate over the results with CriteriaQuery
                CriteriaQueryExecutor<Server, ServerCriteria> queryExecutor = new CriteriaQueryExecutor<Server, ServerCriteria>() {
                    @Override
                    public PageList<Server> execute(ServerCriteria criteria) {
View Full Code Here


                }
                em.flush();

                // query the results and delete the servers
                final int pageSize = 24;
                ServerCriteria criteria = new ServerCriteria();
                criteria.addFilterName(prefix);
                criteria.addFilterOperationMode(OperationMode.MAINTENANCE, OperationMode.DOWN, OperationMode.INSTALLED);
                criteria.addSortName(PageOrdering.DESC); // use DESC just to make sure sorting on name is different than insert order
                criteria.setPaging(0, pageSize);

                // iterate over the results with CriteriaQuery
                CriteriaQueryExecutor<Server, ServerCriteria> queryExecutor = new CriteriaQueryExecutor<Server, ServerCriteria>() {
                    @Override
                    public PageList<Server> execute(ServerCriteria criteria) {
View Full Code Here

                em.flush();

                // query the results and delete the servers
                final int pageSize = 2;
                final int startPage = 0;
                ServerCriteria criteria = new ServerCriteria();
                criteria.addFilterName(namePrefix + " 007");
                criteria.setStrict(true);
                criteria.setPaging(startPage, pageSize);

                // iterate over the results with CriteriaQuery
                CriteriaQueryExecutor<Server, ServerCriteria> queryExecutor = new CriteriaQueryExecutor<Server, ServerCriteria>() {
                    @Override
                    public PageList<Server> execute(ServerCriteria criteria) {
View Full Code Here

                    em.persist(server);
                    em.flush();
                }
                em.flush();

                ServerCriteria criteria = new ServerCriteria();
                criteria.addFilterName("very unlikely name of a server");
                criteria.setStrict(true);
                PageList<Server> servers = topologyManager.findServersByCriteria(overlord, criteria);
                assertNotNull("The result of topologyManager.findServersByCriteria() is null", servers);
                assertTrue("Some servers have been found, even if they shouldn't", servers.isEmpty());
               
                criteria = new ServerCriteria();
                criteria.addFilterSecurePort(1000);
                servers = topologyManager.findServersByCriteria(overlord, criteria);
                assertNotNull("The result of topologyManager.findServersByCriteria() is null", servers);
                assertTrue("Some servers have been found, even if they shouldn't", servers.isEmpty());
               
                criteria = new ServerCriteria();
                criteria.addFilterAffinityGroupId(Integer.MAX_VALUE / 2);
                servers = topologyManager.findServersByCriteria(overlord, criteria);
                assertNotNull("The result of topologyManager.findServersByCriteria() is null", servers);
                assertTrue("Some servers have been found, even if they shouldn't", servers.isEmpty());
            }
        });
View Full Code Here

                    }
                    shouldBeFoundCount -= shouldBeSkipped;
                }

                // query the results and delete the servers
                ServerCriteria criteria = new ServerCriteria();
                criteria.addFilterOperationMode(OperationMode.MAINTENANCE);
                criteria.addFilterPort(7089);
                criteria.addFilterSecurePort(7452);
                criteria.addFilterName(namePrefix);
                criteria.addFilterAddress(addressPrefix);
                criteria.addSortName(PageOrdering.DESC); // use DESC just to make sure sorting on name is different than insert order
                criteria.setPaging(startPage, pageSize);

                // iterate over the results with CriteriaQuery
                CriteriaQueryExecutor<Server, ServerCriteria> queryExecutor = new CriteriaQueryExecutor<Server, ServerCriteria>() {
                    @Override
                    public PageList<Server> execute(ServerCriteria criteria) {
View Full Code Here

    }

    protected void ackDeletedPlugins() {
        Subject overlord = LookupUtil.getSubjectManager().getOverlord();
        PluginManagerLocal pluginMgr = LookupUtil.getPluginManager();
        for(Server server : LookupUtil.getTopologyManager().findServersByCriteria(overlord, new ServerCriteria())) {
            pluginMgr.acknowledgeDeletedPluginsBy(server.getId());
        }
    }
View Full Code Here

        subjectMgr = LookupUtil.getSubjectManager();
        pluginMgr = LookupUtil.getPluginManager();
        agentMgr = LookupUtil.getAgentManager();

        TopologyManagerLocal topMgr = LookupUtil.getTopologyManager();
        Server svr = topMgr.findServersByCriteria(subjectMgr.getOverlord(), new ServerCriteria()).get(0);

        agent = new Agent();
        agent.setAddress("kachny");
        agent.setAgentToken("1234");
        agent.setName("kachny");
View Full Code Here

    private void checkCluster() {
        try {
            Subject overlord = subjectManager.getOverlord();
            String version = this.getClass().getPackage().getImplementationVersion();

            ServerCriteria sc = new ServerCriteria();
            sc.clearPaging();
            List<Server> servers = topologyManager.findServersByCriteria(overlord, sc);
            for (Server server : servers) {
                if (!version.equals(server.getVersion())) {
                    throw new RuntimeException(
                        "Startup failed: Could not start Server because not all Servers are running the same version. This Server is running version ["
View Full Code Here

    protected ServerCriteria getFetchCriteria(DSRequest request) {
        OperationMode[] modesFilter = getArrayFilter(request, FILTER_OPERATION_MODE, OperationMode.class);
        if (modesFilter == null || modesFilter.length == 0) {
            return null; // user didn't select any modes - return null to indicate no data should be displayed
        }
        ServerCriteria criteria = new ServerCriteria();
        //        printRequestCriteria(request);
        criteria.addFilterId(getFilter(request, FIELD_ID.propertyName(), Integer.class));
        criteria.addFilterName(getFilter(request, FIELD_NAME.propertyName(), String.class));
        criteria.addFilterAddress(getFilter(request, FILTER_ADDRESS, String.class));
        criteria.addFilterPort(getFilter(request, FILTER_PORT, Integer.class));
        criteria.addFilterSecurePort(getFilter(request, FILTER_SECURE_PORT, Integer.class));
        criteria.addFilterOperationMode(modesFilter);
        criteria.addFilterComputePower(getFilter(request, FILTER_COMPUTE_POWER, Integer.class));
        criteria.addFilterAffinityGroupId(getFilter(request, FILTER_AFFINITY_GROUP_ID, Integer.class));

        //@todo: Remove me when finished debugging search expression
        Log.debug(" *** ServerCriteria Search String: " + getFilter(request, "search", String.class));
        criteria.setSearchExpression(getFilter(request, "search", String.class));

        return criteria;
    }
View Full Code Here

    }

    @Override
    protected void onInit() {
        super.onInit();
        ServerCriteria criteria = new ServerCriteria();
        criteria.addFilterId(serverId);
        GWTServiceLookup.getTopologyService().findServersByCriteria(criteria, new AsyncCallback<PageList<Server>>() {
            public void onSuccess(final PageList<Server> servers) {
                if (servers == null || servers.isEmpty() || servers.size() != 1) {
                    CoreGUI.getErrorHandler().handleError(
                        MSG.view_adminTopology_message_fetchServerFail(String.valueOf(serverId)));
View Full Code Here

TOP

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

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.