Package org.acegisecurity.intercept.web

Examples of org.acegisecurity.intercept.web.FilterInvocation


        EasyMock.expect(mockRequest.getParameterMap()).andReturn(null).anyTimes();
        EasyMock.expect(mockRequest.getRemoteHost()).andReturn("localhost").anyTimes();
        EasyMock.expect(mockRequest.getRemoteAddr()).andReturn("127.0.0.1").anyTimes();
        EasyMock.replay(mockRequest);

        FilterInvocation filter = org.easymock.classextension.EasyMock
                .createMock(FilterInvocation.class);
        org.easymock.classextension.EasyMock.expect(filter.getRequestUrl()).andReturn(path)
                .anyTimes();
        org.easymock.classextension.EasyMock.expect(filter.getHttpRequest()).andReturn(mockRequest)
                .anyTimes();

        org.easymock.classextension.EasyMock.replay(filter);

        XACMLFilterDecisionVoter voter = new XACMLFilterDecisionVoter();
View Full Code Here


        if (!(response instanceof HttpServletResponse)) {
            throw new ServletException("HttpServletResponse required");
        }

        FilterInvocation fi = new FilterInvocation(request, response, chain);
        ConfigAttributeDefinition attr = this.filterInvocationDefinitionSource.getAttributes(fi);

        if (attr != null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Request: " + fi.toString() + "; ConfigAttributes: " + attr.toString());
            }

            channelDecisionManager.decide(fi, attr);

            if (fi.getResponse().isCommitted()) {
                return;
            }
        }

        chain.doFilter(request, response);
View Full Code Here

        MockHttpServletRequest req = new MockHttpServletRequest();
        req.setRequestURI(contextPath + uri);
        req.setContextPath(contextPath);
        req.setServletPath(null);

        FilterInvocation fi = new FilterInvocation(req, new MockHttpServletResponse(),
                new FilterChain() {
                    public void doFilter(ServletRequest arg0, ServletResponse arg1)
                        throws IOException, ServletException {
                        throw new UnsupportedOperationException(
                            "WebInvocationPrivilegeEvaluator does not support filter chains");
View Full Code Here

        }
    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
        FilterInvocation fi = new FilterInvocation(request, response, chain);

        ConfigAttributeDefinition cad = this.filterInvocationDefinitionSource.getAttributes(fi);

        if (cad == null) {
            if (logger.isDebugEnabled()) {
                logger.debug(fi.getRequestUrl() + " has no matching filters");
            }

            chain.doFilter(request, response);

            return;
        }

        Filter[] filters = obtainAllDefinedFilters(cad);

        if (filters.length == 0) {
            if (logger.isDebugEnabled()) {
                logger.debug(fi.getRequestUrl() + " has an empty filter list");
            }

            chain.doFilter(request, response);

            return;
        }

        VirtualFilterChain virtualFilterChain = new VirtualFilterChain(fi, filters);
        virtualFilterChain.doFilter(fi.getRequest(), fi.getResponse());
    }
View Full Code Here

        }
    }

    public void doFilter(ServletRequest request, ServletResponse response,
        FilterChain chain) throws IOException, ServletException {
        FilterInvocation fi = new FilterInvocation(request, response, chain);

        ConfigAttributeDefinition cad = this.filterInvocationDefinitionSource
            .getAttributes(fi);

        if (cad == null) {
            if (logger.isDebugEnabled()) {
                logger.debug(fi.getRequestUrl() + " has no matching filters");
            }

            chain.doFilter(request, response);
        } else {
            Filter[] filters = obtainAllDefinedFilters(cad);

            VirtualFilterChain virtualFilterChain = new VirtualFilterChain(fi,
                    filters);
            virtualFilterChain.doFilter(fi.getRequest(), fi.getResponse());
        }
    }
View Full Code Here

        }

        String targetUrl = httpRequest.getScheme() + "://"
            + httpRequest.getServerName() + ((includePort) ? (":" + port) : "")
            + httpRequest.getContextPath()
            + new FilterInvocation(request, response, chain).getRequestUrl();

        if (logger.isDebugEnabled()) {
            logger.debug(
                "Authentication entry point being called; target URL added to Session: "
                + targetUrl);
View Full Code Here

        MockHttpServletRequest req = new MockHttpServletRequest();
        req.setRequestURI(contextPath + uri);
        req.setContextPath(contextPath);
        req.setServletPath(null);

        FilterInvocation fi = new FilterInvocation(req,
                new MockHttpServletResponse(),
                new FilterChain() {
                    public void doFilter(ServletRequest arg0,
                        ServletResponse arg1)
                        throws IOException, ServletException {
View Full Code Here

        if (!(response instanceof HttpServletResponse)) {
            throw new ServletException("HttpServletResponse required");
        }

        FilterInvocation fi = new FilterInvocation(request, response, chain);
        ConfigAttributeDefinition attr = this.filterInvocationDefinitionSource
            .getAttributes(fi);

        if (attr != null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Request: " + fi.getFullRequestUrl()
                    + "; ConfigAttributes: " + attr.toString());
            }

            channelDecisionManager.decide(fi, attr);

            if (fi.getResponse().isCommitted()) {
                return;
            }
        }

        chain.doFilter(request, response);
View Full Code Here

TOP

Related Classes of org.acegisecurity.intercept.web.FilterInvocation

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.