Examples of PolicyFinderResult


Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

         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

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

         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

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

   {
      try
      {
         AbstractPolicy policy = policies.getPolicy(context);
         if (policy == null)
            return new PolicyFinderResult();
         else
            return new PolicyFinderResult(policy);
      }
      catch (TopLevelPolicyException tlpe)
      {
         return new PolicyFinderResult(tlpe.getStatus());
      }
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

            throw new ProcessingException("couldn't find the policy with " +
                                          "a null finder");
        }

        PolicyFinderResult pfr =
            finder.findPolicy(reference, policyType, constraints,
                              parentMetaData);
       
        if (pfr.notApplicable())
            throw new ProcessingException("couldn't resolve the policy");
       
        if (pfr.indeterminate())
            throw new ProcessingException("error resolving the policy");

        return pfr.getPolicy();
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

        // if there is no finder, then we return NotApplicable
        if (finder == null)
            return new Result(Result.DECISION_NOT_APPLICABLE,
                              context.getResourceId().encode());

        PolicyFinderResult pfr = finder.findPolicy(reference, policyType,
                                                   constraints,
                                                   parentMetaData);

        // if we found nothing, then we return NotApplicable
        if (pfr.notApplicable())
            return new Result(Result.DECISION_NOT_APPLICABLE,
                              context.getResourceId().encode());

        // if there was an error, we return that status data
        if (pfr.indeterminate())
            return new Result(Result.DECISION_INDETERMINATE, pfr.getStatus(),
                              context.getResourceId().encode());

        // we must have found a policy
        return pfr.getPolicy().evaluate(context);
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

      aList.add(Status.STATUS_SYNTAX_ERROR);

      try
      {
         if (this.encounteredParsingException)
            return new PolicyFinderResult(new Status(aList));
         AbstractPolicy policy = policies.getPolicy(context);

         if (policy == null)
            return new PolicyFinderResult();
         else
            return new PolicyFinderResult(policy);
      }
      catch (TopLevelPolicyException tlpe)
      {
         return new PolicyFinderResult(tlpe.getStatus());
      }
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

            MatchResult match = policy.match(context);
            int result = match.getResult();
           
            // if there was an error, we stop right away
            if (result == MatchResult.INDETERMINATE)
                return new PolicyFinderResult(match.getStatus());

            if (result == MatchResult.MATCH) {
                // if we matched before, this is an error...
                if (selectedPolicy != null) {
                    ArrayList code = new ArrayList();
                    code.add(Status.STATUS_PROCESSING_ERROR);
                    Status status = new Status(code, "too many applicable top-"
                                               + "level policies");
                    return new PolicyFinderResult(status);
                }

                // ...otherwise remember this policy
                selectedPolicy = policy;
            }
        }

        // if we found a policy, return it, otherwise we're N/A
        if (selectedPolicy != null)
            return new PolicyFinderResult(selectedPolicy);
        else
            return new PolicyFinderResult();
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

   /**
    * @see PolicyFinderModule#findPolicy(com.sun.xacml.EvaluationCtx)
    */
   public PolicyFinderResult findPolicy(EvaluationCtx evaluationCtx)
   {
      return new PolicyFinderResult(policy);
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

    * @see PolicyFinderModule#findPolicy(java.net.URI, int,
    *        com.sun.xacml.VersionConstraints, com.sun.xacml.PolicyMetaData)
    */
   public PolicyFinderResult findPolicy(URI arg0, int arg1, VersionConstraints arg2, PolicyMetaData arg3)
   {
      return new PolicyFinderResult(policy);
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.finder.PolicyFinderResult

      MatchResult match = policySet.match(context);
      int result = match.getResult();

      // if target matching was indeterminate, then return the error
      if (result == MatchResult.INDETERMINATE)
         return new PolicyFinderResult(match.getStatus());

      // see if the target matched
      if (result == MatchResult.MATCH)
      {
         // see if we previously found another match
         if (selectedPolicy != null)
         {
            // we found a match before, so this is an error
            ArrayList<String> code = new ArrayList<String>();
            code.add(Status.STATUS_PROCESSING_ERROR);
            Status status = new Status(code, "too many applicable " + "top-level policies");
            return new PolicyFinderResult(status);
         }

         // this is the first match we've found, so remember it
         selectedPolicy = policySet;
      }

      // return the single applicable policy (if there was one)
      return new PolicyFinderResult(selectedPolicy);
   }
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.