Package org.jboss.security.xacml.core.model.context

Examples of org.jboss.security.xacml.core.model.context.ResultType


        
         //pdp evaluation is thread safe
         ResponseContext responseContext = pdp.evaluate(requestContext)
        
         ResponseType responseType = new ResponseType();
         ResultType resultType = responseContext.getResult();
         responseType.getResult().add(resultType);

         XACMLAuthzDecisionStatementType xacmlStatement = SOAPSAMLXACMLUtil.createXACMLAuthzDecisionStatementType();
         xacmlStatement.setRequest(requestType);
         xacmlStatement.setResponse(responseType);
View Full Code Here


      <!-- Test case 4-01: Should be Perm + Obl: Dr A has emergency perm   -->
      <!-- **************************************************************** -->
      */
      String file = "XacmlRequest-04-01.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
      validateCase(response, XACMLConstants.DECISION_PERMIT)
   }
View Full Code Here

        <!-- Test case 04-02: Should be Perm + Obl: Dr A has emergency perm  -->
        <!-- **************************************************************** -->
       */
      String file = "XacmlRequest-04-02.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
     
      validateCase( response,   XACMLConstants.DECISION_PERMIT);
   }
View Full Code Here

      <!-- Test case 4-03: Should be Deny+Obl: DrA has pea-001 but UBA set   -->
      <!-- **************************************************************** -->
       */
      String file = "XacmlRequest-04-03.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
      validateCase(response, XACMLConstants.DECISION_DENY)
   }
View Full Code Here

       <!-- Test case 5-01: Should be Perm + Obl: Dr A is on dissented list  -->
       <!-- **************************************************************** -->
       */
      String file = "XacmlRequest-05-01.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
      validateCase(response, XACMLConstants.DECISION_PERMIT);
   }
View Full Code Here

    */
   @SuppressWarnings("unchecked")
   public ResultType getResult()
   {
      ObjectFactory objectFactory = new ObjectFactory();
      ResultType resultType = objectFactory.createResultType();
      ResponseCtx response = (ResponseCtx) map.get(XACMLConstants.RESPONSE_CTX);
      if (response != null)
      {
         //Resource ID
         Result result = (Result) response.getResults().iterator().next();
         resultType.setResourceId(result.getResource());
        
         //Decision
         int decision = result.getDecision();
         switch(decision)
         {
            case 0:
               resultType.setDecision(DecisionType.PERMIT);
               break;
            case 1:
               resultType.setDecision(DecisionType.DENY);
               break;
            case 2:
               resultType.setDecision(DecisionType.INDETERMINATE);
               break;
            case 3:
               resultType.setDecision(DecisionType.NOT_APPLICABLE);
               break;
            default:
               throw new IllegalStateException("Unknown code");
         }
         //Status
         Status status = result.getStatus();
         StatusType statusType = objectFactory.createStatusType();
         StatusCodeType statusCodeType = objectFactory.createStatusCodeType();
         List statusList = status.getCode();
         if(statusList != null && statusList.size() > 0)
         {
            statusCodeType.setValue((String) statusList.get(0));
         }
         statusType.setStatusMessage(status.getMessage());
         statusType.setStatusCode(statusCodeType);
         resultType.setStatus(statusType);
        
         //Obligations
         Set<Obligation> obligationsSet = result.getObligations();
         if(obligationsSet != null)
         {
            for(Obligation obl:obligationsSet)
            {
               ObligationType obType = new ObligationType();
               obType.setObligationId(obl.getId().toASCIIString());
               obType.setFulfillOn(EffectType.fromValue(Result.DECISIONS[obl.getFulfillOn()]));
           
               ObligationsType obligationsType = new ObligationsType();
               obligationsType.getObligation().add(obType);
               resultType.setObligations(obligationsType)
            }
         }
      }
      return resultType;
   }
View Full Code Here

         }
        
         ResponseType responseType = (ResponseType) response;
         AssertionType at = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
         XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
         ResultType rt = xst.getResponse().getResult().get(0);
         DecisionType dt = rt.getDecision();
        
         return new Result(dt,null);
      }
      catch (JAXBException e)
      {
View Full Code Here

         }
        
         ResponseType responseType = (ResponseType) response;
         AssertionType at = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
         XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
         ResultType rt = xst.getResponse().getResult().get(0);
         DecisionType dt = rt.getDecision();
        
         return new Result(dt,null);
      }
      catch (JAXBException e)
      {
View Full Code Here

        
         //pdp evaluation is thread safe
         ResponseContext responseContext = pdp.evaluate(requestContext)
        
         ResponseType responseType = new ResponseType();
         ResultType resultType = responseContext.getResult();
         responseType.getResult().add(resultType);

         XACMLAuthzDecisionStatementType xacmlStatement =
            XACMLContextFactory.createXACMLAuthzDecisionStatementType(requestType, responseType);
        
View Full Code Here

        // pdp evaluation is thread safe
        ResponseContext responseContext = pdp.evaluate(requestContext);

        ResponseType responseType = new ResponseType();
        ResultType resultType = responseContext.getResult();
        responseType.getResult().add(resultType);

        XACMLAuthzDecisionStatementType xacmlStatement = XACMLContextFactory.createXACMLAuthzDecisionStatementType(requestType,
                responseType);
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.core.model.context.ResultType

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.