Package org.jboss.security.xacml.sunxacml.attr

Examples of org.jboss.security.xacml.sunxacml.attr.AttributeValue


            // Evaluate the argument
            EvaluationResult result = eval.evaluate(context);
            if (result.indeterminate())
                return result;

            AttributeValue value = result.getAttributeValue();
            boolean argBooleanValue = ((BooleanAttribute)value).getValue();

            switch (getFunctionId()) {
            case ID_OR:
                if (argBooleanValue)


        if (result != null)
            return result;
       
        // *-is-in takes a bag and an element of baseType and
        // returns a single boolean value
        AttributeValue item = (AttributeValue)(argValues[0]);
        BagAttribute bag = (BagAttribute)(argValues[1]);
       
        return new EvaluationResult(BooleanAttribute.
                                    getInstance(bag.contains(item)));
    }

        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        // Now that we have real values, perform the date math operation.
        AttributeValue attrResult = null;

        switch (getFunctionId()) {
        // These two functions are basically the same except for sign.
        // And they both need to deal with sign anyway, so they share
        // their code.

        // setup the two bags we'll be using
        BagAttribute [] bags = new BagAttribute[2];
        bags[0] = (BagAttribute)(argValues[0]);
        bags[1] = (BagAttribute)(argValues[1]);

        AttributeValue result = null;
        Set set = new HashSet();
       
        switch(getFunctionId()) {

            // *-intersection takes two bags of the same type and returns
            // a bag of that type
        case ID_BASE_INTERSECTION:
            // create a bag with the common elements of both inputs, removing
            // all duplicate values

            Iterator it = bags[0].iterator();

            // find all the things in bags[0] that are also in bags[1]
            while (it.hasNext()) {
                AttributeValue value = (AttributeValue)(it.next());
                if (bags[1].contains(value)) {
                    // sets won't allow duplicates, so this addition is ok
                    set.add(value);
                }
            }

            result = new EvaluationResult(BooleanAttribute.getInstance(false));
            Iterator it = ((BagAttribute)args[0]).iterator();
            BagAttribute bag = (BagAttribute)(args[1]);
           
            while (it.hasNext()) {
                AttributeValue value = (AttributeValue)(it.next());
                result = any(value, bag, function, context, false);
               
                if (result.indeterminate())
                    return result;
           

                                          EvaluationCtx context,
                                          boolean argumentsAreSwapped) {
        Iterator it = allBag.iterator();

        while (it.hasNext()) {
            AttributeValue value = (AttributeValue)(it.next());
            EvaluationResult result =
                any(value, anyBag, function, context, argumentsAreSwapped);
           
            if (result.indeterminate())
                return result;

        // setup the two bags we'll be using
        BagAttribute [] bags = new BagAttribute[2];
        bags[0] = (BagAttribute)(argValues[0]);
        bags[1] = (BagAttribute)(argValues[1]);

        AttributeValue result = null;
       
        switch(getFunctionId()) {
            // *-at-least-one-member-of takes two bags of the same type and
            // returns a boolean
        case ID_BASE_AT_LEAST_ONE_MEMBER_OF:

        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        // Now that we have real values, perform the requested operation.
        AttributeValue attrResult = null;

        switch (getFunctionId()) {
           
            // *-one-and-only takes a single bag and returns a
            // single value of baseType

        // was never really the right behavior (there's no reason that a
        // function can only be at the start of an Apply), we no longer make
        // assumptions at this point, so the higher order functions are
        // left to evaluate their own parameters.
        EvaluationResult result = function.evaluate(xprs, context);
        AttributeValue avalue = result.getAttributeValue();
        StringBuilder builder = new StringBuilder();
        builder.append("Function:"+function.getIdentifier().toASCIIString());
        for(Object obj: xprs)
        {
          builder.append(":").append(obj).append(":")
        }
        builder.append("::result=");
        if(avalue != null && avalue.isBag() == false)
          builder.append(avalue.encode());
        logger.log(Level.FINE, builder.toString());
        return result;
    }

   public static Attribute getInstance(Node root) throws ParsingException {
      URI id = null;
      URI type = null;
      String issuer = null;
      DateTimeAttribute issueInstant = null;
      AttributeValue value = null;
     
      Set<AttributeValue> valueSet = null;

      AttributeFactory attrFactory = AttributeFactory.getInstance();

TOP

Related Classes of org.jboss.security.xacml.sunxacml.attr.AttributeValue

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.