Package com.cxy.redisclient.domain

Examples of com.cxy.redisclient.domain.NodeType


    Set<String> nodekeys = getResult();
   
    Iterator<String> it = nodekeys.iterator();
    while (it.hasNext()) {
      String nextKey = it.next();
      NodeType valueType = getValueType(nextKey);

      if(inValueTypes(valueType)){
        Node node = new Node(id, db, nextKey, valueType, order);
        keys.add(node);
      }
View Full Code Here


  public abstract RedisVersion getSupportVersion();

  protected NodeType getValueType(String key) {
    String type = jedis.type(key);
    NodeType nodeType = null;
    if (type.equals("string"))
      nodeType = NodeType.STRING;
    else if (type.equals("hash"))
      nodeType = NodeType.HASH;
    else if (type.equals("list"))
View Full Code Here

    jedis.select(db);
    Set<String> nodekeys = jedis.keys("*");
    Iterator<String> it = nodekeys.iterator();
    while (it.hasNext()) {
      String key = (String)it.next();
      NodeType nodeType = getValueType(key);
     
      Node node = new Node(id, db, key, nodeType);
      nodes.add(node);
    }
  }
View Full Code Here

    if(!flat){
      Iterator<String> it = nodekeys.iterator();
      while (it.hasNext()) {
        String[] ckey = it.next().substring(length).split(separator);
        if (ckey.length > 1) {
          NodeType nodeType = NodeType.CONTAINER;
 
          Node node = new Node(id, db, ckey[0], nodeType, order);
          containers.add(node);
        }
      }
    }else{
      Iterator<String> it = nodekeys.iterator();
      while (it.hasNext()) {
        String ckey = it.next().substring(length);
        ContainerKey containerKey = new ContainerKey(ckey);
        String container = containerKey.getContainerOnly();
       
        if (container.length() > 0) {
          NodeType nodeType = NodeType.CONTAINER;
 
          Node node = new Node(id, db, container, nodeType, order);
          containers.add(node);
        }
      }
View Full Code Here

    Iterator<String> it = nodekeys.iterator();
    while (it.hasNext()) {
      String nextKey = it.next();
      String[] ckey = nextKey.substring(length).split(ConfigFile.getSeparator());
      if (ckey.length == 1) {
        NodeType nodeType = getValueType(nextKey);
        long size = getSize(nextKey);
        boolean persist = isPersist(nextKey);
        DataNode node;
        if(!flat)
          node = new DataNode(id, db, ckey[0], nodeType, size, persist, order, orderBy);
View Full Code Here

          if (selectedItem == rootRedisServers
              || selectedItem == null) {
            tree.setMenu(menu_null);
          } else {
            NodeType type = (NodeType) selectedItem
                .getData(NODE_TYPE);

            if (type == NodeType.ROOT) {
              tree.setMenu(menu_null);
            } else if (type == NodeType.SERVER) {
View Full Code Here

        TreeItem[] treeItems = tree.getSelection();
        Point point = new Point(e.x, e.y);
        TableItem selectedItem = table.getItem(point);

        if (selectedItem != null) {
          NodeType type = (NodeType) selectedItem.getData(NODE_TYPE);

          if (type == NodeType.CONTAINER || type == NodeType.DATABASE
              || type == NodeType.SERVER) {
            boolean find = false;
            for (TreeItem treeItem : treeItems[0].getItems()) {
              String treeText = treeItem.getText();
              String tableText = selectedItem.getText(0);

              if (treeText.equals(tableText)) {
                find = true;

                if (type == NodeType.CONTAINER
                    || type == NodeType.DATABASE)
                  dbContainerTreeItemSelected(treeItem, false);
                else if (type == NodeType.SERVER)
                  serverTreeItemSelected(treeItem, false);

                history.add(treeItem);
                btnBackward.setEnabled(true);
                btnForward.setEnabled(false);
                break;
              }
            }
            if (!find)
              MessageDialog.openInformation(shell,
                  i18nFile.getText(I18nFile.INFORMATION),
                  i18nFile.getText(I18nFile.NEWKEYFOUND)
                      + text.getText());
          } else {

            dataProperties();

          }
        }
      }

      @Override
      public void mouseDown(MouseEvent e) {
        Point point = new Point(e.x, e.y);
        TableItem selectedItem = table.getItem(point);
        if (e.button == 3) {
          if (selectedItem == null)
            table.setMenu(menu_null);
          else {
            NodeType type = (NodeType) selectedItem
                .getData(NODE_TYPE);

            if (type == NodeType.ROOT)
              table.setMenu(menu_null);
            else if (type == NodeType.SERVER) {
View Full Code Here

      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);
    }

    parseContainer(treeItem, cinfo);

    NodeType type = (NodeType) treeItem.getData(NODE_TYPE);

    String str;
    String container;

    if (type == NodeType.DATABASE) {
View Full Code Here

    if (items.length == 1) {
      itemsSelected = items;
      TreeItem[] treeItems = tree.getSelection();
      treeItemSelected = treeItems[0];

      NodeType type = (NodeType) items[0].getData(NODE_TYPE);
      switch (type) {
      case SERVER:
        serverItemSelected();
        break;
      case DATABASE:
      case CONTAINER:
        dbContainerItemSelected(items[0]);
        break;
      default:
        dataItemSelected();
        break;
      }
    } else if (items.length > 1) {
      NodeType type = (NodeType) items[0].getData(NODE_TYPE);
      switch (type) {
      case SERVER:
        itemsSelected = items;
        TreeItem[] treeItems = tree.getSelection();
        treeItemSelected = treeItems[0];
        serverItemsSelected();
        break;
      case DATABASE:
        for (TableItem item : items) {
          if (item != itemsSelected[0]) {
            itemsSelected[0] = item;
            table.setSelection(item);
            break;
          }
        }
        break;
      default:
        itemsSelected = items;
        TreeItem[] treeItems1 = tree.getSelection();
        treeItemSelected = treeItems1[0];
        containerItemsSelected();
        break;

      }

    } else {
      TreeItem[] treeItems = tree.getSelection();
      itemsSelected = treeItems;

      NodeType type = (NodeType) itemsSelected[0].getData(NODE_TYPE);
      switch (type) {
      case SERVER:
        serverItemSelected();
        break;
      case DATABASE:
View Full Code Here

    menuFavorite.getItem(0).setEnabled(false);
  }

  private void dataProperties() {
    TableItem[] items = table.getSelection();
    NodeType type = (NodeType) items[0].getData(NODE_TYPE);

    TreeItem treeItem = getTreeItemByTableItem(items[0]);
    ContainerKeyInfo cinfo = new ContainerKeyInfo();
    parseContainer(treeItem, cinfo);
    String key = cinfo.getContainerStr() + items[0].getText();
View Full Code Here

TOP

Related Classes of com.cxy.redisclient.domain.NodeType

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.