Package org.rhq.core.domain.criteria

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


                em.flush();

                assertTrue("The number of created storage nodes should be " + storageNodeCount + ". Was: "
                    + nodeAddresses.size(), storageNodeCount == nodeAddresses.size());

                StorageNodeCriteria criteria = new StorageNodeCriteria();
                criteria.addFilterAddress(prefix);
                // use DESC just to make sure sorting on name is different than insert order
                criteria.addSortAddress(PageOrdering.DESC);
                PageList<StorageNode> list = nodeManager.findStorageNodesByCriteria(subjectManager.getOverlord(),
                    criteria);

                assertTrue("The number of found storage nodes should be " + storageNodeCount + ". Was: " + list.size(),
                    storageNodeCount == list.size());
View Full Code Here


                em.persist(node);
                em.flush();               
                assertEquals("The cluster status should be DOWN", StorageNode.Status.DOWN, node.getStatus());
               
                // we need to do this to obtain the new id
                StorageNodeCriteria criteria = new StorageNodeCriteria();
                criteria.addFilterAddress(address);
                StorageNode node2 = nodeManager.findStorageNodeByAddress(address);
               
                nodeManager.ackFailedOperation(subjectManager.getOverlord(), node2.getId());
               
                criteria = new StorageNodeCriteria();
                criteria.addFilterAddress(address);
                StorageNode node3 = nodeManager.findStorageNodeByAddress(address);
               
                assertEquals("The error message should not affect the equals method", node, node2);
                assertEquals("The error message should not affect the equals method", node2, node3);
                assertEquals("The cluster status should be JOINING", StorageNode.Status.JOINING, node3.getStatus());
View Full Code Here

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public void deployStorageNode(Subject subject, StorageNode storageNode) {
        StorageNodeCriteria c = new StorageNodeCriteria();
        c.addFilterId(storageNode.getId());
        c.fetchResource(true);
        List<StorageNode> storageNodes = storageNodeManager.findStorageNodesByCriteria(subject, c);
        if (storageNodes.isEmpty()) {
            throw new RuntimeException("Storage node not found, can not undeploy " + storageNode);
        }
        storageNode = storageNodes.get(0);
View Full Code Here

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public void undeployStorageNode(Subject subject, StorageNode storageNode) {
        StorageNodeCriteria c = new StorageNodeCriteria();
        c.addFilterId(storageNode.getId());
        c.fetchResource(true);
        List<StorageNode> storageNodes = storageNodeManager.findStorageNodesByCriteria(subject, c);
        if (storageNodes.isEmpty()) {
            throw new RuntimeException("Storage node not found, can not undeploy " + storageNode);
        }
        storageNode = storageNodes.get(0);
View Full Code Here

                            + server.getVersion()
                            + "] Please complete the upgrade for all Servers and StorageNodes before trying to start a server.");
                }
            }

            StorageNodeCriteria snc = new StorageNodeCriteria();
            snc.clearPaging();
            List<StorageNode> storageNodes = storageNodeManager.findStorageNodesByCriteria(overlord, snc);
            for (StorageNode storageNode : storageNodes) {
                if (!version.equals(storageNode.getVersion())) {
                    throw new RuntimeException(
                        "Startup failed: Could not start Server because not all Storage Nodes are running the same version. This Server is running version ["
View Full Code Here

    protected void onInit() {
        super.onInit();
        if (alerts) {
            return;
        }
        StorageNodeCriteria criteria = new StorageNodeCriteria();
        criteria.addFilterId(storageNodeId);
        criteria.fetchResource(true);
        GWTServiceLookup.getStorageService().findStorageNodesByCriteria(criteria,
            new AsyncCallback<PageList<StorageNode>>() {
                public void onSuccess(final PageList<StorageNode> storageNodes) {
                    if (storageNodes == null || storageNodes.isEmpty() || storageNodes.size() != 1) {
                        onFailure(new Exception("No storage nodes have been found."));
View Full Code Here

        initAddresses();
    }

    private void initAddresses() {
        if (header != null && !allStorageNodes) {
            StorageNodeCriteria criteria = new StorageNodeCriteria();
            criteria.addFilterId(storageNodeId);
            GWTServiceLookup.getStorageService().findStorageNodesByCriteria(criteria,
                new AsyncCallback<PageList<StorageNode>>() {
                    public void onSuccess(final PageList<StorageNode> storageNodes) {
                        if (storageNodes == null || storageNodes.isEmpty() || storageNodes.size() != 1) {
                            Message msg = new Message(MSG.view_adminTopology_message_fetchServerFail(String
View Full Code Here

    protected StorageNodeCriteria 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
        }
        StorageNodeCriteria criteria = new StorageNodeCriteria();
        criteria.addFilterId(getFilter(request, FIELD_ID.propertyName(), Integer.class));
        criteria.addFilterAddress(getFilter(request, FILTER_ADDRESS, String.class));
        criteria.addFilterOperationMode(modesFilter);

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

        return criteria;
    }
View Full Code Here

            return MeasurementConverterClient.format(value, targetUnits, bestFit);
        }

        @Override
        protected StorageNodeCriteria getFetchCriteria(DSRequest request) {
            return new StorageNodeCriteria();
        }
View Full Code Here

TOP

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

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.