Package org.jboss.security.xacml.sunxacml.cond

Examples of org.jboss.security.xacml.sunxacml.cond.EvaluationResult


        Set set = new HashSet();
        set.add(attribute);

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

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


                                          URI issuer, URI subjectCategory,
                                          EvaluationCtx context,
                                          int designatorType) {
        // make sure this is the identifier we support
        if (! attributeId.toString().equals(ROLE_IDENTIFIER))
            return new EvaluationResult(BagAttribute.
                                        createEmptyBag(attributeType));

        // make sure we've been asked for a string
        if (! attributeType.toString().equals(StringAttribute.identifier))
            return new EvaluationResult(BagAttribute.
                                        createEmptyBag(attributeType));

        // retrieve the subject identifer from the context
        EvaluationResult result =
            context.getSubjectAttribute(attributeType, subjectIdentifier,
                                        issuer, subjectCategory);
        if (result.indeterminate())
            return result;

        // check that we succeeded in getting the subject identifier
        BagAttribute bag = (BagAttribute)(result.getAttributeValue());
        if (bag.isEmpty()) {
            ArrayList code = new ArrayList();
            code.add(Status.STATUS_MISSING_ATTRIBUTE);
            Status status = new Status(code, "missing subject-id");
            return new EvaluationResult(status);
        }
       
        // finally, look for the subject who has the role-mapping defined,
        // and if they're the identified subject, add their role
        BagAttribute returnBag = null;
        Iterator it = bag.iterator();
        while (it.hasNext()) {
            StringAttribute attr = (StringAttribute)(it.next());
            if (attr.getValue().equals("Julius Hibbert")) {
                Set set = new HashSet();
                set.add(new StringAttribute("Physician"));
                returnBag = new BagAttribute(attributeType, set);
                break;
            }
        }

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

            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

                                        this, adType);
        } else {
            logger.warning("Context tried to invoke AttributeFinder but was " +
                           "not configured with one");

            return new EvaluationResult(BagAttribute.createEmptyBag(type));
        }
    }
View Full Code Here

                                        xpathVersion);
        } else {
            logger.warning("Context tried to invoke AttributeFinder but was " +
                           "not configured with one");

            return new EvaluationResult(BagAttribute.createEmptyBag(type));
        }
    }
View Full Code Here

     * @param context the representation of the request
     *
     * @return a successful evaluation containing this value
     */
    public EvaluationResult evaluate(EvaluationCtx context) {
        return new EvaluationResult(this);
    }
View Full Code Here

     */
    public EvaluationResult findAttribute(URI attributeType, URI attributeId,
                                          URI issuer, URI subjectCategory,
                                          EvaluationCtx context,
                                          int designatorType) {
        return new EvaluationResult(BagAttribute.
                                    createEmptyBag(attributeType));
    }
View Full Code Here

    public EvaluationResult findAttribute(String contextPath,
                                          Node namespaceNode,
                                          URI attributeType,
                                          EvaluationCtx context,
                                          String xpathVersion) {
        return new EvaluationResult(BagAttribute.
                                    createEmptyBag(attributeType));
    }
View Full Code Here

     *
     * @return the result of trying to match the TargetMatch and the request
     */
    public MatchResult match(EvaluationCtx context) {
        // start by evaluating the AD/AS
        EvaluationResult result = eval.evaluate(context);
       
        if (result.indeterminate()) {
            // in this case, we don't ask the function for anything, and we
            // simply return INDETERMINATE
            return new MatchResult(MatchResult.INDETERMINATE,
                                   result.getStatus());
        }

        // an AD/AS will always return a bag
        BagAttribute bag = (BagAttribute)(result.getAttributeValue());

        if (! bag.isEmpty()) {
            // we got back a set of attributes, so we need to iterate through
            // them, seeing if at least one matches
            Iterator it = bag.iterator();
View Full Code Here

    /**
     * Private helper that evaluates an individual match.
     */
    private MatchResult evaluateMatch(List inputs, EvaluationCtx context) {
        // first off, evaluate the function
        EvaluationResult result = function.evaluate(inputs, context);

        // if it was indeterminate, then that's what we return immediately
        if (result.indeterminate())
            return new MatchResult(MatchResult.INDETERMINATE,
                                   result.getStatus());

        // otherwise, we figure out if it was a match
        BooleanAttribute bool = (BooleanAttribute)(result.getAttributeValue());

        if (bool.getValue())
            return new MatchResult(MatchResult.MATCH);
        else
            return new MatchResult(MatchResult.NO_MATCH);
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.cond.EvaluationResult

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.