Package org.apache.portals.applications.webcontent.proxy

Examples of org.apache.portals.applications.webcontent.proxy.HttpReverseProxyNotFoundException


            proxyPathMapper = proxyPathMapperProvider.findMapper(localPathInfo);
        }
       
        if (proxyPathMapper == null)
        {
            throw new HttpReverseProxyNotFoundException("Proxy configuration is not defined for " + localPathInfo);
        }
       
        if (proxyPathMapper.isSecured())
        {
            boolean allowed = false;
            Set<String> allowedRoles = proxyPathMapper.getAllowedRoles();
           
            if (allowedRoles != null)
            {
                ReverseProxyRequestContextProvider reverseProxyRequestContextProvider = findReverseProxyRequestContextProvider(request);
               
                for (String allowedRole : allowedRoles)
                {
                    if (reverseProxyRequestContextProvider.isUserInRole(request, allowedRole))
                    {
                        allowed = true;
                        break;
                    }
                }
            }
           
            if (!allowed)
            {
                log.warn("The user is not in roles: " + allowedRoles);
                response.sendError(HttpServletResponse.SC_FORBIDDEN);
                return;
            }
        }
       
        if (hostHeaderValue == null)
        {
            if (request.getServerPort() == 80)
            {
                hostHeaderValue = request.getServerName();
            }
            else
            {
                hostHeaderValue = request.getServerName() + ":" + request.getServerPort();
            }
        }
       
        String proxyTargetURL = proxyPathMapper.getRemoteURL(localPathInfo);
       
        if (proxyTargetURL == null)
        {
            throw new HttpReverseProxyNotFoundException("Cannot translate the location path info into remote URL. " + localPathInfo);
        }
       
        String queryString = request.getQueryString();
       
        if (queryString != null)
View Full Code Here


            proxyPathMapper = proxyPathMapperProvider.findMapper(localPathInfo);
        }
       
        if (proxyPathMapper == null)
        {
            throw new HttpReverseProxyNotFoundException("Proxy configuration is not defined for " + localPathInfo);
        }
       
        if (hostHeaderValue == null)
        {
            if (request.getServerPort() == 80)
            {
                hostHeaderValue = request.getServerName();
            }
            else
            {
                hostHeaderValue = request.getServerName() + ":" + request.getServerPort();
            }
        }
       
        String proxyTargetURL = proxyPathMapper.getRemoteURL(localPathInfo);
       
        if (proxyTargetURL == null)
        {
            throw new HttpReverseProxyNotFoundException("Cannot translate the location path info into remote URL. " + localPathInfo);
        }
       
        String queryString = request.getQueryString();
       
        if (queryString != null)
View Full Code Here

            proxyPathMapper = proxyPathMapperProvider.findMapper(localPathInfo);
        }
       
        if (proxyPathMapper == null)
        {
            throw new HttpReverseProxyNotFoundException("Proxy configuration is not defined for " + localPathInfo);
        }
       
        if (proxyPathMapper.isSecured())
        {
            boolean allowed = false;
            Set<String> allowedRoles = proxyPathMapper.getAllowedRoles();
           
            if (allowedRoles != null)
            {
                ReverseProxyRequestContextProvider reverseProxyRequestContextProvider = findReverseProxyRequestContextProvider(request);
               
                for (String allowedRole : allowedRoles)
                {
                    if (reverseProxyRequestContextProvider.isUserInRole(request, allowedRole))
                    {
                        allowed = true;
                        break;
                    }
                }
            }
           
            if (!allowed)
            {
                log.warn("The user is not in roles: " + allowedRoles);
                response.sendError(HttpServletResponse.SC_FORBIDDEN);
                return;
            }
        }
       
        if (hostHeaderValue == null)
        {
            if (request.getServerPort() == 80)
            {
                hostHeaderValue = request.getServerName();
            }
            else
            {
                hostHeaderValue = request.getServerName() + ":" + request.getServerPort();
            }
        }
       
        String proxyTargetURL = proxyPathMapper.getRemoteURL(localPathInfo);
       
        if (proxyTargetURL == null)
        {
            throw new HttpReverseProxyNotFoundException("Cannot translate the location path info into remote URL. " + localPathInfo);
        }
       
        String queryString = request.getQueryString();
       
        if (queryString != null)
View Full Code Here

TOP

Related Classes of org.apache.portals.applications.webcontent.proxy.HttpReverseProxyNotFoundException

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.