Package org.jboss.security.xacml.sunxacml.ctx

Examples of org.jboss.security.xacml.sunxacml.ctx.RequestCtx


     * @param input a stream that contains an XML RequestType
     *
     * @return a stream that contains an XML ResponseType
     */
    public OutputStream evaluate(InputStream input) {
        RequestCtx request = null;
        ResponseCtx response = null;

        try {
            request = RequestCtx.getInstance(input);
        } catch (Exception pe) {
View Full Code Here


      actionSet.add(actionAttr);

      //Create the environment set
      Set environSet = new HashSet();

      RequestCtx request = new RequestCtx(subjectSet, resourceSet, actionSet, environSet);
      assertNotNull("XACML Request != null", request);

      //Log the request for viewing
      if (DEBUG)
         XACMLUtil.logRequest(request);

      //Test the request contents
      Set subjects = request.getSubjects();
      assertTrue("We have one subject?", subjects.size() == 1);
      Subject subj = (Subject) (subjects.iterator().next());
      assertNotNull("Subject != null", subj);
      assertEquals("Attributes in subject match", subjectAttr, (Attribute) (subj.getAttributes().iterator().next()));

      //Test the resource attributes
      Set resources = request.getResource();
      assertTrue("# of resources = 1", resources.size() == 1);
      assertEquals("Attributes in resources match", resourceAttr, (Attribute) (resources.iterator().next()));

      //Test the action attributes
      Set actions = request.getAction();
      assertTrue("# of actions = 1", actions.size() == 1);
      assertEquals("Attributes in actions match", actionAttr, (Attribute) (actions.iterator().next()));
   }
View Full Code Here

   /**
    * @see PolicyDecisionPoint#evaluate(RequestContext)
    */
   public ResponseContext evaluate(RequestContext request)
   {
      RequestCtx req = (RequestCtx) request.get(XACMLConstants.REQUEST_CTX);
      if (req == null)
         throw new IllegalStateException("Request Context does not contain a request");

      //Check if PDP is null
      if(policyDecisionPoint == null)
View Full Code Here

         Node root = getRequest(is);
         this.documentElement = root;
        
         if (root == null)
            throw new IllegalStateException("Root node read from the input stream is null");
         RequestCtx request = RequestCtx.getInstance(root);
         set(XACMLConstants.REQUEST_CTX, request);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
View Full Code Here

      if(node == null)
         throw new IllegalArgumentException("node is null");
     
      try
      {
         RequestCtx request = RequestCtx.getInstance(node);
         set(XACMLConstants.REQUEST_CTX, request);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
View Full Code Here

   /**
    * @see RequestContext#marshall(OutputStream)
    */
   public void marshall(OutputStream os) throws IOException
   {
      RequestCtx storedRequest = get(XACMLConstants.REQUEST_CTX);
      if (storedRequest != null)
         storedRequest.encode(os);
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.ctx.RequestCtx

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.