Package com.sun.xacml

Examples of com.sun.xacml.AbstractPolicy


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

            if (policy == null) {
                return new PolicyFinderResult();
            }

View Full Code Here


        // return a copy, otherwise the map could change during evaluation if policies are added, deleted etc
        readLock.lock();
        try {
            Map<String, AbstractPolicy> result = new ConcurrentHashMap<String, AbstractPolicy>();
            for(String id:policies.keySet()){
                AbstractPolicy policy = handleDocument(m_policyReader.readPolicy(policies.get(id)),policyFinder);
                result.put(id, policy);
            }
            return result;
        }
        catch (ParsingException pe) {
View Full Code Here

        Set<AbstractPolicy> matchedPolicies = new HashSet<AbstractPolicy>();

        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) {
                matchedPolicies.add(policy);
            }
        }

        Set<AbstractPolicy> applicablePolicies =
                getApplicablePolicies(context, matchedPolicies);

        for (AbstractPolicy policy : applicablePolicies) {
            Result result = policy.evaluate(context);
            int effect = result.getDecision();

            if (effect == Result.DECISION_DENY) {
                denyObligations.addAll(result.getObligations());
                return new Result(Result.DECISION_DENY, context.getResourceId()
View Full Code Here

        String str2 = "<testing/>";

        pdm = new DbXmlPolicyIndex(null);

        pdm.addPolicy(str, "test-nish");
        AbstractPolicy docb = pdm.getPolicy("test-nish", null);
        docb.encode(System.out);

        pdm.updatePolicy("test-nish", str2);
        docb = pdm.getPolicy("test-nish", null);
        docb.encode(System.out);

        pdm.deletePolicy("test-nish");
    }
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

       Iterator it = policyList.iterator();
       while (it.hasNext())
       {
           String str = (String)(it.next());
           AbstractPolicy policy = null;
           try
           {
              try
              {
                      // first try to load it as a URL
View Full Code Here

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

/*     */
/* 219 */     Iterator it = this.policyList.iterator();
/* 220 */     while (it.hasNext())
/*     */     {
/* 222 */       String str = (String)(String)it.next();
/* 223 */       AbstractPolicy policy = null;
/*     */       try
/*     */       {
/*     */         try
/*     */         {
/* 229 */           URL url = new URL(str);
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.