Package com.sun.xacml.ctx

Examples of com.sun.xacml.ctx.ResponseCtx


     * @return the ResponseCtx object
     * @throws MelcoeXacmlException
     */
    public ResponseCtx makeResponseCtx(String response)
            throws MelcoeXacmlException {
        ResponseCtx resCtx = null;
        try {
            // sunxacml 1.2 bug. ResponseCtx.getInstance looks for
            // ResourceId and creates ResourceID
            String newResponse =
                    response.replaceAll("ResourceID", "ResourceId");
View Full Code Here


    public ResponseCtx evaluate(RequestCtx reqCtx) throws Exception {
        logger.debug("Resolving RequestCtx request!");

        String request = contextUtil.makeRequestCtx(reqCtx);
        String response = evaluate(request);
        ResponseCtx resCtx = contextUtil.makeResponseCtx(response);

        return resCtx;
    }
View Full Code Here

                throw new ServletException(e.getMessage(), e);
            }
        }

        String res = null;
        ResponseCtx resCtx = null;
        try {
            if (logger.isDebugEnabled()) {
                logger.debug("Number of requests: " + requests.size());
            }

            res =
                    getContextHandler().evaluateBatch(requests
                            .toArray(new String[requests.size()]));

            if (logger.isDebugEnabled()) {
                logger.debug("Response: " + res);
            }

            resCtx = m_contextUtil.makeResponseCtx(res);
        } catch (MelcoeXacmlException pe) {
            throw new ServletException("Error evaluating pids: "
                    + pe.getMessage(), pe);
        }

        @SuppressWarnings("unchecked")
        Set<Result> results = resCtx.getResults();

        return results;
    }
View Full Code Here

                throw new ServletException(e.getMessage(), e);
            }
        }

        String res = null;
        ResponseCtx resCtx = null;
        try {
            logger.debug("Number of requests: {}", requests.size());

            res =
                    getContextHandler().evaluateBatch(requests
                            .toArray(new String[requests.size()]));

            logger.debug("Response: {}", res);

            resCtx = m_contextUtil.makeResponseCtx(res);
        } catch (MelcoeXacmlException pe) {
            throw new ServletException("Error evaluating pids: "
                    + pe.getMessage(), pe);
        }

        @SuppressWarnings("unchecked")
        Set<Result> results = resCtx.getResults();

        return results;
    }
View Full Code Here

        }

        String response =
                getContextHandler().evaluateBatch(requests
                        .toArray(new String[requests.size()]));
        ResponseCtx resCtx;
        try {
            resCtx = m_contextUtil.makeResponseCtx(response);
        } catch (MelcoeXacmlException e) {
            throw new PEPException(e);
        }

        @SuppressWarnings("unchecked")
        Set<Result> results = resCtx.getResults();

        List<DatastreamDef> resultObjects = new ArrayList<DatastreamDef>();
        for (Result r : results) {
            if (r.getResource() == null || "".equals(r.getResource())) {
                logger.warn("This resource has no resource identifier in the xacml response results!");
View Full Code Here

        }

        String response =
                getContextHandler().evaluateBatch(requests
                        .toArray(new String[requests.size()]));
        ResponseCtx resCtx;
        try {
            resCtx = m_contextUtil.makeResponseCtx(response);
        } catch (MelcoeXacmlException e) {
            throw new PEPException(e);
        }

        @SuppressWarnings("unchecked")
        Set<Result> results = resCtx.getResults();

        List<ObjectFields> resultObjects = new ArrayList<ObjectFields>();
        for (Result r : results) {
            if (r.getResource() == null || "".equals(r.getResource())) {
                logger.warn("This resource has no resource identifier in the xacml response results!");
View Full Code Here

            return false;
        }

        // if we have received a requestContext, we need to hand it over to the
        // context handler for resolution.
        ResponseCtx resCtx = null;

        try {
            resCtx = m_ctxHandler.evaluate(reqCtx);
        } catch (PEPException pe) {
            logger.error("Error evaluating request", pe);
View Full Code Here

        ParameterRequestWrapper req = null;
        HttpServletResponse res = (HttpServletResponse)response;

        // the request and response context
        RequestCtx reqCtx = null;
        ResponseCtx resCtx = null;

        String uri = ((HttpServletRequest) request).getRequestURI();
        String servletPath = ((HttpServletRequest) request).getServletPath();
        if (logger.isDebugEnabled()) {
            logger.debug("Incoming URI: {}", uri);
View Full Code Here

            logger.debug("evaluating RequestCtx request");
        }

        String request = m_contextUtil.makeRequestCtx(reqCtx);
        String response = evaluate(request);
        ResponseCtx resCtx;
        try {
            resCtx = m_contextUtil.makeResponseCtx(response);
        } catch (MelcoeXacmlException e) {
            throw new PEPException(e);
        }
View Full Code Here

            }

            b = System.currentTimeMillis();
            logger.debug("Time taken for XACML Evaluation: {}ms", (b - a));

            ResponseCtx resCtx;
            try {
                resCtx = m_contextUtil.makeResponseCtx(response);
            } catch (MelcoeXacmlException e) {
                throw new PEPException(e);
            }

            @SuppressWarnings("unchecked")
            Set<Result> results = resCtx.getResults();

            finalResults.addAll(results);
        }

        ResponseCtx resultCtx = new ResponseCtx(finalResults);

        return m_contextUtil.makeResponseCtx(resultCtx);
    }
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.