Package org.jboss.security.xacml.sunxacml.finder

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


     */
    public ResponseCtx evaluate(EvaluationCtx context) {
        // see if we need to call the resource finder
        if (context.getScope() != EvaluationCtx.SCOPE_IMMEDIATE) {
            AttributeValue parent = context.getResourceId();
            ResourceFinderResult resourceResult = null;

            if (context.getScope() == EvaluationCtx.SCOPE_CHILDREN)
                resourceResult =
                    resourceFinder.findChildResources(parent, context);
            else
                resourceResult =
                    resourceFinder.findDescendantResources(parent, context);

            // see if we actually found anything
            if (resourceResult.isEmpty()) {
                // this is a problem, since we couldn't find any resources
                // to work on...the spec is not explicit about what kind of
                // error this is, so we're treating it as a processing error
                ArrayList code = new ArrayList();
                code.add(Status.STATUS_PROCESSING_ERROR);
                String msg = "Couldn't find any resources to work on.";
               
                return new
                    ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
                                           new Status(code, msg),
                                           context.getResourceId().encode()));
            }

            // setup a set to keep track of the results
            HashSet results = new HashSet();

            // at this point, we need to go through all the resources we
            // successfully found and start collecting results
            Iterator it = resourceResult.getResources().iterator();
            while (it.hasNext()) {
                // get the next resource, and set it in the EvaluationCtx
                AttributeValue resource = (AttributeValue)(it.next());
                context.setResourceId(resource);
               
                // do the evaluation, and set the resource in the result
                Result result = evaluateContext(context);
                result.setResource(resource.encode());

                // add the result
                results.add(result);
            }

            // now that we've done all the successes, we add all the failures
            // from the finder result
            Map failureMap = resourceResult.getFailures();
            it = failureMap.keySet().iterator();
            while (it.hasNext()) {
                // get the next resource, and use it to get its Status data
                AttributeValue resource = (AttributeValue)(it.next());
                Status status = (Status)(failureMap.get(resource));
View Full Code Here


     */
    public ResponseCtx evaluate(EvaluationCtx context) {
        // see if we need to call the resource finder
        if (context.getScope() != EvaluationCtx.SCOPE_IMMEDIATE) {
            AttributeValue parent = context.getResourceId();
            ResourceFinderResult resourceResult = null;

            if (context.getScope() == EvaluationCtx.SCOPE_CHILDREN)
                resourceResult =
                    resourceFinder.findChildResources(parent, context);
            else
                resourceResult =
                    resourceFinder.findDescendantResources(parent, context);

            // see if we actually found anything
            if (resourceResult.isEmpty()) {
                // this is a problem, since we couldn't find any resources
                // to work on...the spec is not explicit about what kind of
                // error this is, so we're treating it as a processing error
                ArrayList code = new ArrayList();
                code.add(Status.STATUS_PROCESSING_ERROR);
                String msg = "Couldn't find any resources to work on.";
               
                return new
                    ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
                                           new Status(code, msg),
                                           context.getResourceId().encode()));
            }

            // setup a set to keep track of the results
            HashSet results = new HashSet();

            // at this point, we need to go through all the resources we
            // successfully found and start collecting results
            Iterator it = resourceResult.getResources().iterator();
            while (it.hasNext()) {
                // get the next resource, and set it in the EvaluationCtx
                AttributeValue resource = (AttributeValue)(it.next());
                context.setResourceId(resource);
               
                // do the evaluation, and set the resource in the result
                Result result = evaluateContext(context);
                result.setResource(resource.encode());

                // add the result
                results.add(result);
            }

            // now that we've done all the successes, we add all the failures
            // from the finder result
            Map failureMap = resourceResult.getFailures();
            it = failureMap.keySet().iterator();
            while (it.hasNext()) {
                // get the next resource, and use it to get its Status data
                AttributeValue resource = (AttributeValue)(it.next());
                Status status = (Status)(failureMap.get(resource));
View Full Code Here

    */
   public ResourceFinderResult findChildResources(AttributeValue root, EvaluationCtx context)
   {
      //Validate the root
      if (preValidateRequest(root) == false)
         return new ResourceFinderResult();

      // add the root to the set of resolved resources
      HashSet set = new HashSet();
      set.add(root);

      // add the other resources, which are defined by the conformance tests
      try
      {
         set.add(new AnyURIAttribute(new URI("urn:root:child1")));
         set.add(new AnyURIAttribute(new URI("urn:root:child2")));
      }
      catch (URISyntaxException ex)
      {
      }

      return new ResourceFinderResult(set);
   }
View Full Code Here

    */
   public ResourceFinderResult findDescendantResources(AttributeValue root, EvaluationCtx context)
   {
      // Validate the root
      if (preValidateRequest(root) == false)
         return new ResourceFinderResult();

      // add the root to the set of resolved resources
      HashSet set = new HashSet();
      set.add(root);

      // add the other resources, which are defined by the conformance tests
      try
      {
         set.add(new AnyURIAttribute(new URI("urn:root:child1")));
         set.add(new AnyURIAttribute(new URI("urn:root:child1:descendant1")));
         set.add(new AnyURIAttribute(new URI("urn:root:child1:descendant2")));
         set.add(new AnyURIAttribute(new URI("urn:root:child2")));
         set.add(new AnyURIAttribute(new URI("urn:root:child2:descendant1")));
         set.add(new AnyURIAttribute(new URI("urn:root:child2:descendant2")));
      }
      catch (URISyntaxException ex)
      {
      }
      return new ResourceFinderResult(set);
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.finder.ResourceFinderResult

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.