Package org.jboss.security.xacml.sunxacml

Examples of org.jboss.security.xacml.sunxacml.AbstractPolicy


         PolicySetFinderModule psfm)
   {
      List<XACMLPolicy> policyList = policy.getEnclosingPolicies();
      for (XACMLPolicy xp : policyList)
      {
         AbstractPolicy p = xp.get(XACMLConstants.UNDERLYING_POLICY);
         if (p instanceof Policy)
            policies.add((Policy) p);
         else if (p instanceof PolicySet)
         {
            policySets.add((PolicySet) p);
View Full Code Here


     * @return an applicable policy, if one exists, or an error
     */
   @Override
   public PolicyFinderResult findPolicy(EvaluationCtx context)
   {
      AbstractPolicy selectedPolicy = null;
      MatchResult match = policySet.match(context);
      int result = match.getResult();

      // if target matching was indeterminate, then return the error
      if (result == MatchResult.INDETERMINATE)
View Full Code Here

    * @throws Exception
    * @see XACMLConstants
    */
   public JBossXACMLPolicy(InputStream is, int type) throws Exception
   {
      AbstractPolicy policy = null;
      XACMLPolicyUtil xpu = new XACMLPolicyUtil();
      this.policyType = type;
      if(type == XACMLPolicy.POLICYSET)
      {
         policy = xpu.createPolicySet(is, finder)
View Full Code Here

    * @throws Exception
    * @see XACMLConstants
    */
   public JBossXACMLPolicy(InputStream is, int type, JBossPolicyFinder theFinder) throws Exception
   {
      AbstractPolicy policy = null;
      XACMLPolicyUtil xpu = new XACMLPolicyUtil();
      this.policyType = type;
      if(type == XACMLPolicy.POLICYSET)
      {
         if(theFinder == null)
View Full Code Here

     * @param output a stream into which the XML-encoded data is written
     * @param indenter an object that creates indentation strings
     */
    public void encode(OutputStream output, Indenter indenter) {
        if (! getParameters().isEmpty()) {
            AbstractPolicy policy = getPolicy();

            // FIXME: This is ugly and happens in several places...maybe this
            // should get folded into the AbstractPolicy API?
            if (policy instanceof Policy) {
                encodeParamaters(output, indenter, "Policy",
                                 policy.getId().toString());
            } else if (policy instanceof PolicySet) {
                encodeParamaters(output, indenter, "PolicySet",
                                 policy.getId().toString());
            } else {
                PolicyReference ref = (PolicyReference)policy;
                if (ref.getReferenceType() == PolicyReference.POLICY_REFERENCE)
                    encodeParamaters(output, indenter, "Policy",
                                     ref.getReference().toString());
View Full Code Here

        boolean atLeastOnePermit = false;
        Set permitObligations = new HashSet();
        Iterator it = policyElements.iterator();

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

            // make sure that the policy matches the context
            MatchResult match = policy.match(context);

            if (match.getResult() == MatchResult.INDETERMINATE)
                return new Result(Result.DECISION_DENY,
                                  context.getResourceId().encode());

            if (match.getResult() == MatchResult.MATCH) {
                // evaluate the policy
                Result result = policy.evaluate(context);
                int effect = result.getDecision();
               
                // unlike in the RuleCombining version of this alg, we always
                // return DENY if any Policy returns DENY or INDETERMINATE
                if ((effect == Result.DECISION_DENY) ||
View Full Code Here

     * @return the result of running the combining algorithm
     */
    public Result combine(EvaluationCtx context, List parameters,
                          List policyElements) {
        boolean atLeastOne = false;
        AbstractPolicy selectedPolicy = null;
        Iterator 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

    public Result combine(EvaluationCtx context, List parameters,
                          List policyElements) {
        Iterator it = policyElements.iterator();
       
        while (it.hasNext()) {
            AbstractPolicy policy =
                ((PolicyCombinerElement)(it.next())).getPolicy();

            // make sure that the policy matches the context
            MatchResult match = policy.match(context);

            if (match.getResult() == MatchResult.INDETERMINATE)
                return new Result(Result.DECISION_INDETERMINATE,
                                  match.getStatus(),
                                  context.getResourceId().encode());

            if (match.getResult() == MatchResult.MATCH) {
                // evaluate the policy
                Result result = policy.evaluate(context);
                int effect = result.getDecision();
               
                // in the case of PERMIT, DENY, or INDETERMINATE, we always
                // just return that result, so only on a rule that doesn't
                // apply do we keep going...
View Full Code Here

        Set denyObligations = new HashSet();
        Status firstIndeterminateStatus = null;
        Iterator it = policyElements.iterator();

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

            // make sure that the policy matches the context
            MatchResult match = policy.match(context);

            if (match.getResult() == MatchResult.INDETERMINATE) {
                atLeastOneError = true;
               
                // keep track of the first error, regardless of cause
                if (firstIndeterminateStatus == null)
                    firstIndeterminateStatus = match.getStatus();
            } else if (match.getResult() == MatchResult.MATCH) {
                // now we evaluate the policy
                Result result = policy.evaluate(context);
                int effect = result.getDecision();
               
                // this is a little different from DenyOverrides...

                if (effect == Result.DECISION_PERMIT)
View Full Code Here

      Iterator it = policyList.iterator();
      while (it.hasNext())
      {
         String str = (String) (it.next());
         AbstractPolicy policy = null;

         try
         {
            try
            {
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.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.