Examples of BagAttribute


Examples of com.sun.xacml.attr.BagAttribute

                }

                list.add(attrFactory.createValue(type, text));
            }

            return new EvaluationResult(new BagAttribute(type, list));
        } catch (ParsingException pe) {
            return createProcessingError(pe.getMessage());
        } catch (UnknownIdentifierException uie) {
            return createProcessingError("unknown attribute type: " + type);
        }
View Full Code Here

Examples of com.sun.xacml.attr.BagAttribute

     */
    private EvaluationResult makeBag(AttributeValue attribute) {
        Set<AttributeValue> set = new HashSet<AttributeValue>();
        set.add(attribute);

        BagAttribute bag = new BagAttribute(attribute.getType(), set);

        return new EvaluationResult(bag);
    }
View Full Code Here

Examples of com.sun.xacml.attr.BagAttribute

        } catch (URISyntaxException e) {
            // should not happen
        }
        Set<AttributeValue> set = new HashSet<AttributeValue>();
        set.add(resultGeomAttr);
        BagAttribute bag = new BagAttribute(resultGeomAttr.getType(), set);
        return new EvaluationResult(bag);
    }
View Full Code Here

Examples of com.sun.xacml.attr.BagAttribute

            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)));
    }
View Full Code Here

Examples of com.sun.xacml.attr.BagAttribute

                }

                list.add(attrValue);
            }

            return new EvaluationResult(new BagAttribute(type, list));
        } catch (ParsingException pe) {
            return createProcessingError(pe.getMessage());
        } catch (UnknownIdentifierException uie) {
            return createProcessingError("unknown attribute type: " + type);
        }
View Full Code Here

Examples of com.sun.xacml.attr.BagAttribute

            return callHelper(type, id, issuer, category, designatorType);
        }

        // if we got here, then we found at least one useful AttributeValue
        return new EvaluationResult(new BagAttribute(type, attributes));
    }
View Full Code Here

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

        // in a higher-order case, if anything is INDETERMINATE, then
        // we stop right away
        if (result.indeterminate())
            return result;
       
        BagAttribute bag = (BagAttribute)(result.getAttributeValue());
       
        // param: function, bag
        // return: bag
        // for each value in the bag evaluate the given function with
        // the value and put the function result in a new bag that
        // is ultimately returned

        Iterator it = bag.iterator();
        List outputs = new ArrayList();

        while (it.hasNext()) {
            List params = new ArrayList();
            params.add(it.next());
            result = function.evaluate(params, context);

            if (result.indeterminate())
                return result;

            outputs.add(result.getAttributeValue());
        }

        return new EvaluationResult(new BagAttribute(returnType, outputs));
    }
View Full Code Here

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

            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)));
    }
View Full Code Here

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

                    // sets won't allow duplicates, so this addition is ok
                    set.add(value);
                }
            }

            result = new BagAttribute(bags[0].getType(), set);

            break;

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

            Iterator it0 = bags[0].iterator();
            while (it0.hasNext()) {
                // first off, add all elements from the first bag...the set
                // will ignore all duplicates
                set.add(it0.next());
            }
           
            Iterator it1 = bags[1].iterator();
            while (it1.hasNext()) {
                // now add all the elements from the second bag...again, all
                // duplicates will be ignored by the set
                set.add(it1.next());
            }

            result = new BagAttribute(bags[0].getType(), set);

            break;
        }
       
        return new EvaluationResult(result);
View Full Code Here

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

            // the first bag and a single value from the second bag, and if
            // any evaluation is true return true, otherwise return false

            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;
           
                if (((BooleanAttribute)(result.
                                        getAttributeValue())).getValue())
                    break;
            }
            break;
        }

        case ID_ALL_OF_ANY: {

            // param: boolean-function, bag, bag of same type
            // return: boolean
            // iterate through the first bag, and if for each of those values
            // one of the values in the second bag matches then return true,
            // otherwise return false

            result = allOfAny((BagAttribute)(args[1]), (BagAttribute)(args[0]),
                              function, context);
            break;
        }

        case ID_ANY_OF_ALL: {

            // param: boolean-function, bag, bag of same type
            // return: boolean
            // iterate through the second bag, and if for each of those values
            // one of the values in the first bag matches then return true,
            // otherwise return false

            result = anyOfAll((BagAttribute)(args[0]), (BagAttribute)(args[1]),
                              function, context);
            break;
        }

        case ID_ALL_OF_ALL: {

            // param: boolean-function, bag, bag of same type
            // return: boolean
            // iterate through the first bag, and for each of those values
            // if every value in the second bag matches using the given
            // function, then return true, otherwise return false

            result = new EvaluationResult(BooleanAttribute.getInstance(true));
            Iterator it = ((BagAttribute)args[0]).iterator();
            BagAttribute bag = (BagAttribute)(args[1]);

            while (it.hasNext()) {
                result = all((AttributeValue)(it.next()), bag, function,
                             context);
           
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.