Package com.sun.xacml.ctx

Examples of com.sun.xacml.ctx.Status


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


/* 264 */     List aList = new ArrayList();
/* 265 */     aList.add("urn:oasis:names:tc:xacml:1.0:status:syntax-error");
/*     */     try
/*     */     {
/* 269 */       if (this.encounteredParsingException)
/* 270 */         return new PolicyFinderResult(new Status(aList));
/* 271 */       AbstractPolicy policy = this.policies.getPolicy(context);
/*     */
/* 273 */       if (policy == null) {
/* 274 */         return new PolicyFinderResult();
/*     */       }
View Full Code Here

                // ...first checking if this is the first match and if
                // we automaticlly nest policies
                if ((combiningAlg == null) && (list.size() > 0)) {
                    ArrayList<String> code = new ArrayList<String>();
                    code.add(Status.STATUS_PROCESSING_ERROR);
                    Status status = new Status(code, "too many applicable" + " top-level policies");
                    throw new TopLevelPolicyException(status);
                }

                list.add(policy);
            }
View Full Code Here

            // there was something wrong with the request, so we return
            // Indeterminate with a status of syntax error...though this
            // may change if a more appropriate status type exists
            ArrayList<String> code = new ArrayList<String>();
            code.add(Status.STATUS_SYNTAX_ERROR);
            Status status = new Status(code, pe.getMessage());

            return new ResponseCtx(new Result(Result.DECISION_INDETERMINATE, status));
        }
    }
View Full Code Here

                // error this is, so we're treating it as a processing error
                ArrayList<String> code = new ArrayList<String>();
                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<Result> results = new HashSet<Result>();

            // at this point, we need to go through all the resources we
            // successfully found and start collecting results

            for (AttributeValue resource : resourceResult.getResources()) {
                // get the next resource, and set it in the EvaluationCtx
                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<AttributeValue, Status> failureMap = resourceResult.getFailures();

            for (AttributeValue resource : failureMap.keySet()) {
                // get the next resource, and use it to get its Status data
                Status status = (failureMap.get(resource));
                // add a new result
                results.add(new Result(Result.DECISION_INDETERMINATE, status, resource.encode()));
            }

            // return the set of results
View Full Code Here

            request = RequestCtx.getInstance(input);
        } catch (Exception pe) {
            // the request wasn't formed correctly
            ArrayList<String> code = new ArrayList<String>();
            code.add(Status.STATUS_SYNTAX_ERROR);
            Status status = new Status(code, "invalid request: " + pe.getMessage());

            response = new ResponseCtx(new Result(Result.DECISION_INDETERMINATE, status));
        }

        // if we didn't have a problem above, then we should go ahead
View Full Code Here

     */
    public MatchResult match(EvaluationCtx context) {
        if (target == null) {
            ArrayList<String> code = new ArrayList<String>();
            code.add(Status.STATUS_PROCESSING_ERROR);
            Status status = new Status(code, "no target available for " + "matching a rule");

            return new MatchResult(MatchResult.INDETERMINATE, status);
        }

        return target.match(context);
View Full Code Here

                // if this isn't the first match, then this is an error
                if (atLeastOne) {
                    List<String> code = new ArrayList<String>();
                    code.add(Status.STATUS_PROCESSING_ERROR);
                    String message = "Too many applicable policies";
                    return new Result(Result.DECISION_INDETERMINATE, new Status(code, message),
                            context.getResourceId().encode());
                }

                // if this was the first applicable policy in the set, then
                // remember it for later
View Full Code Here

                    ArrayList<String> code = new ArrayList<String>();
                    code.add(Status.STATUS_MISSING_ATTRIBUTE);
                    String message = "couldn't resolve XPath expression " + contextPath
                            + " for type " + type.toString();
                    return new EvaluationResult(new Status(code, message));
                } else {
                    // return the empty bag
                    return result;
                }
            } else {
View Full Code Here

    public Result combine(EvaluationCtx context, List<CombinerParameter> parameters,
            List<? extends CombinerElement> policyElements) {
        boolean atLeastOneError = false;
        boolean atLeastOneDeny = false;
        Set<Obligation> denyObligations = new HashSet<Obligation>();
        Status firstIndeterminateStatus = null;
        Iterator<? extends CombinerElement> it = policyElements.iterator();

        while (it.hasNext()) {
            AbstractPolicy policy = ((PolicyCombinerElement) (it.next())).getPolicy();
View Full Code Here

TOP

Related Classes of com.sun.xacml.ctx.Status

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.