Package com.sun.xacml

Examples of com.sun.xacml.AbstractPolicy


/* 265 */     aList.add("urn:oasis:names:tc:xacml:1.0:status:syntax-error");
/*     */     try
/*     */     {
/* 269 */       if (this.encounteredParsingException)
/* 270 */         return new PolicyFinderResult(new Status(aList));
/* 271 */       AbstractPolicy policy = this.policies.getPolicy(context);
/*     */
/* 273 */       if (policy == null) {
/* 274 */         return new PolicyFinderResult();
/*     */       }
/* 276 */       return new PolicyFinderResult(policy);
View Full Code Here


    public void init(PolicyFinder finder) {
        // now that we have the PolicyFinder, we can load the policies
        PolicyReader reader = new PolicyReader(finder, logger, schemaFile);

        for (String str : policyList) {
            AbstractPolicy policy = null;

            try {
                try {
                    // first try to load it as a URL
                    URL url = new URL(str);
View Full Code Here

     *
     * @return the result of trying to find an applicable policy
     */
    public PolicyFinderResult findPolicy(EvaluationCtx context) {
        try {
            AbstractPolicy policy = policies.getPolicy(context);

            if (policy == null)
                return new PolicyFinderResult();
            else
                return new PolicyFinderResult(policy);
View Full Code Here

            // it's not a URL, so we can't handle this reference
            return new PolicyFinderResult();
        }

        // try resolving the URL
        AbstractPolicy policy = null;
        try {
            policy = reader.readPolicy(url);
        } catch (ParsingException pe) {
            // An error loading the policy could be many things (the URL
            // doesn't actually resolve a policy, the server is down, the
            // policy is invalid, etc.). This could be interpreted as an
            // error case, or simply as a case where no applicable policy
            // is available (as is done when we pre-load policies). This
            // module chooses the latter interpretation.
            return new PolicyFinderResult();
        }

        // check that we got the right kind of policy...if we didn't, then
        // we can't handle the reference
        if (type == PolicyReference.POLICY_REFERENCE) {
            if (!(policy instanceof Policy))
                return new PolicyFinderResult();
        } else {
            if (!(policy instanceof PolicySet))
                return new PolicyFinderResult();
        }

        // finally, check that the constraints match ... note that in a more
        // powerful module, you could actually have used the constraints to
        // construct a more specific URL, passed the constraints to the
        // server, etc., but this example module is staying simple
        if (!constraints.meetsConstraint(policy.getVersion()))
            return new PolicyFinderResult();

        // if we got here, then we successfully resolved a policy that is
        // the correct type, so return it
        return new PolicyFinderResult(policy);
View Full Code Here

     *
     * @return the result of trying to find an applicable policy
     */
    public PolicyFinderResult findPolicy(EvaluationCtx context) {
        try {
            AbstractPolicy policy = ctxPolicies.getPolicy(context);

            if (policy == null)
                return new PolicyFinderResult();
            else
                return new PolicyFinderResult(policy);
View Full Code Here

     *
     * @return the result of looking for a matching policy
     */
    public PolicyFinderResult findPolicy(URI idReference, int type, VersionConstraints constraints,
            PolicyMetaData parentMetaData) {
        AbstractPolicy policy = refPolicies.getPolicy(idReference.toString(), type, constraints);

        if (policy == null)
            return new PolicyFinderResult();
        else
            return new PolicyFinderResult(policy);
View Full Code Here

        // get an iterator over all the identifiers
        Iterator<TreeSet<AbstractPolicy>> it = policies.values().iterator();

        while (it.hasNext()) {
            // for each identifier, get only the most recent policy
            AbstractPolicy policy = it.next().first();

            // see if we match
            MatchResult match = policy.match(context);
            int result = match.getResult();

            // if there was an error, we stop right away
            if (result == MatchResult.INDETERMINATE)
                throw new TopLevelPolicyException(match.getStatus());
View Full Code Here

    public void init(PolicyFinder finder) {
        // now that we have the PolicyFinder, we can load the policies
        PolicyReader reader = new PolicyReader(finder, logger, schemaFile);

        for (String str : policyList) {
            AbstractPolicy policy = null;

            try {
                try {
                    // first try to load it as a URL
                    URL url = new URL(str);
View Full Code Here

     *
     * @return the result of looking for a matching policy
     */
    public PolicyFinderResult findPolicy(URI idReference, int type, VersionConstraints constraints,
            PolicyMetaData parentMetaData) {
        AbstractPolicy policy = policies.getPolicy(idReference.toString(), type, constraints);

        if (policy == null)
            return new PolicyFinderResult();
        else
            return new PolicyFinderResult(policy);
View Full Code Here

     * @return the result of running the combining algorithm
     */
    public Result combine(EvaluationCtx context, List<CombinerParameter> parameters,
            List<? extends CombinerElement> policyElements) {
        boolean atLeastOne = false;
        AbstractPolicy selectedPolicy = null;
        Iterator<? extends CombinerElement> it = policyElements.iterator();

        while (it.hasNext()) {
            AbstractPolicy policy = ((PolicyCombinerElement) (it.next())).getPolicy();

            // see if the policy matches the context
            MatchResult match = policy.match(context);
            int result = match.getResult();

            // if there is an error in trying to match any of the targets,
            // we always return INDETERMINATE immediately
            if (result == MatchResult.INDETERMINATE)
View Full Code Here

TOP

Related Classes of com.sun.xacml.AbstractPolicy

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.