Package org.apache.hadoop.hbase.security.visibility.expression

Examples of org.apache.hadoop.hbase.security.visibility.expression.NonLeafExpressionNode.addChildExp()


    // ((a | b) & (c | d)) & (e | f) -> (((a & c) & e) | ((a & c) & f) | ((a & d) & e) | ((a & d) &
    // f) | ((b & c) & e) | ((b & c) & f) | ((b & d) & e) | ((b & d) & f))
    NonLeafExpressionNode exp15 = new NonLeafExpressionNode(Operator.AND);
    NonLeafExpressionNode temp1 = new NonLeafExpressionNode(Operator.AND);
    temp1.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("a"),
        new LeafExpressionNode("b")));
    temp1.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("c"),
        new LeafExpressionNode("d")));
    exp15.addChildExp(temp1);
    exp15.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("e"),
View Full Code Here


    // f) | ((b & c) & e) | ((b & c) & f) | ((b & d) & e) | ((b & d) & f))
    NonLeafExpressionNode exp15 = new NonLeafExpressionNode(Operator.AND);
    NonLeafExpressionNode temp1 = new NonLeafExpressionNode(Operator.AND);
    temp1.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("a"),
        new LeafExpressionNode("b")));
    temp1.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("c"),
        new LeafExpressionNode("d")));
    exp15.addChildExp(temp1);
    exp15.addChildExp(new NonLeafExpressionNode(Operator.OR, new LeafExpressionNode("e"),
        new LeafExpressionNode("f")));
    result = expander.expand(exp15);
View Full Code Here

      if (isToBeExpanded(childExps)) {
        // Any of the child exp is a non leaf exp with & or | operator
        NonLeafExpressionNode newNode = new NonLeafExpressionNode(nlExp.getOperator());
        for (ExpressionNode exp : childExps) {
          if (exp.isSingleNode()) {
            newNode.addChildExp(exp);
          } else {
            newNode.addChildExp(expand(exp));
          }
        }
        nlExp = expandNonLeaf(newNode, outerOp);
View Full Code Here

        NonLeafExpressionNode newNode = new NonLeafExpressionNode(nlExp.getOperator());
        for (ExpressionNode exp : childExps) {
          if (exp.isSingleNode()) {
            newNode.addChildExp(exp);
          } else {
            newNode.addChildExp(expand(exp));
          }
        }
        nlExp = expandNonLeaf(newNode, outerOp);
      }
      return nlExp;
View Full Code Here

    }
    Operator negateOp = nlNotChild.getOperator() == Operator.AND ? Operator.OR : Operator.AND;
    NonLeafExpressionNode newNode = new NonLeafExpressionNode(negateOp);
    for (ExpressionNode expNode : nlNotChild.getChildExps()) {
      NonLeafExpressionNode negateNode = new NonLeafExpressionNode(Operator.NOT);
      negateNode.addChildExp(expNode.deepClone());
      newNode.addChildExp(expand(negateNode));
    }
    return newNode;
  }
View Full Code Here

          if (leftChildNLE.getOperator() == Operator.OR
              && rightChildNLE.getOperator() == Operator.AND) {
            newNode = new NonLeafExpressionNode(Operator.OR);
            for (ExpressionNode exp : leftChildNLE.getChildExps()) {
              NonLeafExpressionNode rightChildNLEClone = rightChildNLE.deepClone();
              rightChildNLEClone.addChildExp(exp);
              newNode.addChildExp(rightChildNLEClone);
            }
          } else if (leftChildNLE.getOperator() == Operator.AND
              && rightChildNLE.getOperator() == Operator.OR) {
            // (a & b) & (c | d) => (a & b & c) | (a & b & d)
View Full Code Here

              && rightChildNLE.getOperator() == Operator.OR) {
            // (a & b) & (c | d) => (a & b & c) | (a & b & d)
            newNode = new NonLeafExpressionNode(Operator.OR);
            for (ExpressionNode exp : rightChildNLE.getChildExps()) {
              NonLeafExpressionNode leftChildNLEClone = leftChildNLE.deepClone();
              leftChildNLEClone.addChildExp(exp);
              newNode.addChildExp(leftChildNLEClone);
            }
          } else {
            // (a | b) & (c | d) => (a & c) | (a & d) | (b & c) | (b & d)
            newNode = new NonLeafExpressionNode(Operator.OR);
View Full Code Here

            // (a | b) & (c | d) => (a & c) | (a & d) | (b & c) | (b & d)
            newNode = new NonLeafExpressionNode(Operator.OR);
            for (ExpressionNode leftExp : leftChildNLE.getChildExps()) {
              for (ExpressionNode rightExp : rightChildNLE.getChildExps()) {
                NonLeafExpressionNode newChild = new NonLeafExpressionNode(Operator.AND);
                newChild.addChildExp(leftExp.deepClone());
                newChild.addChildExp(rightExp.deepClone());
                newNode.addChildExp(newChild);
              }
            }
          }
View Full Code Here

            newNode = new NonLeafExpressionNode(Operator.OR);
            for (ExpressionNode leftExp : leftChildNLE.getChildExps()) {
              for (ExpressionNode rightExp : rightChildNLE.getChildExps()) {
                NonLeafExpressionNode newChild = new NonLeafExpressionNode(Operator.AND);
                newChild.addChildExp(leftExp.deepClone());
                newChild.addChildExp(rightExp.deepClone());
                newNode.addChildExp(newChild);
              }
            }
          }
        }
View Full Code Here

  private NonLeafExpressionNode mergeChildNodes(NonLeafExpressionNode newOuterNode,
      Operator outerOp, ExpressionNode lChild, NonLeafExpressionNode nlChild) {
    // Merge the single right/left node into the other side
    if (nlChild.getOperator() == outerOp) {
      NonLeafExpressionNode leftChildNLEClone = nlChild.deepClone();
      leftChildNLEClone.addChildExp(lChild);
      newOuterNode = leftChildNLEClone;
    } else if (outerOp == Operator.AND) {
      assert nlChild.getOperator() == Operator.OR;
      // outerOp is & here. We need to expand the node here
      // (a | b) & c -> (a & c) | (b & c)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.