Package org.rhq.core.domain.resource.group

Examples of org.rhq.core.domain.resource.group.ClusterKey$Node


        for (Integer member : members) {
            memberNodes.add(ResourceTreeModelUIBean.load(member.intValue(), resources));
        }

        ResourceGroupTreeNode root = new ResourceGroupTreeNode(group, null);
        root.setClusterKey(new ClusterKey(group.getId()));
        root.addMembers(memberNodes);
        load(root, memberNodes);
        return root;
    }
View Full Code Here


                    childGroupNode.addMember(node);
                    childGroupNode.setClusterKey(parentNode.getClusterKey());

                } else if (level instanceof ResourceFlyweight) {
                    ResourceFlyweight res = (ResourceFlyweight) level;
                    ClusterKey parentKey = parentNode.getClusterKey();
                    ClusterKey key = null;
                    if (parentKey == null) {
                        key = new ClusterKey(((ResourceGroup) parentNode.getData()).getId(), res.getResourceType()
                            .getId(), res.getResourceKey());
                    } else {
                        key = new ClusterKey(parentKey, res.getResourceType().getId(), res.getResourceKey());
                    }
                    ResourceGroupTreeNode childGroupNode = children.get(key);

                    if (childGroupNode == null) {
                        childGroupNode = new ResourceGroupTreeNode(key, parentNode);
View Full Code Here

        return null;
    }

    private boolean preopen(ResourceGroupTreeNode resourceTreeNode, CurrentSelection currentSelection, boolean setOpenState) {
        ResourceGroup currentGroup = currentSelection.resourceGroup;
        ClusterKey selectedClusterKey = currentSelection.clusterKey;
       
        boolean ret = false;
        for (ResourceGroupTreeNode child : resourceTreeNode.getChildren()) {
            if (child.getData() instanceof ClusterKey) {
                if (((ClusterKey) child.getData()).equals(selectedClusterKey)) {
View Full Code Here

        ResourceGroupTreeNode node = (ResourceGroupTreeNode) tree.getRowData(tree.getRowKey());

        if (node.getData() instanceof ResourceGroup) {
            return (currentSelection.resourceGroup.getId() == ((ResourceGroup) node.getData()).getId());
        } else if (node.getData() instanceof ClusterKey) {
            ClusterKey key = (ClusterKey) node.getData();

            if (currentSelection.clusterKey != null && currentSelection.clusterKey.equals(key)) {
                return true;
            }
        }
View Full Code Here

                            // this should not be necessary but for otherwise the top node does not always show selected
                            treeGrid.markForRedraw();
                        }

                    } else if (newNode.isAutoClusterNode()) {
                        ClusterKey key = newNode.getClusterKey();
                        Log.debug("Selecting autocluster group [" + key + "]...");
                        currentNodeId = newNode.getID();
                        // the user selected a cluster node - let's switch to that cluster group view
                        selectClusterGroup(key);
View Full Code Here

            CoreGUI.goToView(viewPath);
        }
    }

    private ResourceGroupEnhancedTreeNode loadTree(ClusterFlyweight root) {
        ClusterKey rootKey = new ClusterKey(root.getGroupId());
        ResourceGroupEnhancedTreeNode fakeRoot = new ResourceGroupEnhancedTreeNode("fakeRootNode");
        fakeRoot.setID(FAKE_ROOT_ID);

        String groupName = rootResourceGroup.getName();
        String escapedGroupName = StringUtility.escapeHtml(groupName);
        ResourceGroupEnhancedTreeNode rootNode = new ResourceGroupEnhancedTreeNode(escapedGroupName);
        rootNode.setID(rootKey.getKey());
        rootNode.setParentID(fakeRoot.getID());

        ResourceType rootResourceType = typeMap.get(rootResourceGroup.getResourceType().getId());
        rootNode.setResourceType(rootResourceType);
View Full Code Here

                for (ClusterFlyweight child : children) {
                    ResourceGroupEnhancedTreeNode node = createClusterGroupNode(parentKey, childType, child);
                    nodesByType.add(node);

                    if (!child.getChildren().isEmpty()) {
                        ClusterKey key = node.getClusterKey();
                        loadTree(node, child, key); // recurse
                    }
                }

                // Insert an autoTypeGroup node if the type is not a singleton.
View Full Code Here

            childName = MSG.group_tree_groupOfResourceType(type.getName());
        }
        ResourceGroupEnhancedTreeNode node = new ResourceGroupEnhancedTreeNode(childName);

        ClusterKeyFlyweight keyFlyweight = child.getClusterKey();
        ClusterKey key = new ClusterKey(parentKey, keyFlyweight.getResourceTypeId(), keyFlyweight.getResourceKey());
        String id = key.getKey();
        String parentId = parentKey.getKey();
        node.setID(id);
        node.setParentID(parentId);
        node.setClusterKey(key);
        node.setResourceType(type);
View Full Code Here

    public void showContextMenu(final VLayout treeView, final TreeGrid treeGrid,
        final ResourceGroupEnhancedTreeNode node) {

        if (node.isAutoClusterNode()) {
            final ClusterKey clusterKey = (ClusterKey) node.getAttributeAsObject("key");
            GWTServiceLookup.getClusterService().createAutoClusterBackingGroup(clusterKey, true,
                new AsyncCallback<ResourceGroup>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(
                            MSG.view_tree_group_error_updateAutoCluster(clusterKey.getKey()), caught);
                    }

                    @Override
                    public void onSuccess(ResourceGroup result) {
                        showContextMenu(treeView, treeGrid, node, result);
View Full Code Here

            }
          }
          continue;
        }

        Node node = (Node)inode;
        if(node.getIndex() != index) continue;
        Attribute [] attrs = inode.getAttributes();
        if(attrs == null || attrs.length < 1) {
          list.add(item);
        } else {
          String data = (String)item.getData();
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.group.ClusterKey$Node

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.