Package org.jboss.security.xacml.sunxacml

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


    * @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


      Iterator it = policies.values().iterator();

      while (it.hasNext())
      {
         // for each identifier, get only the most recent policy
         AbstractPolicy policy = (AbstractPolicy) (((TreeSet) (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

      // walk through the set starting with the most recent version, looking
      // for a match until we exhaust all known versions
      Iterator it = set.iterator();
      while (it.hasNext())
      {
         AbstractPolicy policy = (AbstractPolicy) (it.next());
         if (constraints.meetsConstraint(policy.getVersion()))
         {
            // we found a valid version, so see if it's the right kind,
            // and if it is then we return it
            if (type == PolicyReference.POLICY_REFERENCE)
            {
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

    * @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

      while (it.hasNext())
      {
         String fname = (String) (it.next());
         try
         {
            AbstractPolicy policy = reader.readPolicy(new FileInputStream(fname));
            policies.addPolicy(policy);
         }
         catch (FileNotFoundException fnfe)
         {
            if (logger.isLoggable(Level.WARNING))
View Full Code Here

    */
   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

     * @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

      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

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.