Package com.sun.xacml.ctx

Examples of com.sun.xacml.ctx.ResponseCtx


   /**
    * @see ResponseContext#getDecision()
    */
   public int getDecision()
   {
      ResponseCtx response = (ResponseCtx) map.get(XACMLConstants.RESPONSE_CTX);
      if(response != null)
      {
         Set<Result> results = response.getResults();
         Result res = results.iterator().next();
         decision = res.getDecision();
      }
      return decision;
        
View Full Code Here


   /**
    * @see ResponseContext#marshall(OutputStream)
    */
   public void marshall(OutputStream os) throws IOException
   {
      ResponseCtx storedResponse = get(XACMLConstants.RESPONSE_CTX);   
      if(storedResponse != null)
         storedResponse.encode(os);
   }  
View Full Code Here

        List<ResponseCtx> responses = GeoXACMLConfig.getXACMLTransport().evaluateRequestCtxList(
                requests);

        outer: for (int i = 0; i < responses.size(); i++) {
            ResponseCtx response = responses.get(i);
            XACMLRole role = (XACMLRole) auth.getAuthorities()[i];
            for (Result result : response.getResults()) {
                if (result.getDecision() != Result.DECISION_PERMIT) {
                    role.setEnabled(false);
                    continue outer;
                }
                role.setEnabled(true);
View Full Code Here

        setDispatcherRequest("GetMap", env, null);

        RequestCtx request = GeoXACMLConfig.getRequestCtxBuilderFactory()
                .getResourceInfoRequestCtxBuilder(role, states, AccessMode.READ).createRequestCtx();
        // dumpRequestCtx(request);
        ResponseCtx response = GeoXACMLConfig.getXACMLTransport().evaluateRequestCtx(request);
        assertTrue(response.getResults().iterator().next().getDecision() == Result.DECISION_PERMIT);
        checkForObligation(response);
    }
View Full Code Here

        setDispatcherRequest("GetFeatureInfo", env, "EPSG:4326");

        RequestCtx request = GeoXACMLConfig.getRequestCtxBuilderFactory()
                .getResourceInfoRequestCtxBuilder(role, asia, AccessMode.READ).createRequestCtx();
        // dumpRequestCtx(request);
        ResponseCtx response = GeoXACMLConfig.getXACMLTransport().evaluateRequestCtx(request);
        assertTrue(response.getResults().iterator().next().getDecision() == Result.DECISION_DENY);
    }
View Full Code Here

        setDispatcherRequest("GetFeatureInfo", env, "EPSG:4326");

        RequestCtx request = GeoXACMLConfig.getRequestCtxBuilderFactory()
                .getResourceInfoRequestCtxBuilder(role, europe, AccessMode.READ).createRequestCtx();
        // dumpRequestCtx(request);
        ResponseCtx response = GeoXACMLConfig.getXACMLTransport().evaluateRequestCtx(request);
        assertTrue(response.getResults().iterator().next().getDecision() == Result.DECISION_PERMIT);
        checkForObligation(response);
    }
View Full Code Here

        setDispatcherRequest("GetFeatureInfo", env, "EPSG:4326");

        RequestCtx request = GeoXACMLConfig.getRequestCtxBuilderFactory()
                .getResourceInfoRequestCtxBuilder(role, europe, AccessMode.READ).createRequestCtx();
        // dumpRequestCtx(request);
        ResponseCtx response = GeoXACMLConfig.getXACMLTransport().evaluateRequestCtx(request);
        assertTrue(response.getResults().iterator().next().getDecision() == Result.DECISION_DENY);
    }
View Full Code Here

    }

    public ResponseCtx evaluateRequestCtx(RequestCtx request) {
        initDigestMap();
        log(request);
        ResponseCtx response = sendHttpPost(request);
        log(response);
        return response;

    }
View Full Code Here

    private List<ResponseCtx> evaluateRequestCtxListSerial(List<RequestCtx> requests) {
        List<ResponseCtx> resultList = new ArrayList<ResponseCtx>();
        for (RequestCtx request : requests) {
            log(request);
            ResponseCtx response = sendHttpPost(request);
            log(response);
            resultList.add(response);
        }
        return resultList;
    }
View Full Code Here

        requestCtx.encode(bout, new Indenter(0), true);
        byte[] byteArray = bout.toByteArray();
        byte[] msgDigest = getDigestBytes(byteArray);

        if (msgDigest != null) {
            ResponseCtx responseCtx = DigestMap.get().get(new String(msgDigest));
            if (responseCtx != null) {
                return responseCtx;
            }
        }

        try {
            HttpURLConnection conn = (HttpURLConnection) pdpURL.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-type", "text/xml, application/xml");
            conn.setDoOutput(true);
            OutputStream out = conn.getOutputStream();
            out.write(byteArray);
            out.close();
            InputStream in = conn.getInputStream();
            ResponseCtx result = ResponseCtx.getInstance(in);
            in.close();
            if (msgDigest != null)
                DigestMap.get().put(new String(msgDigest), result);
            return result;
        } catch (Exception e) {
View Full Code Here

TOP

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

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.