Class EndPointProxyController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    public class EndPointProxyController
    extends org.springframework.web.servlet.mvc.AbstractController
    EndPoint HTTP Proxy Controller for Spring MVC.

    Provides the ability to submit a URL request via a configured end-point such as a remote Alfresco Server or any remote machine that supports an HTTP REST interface. Makes use of the Connector framework so that appropriate authentication is automatically applied to the proxied request as applicable.

    This servlet accepts URIs of the following format:

    /proxy/<endpointid>[/<uri>]*[?[<argName>=<argValue>]*]
    Where:

    - endpointid is the ID of a configured EndPoint model object to make a request against
    - url is the uri to call on the EndPoint URL e.g. /api/sites
    - argName is the name of a URL argument to append to the request
    - argValue is the value of URL argument

    E.g.

    /proxy/alfresco/api/sites?name=mysite&desc=description
    The proxy supports all valid HTTP methods supported by the RemoteClient.
    Author:
    Kevin Roast
    See Also:
    RemoteClient
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      RemoteConfigElement getRemoteConfig()
      Gets the remote config.
      org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)  
      void setBasicHttpAuthChallenge​(boolean basicHttpAuthChallenge)
      Deprecated.
      void setConfigService​(org.springframework.extensions.config.ConfigService configService)
      Sets the config service.
      void setConnectorService​(ConnectorService connectorService)
      Sets the connector service.
      void setProxyControllerInterceptor​(ProxyControllerInterceptor proxyControllerInterceptor)
      Set the ProxyControllerInterceptor reference
      void setUriBlacklist​(java.util.List<java.lang.String> uriBlacklist)  
      void setUriWhitelist​(java.util.List<java.lang.String> uriWhitelist)  
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EndPointProxyController

        public EndPointProxyController()
    • Method Detail

      • setUriWhitelist

        public void setUriWhitelist​(java.util.List<java.lang.String> uriWhitelist)
        Parameters:
        uriWhitelist - the allowed URI patterns list
      • setUriBlacklist

        public void setUriBlacklist​(java.util.List<java.lang.String> uriBlacklist)
        Parameters:
        uriBlacklist - the forbidden URI patterns list
      • setConfigService

        public void setConfigService​(org.springframework.extensions.config.ConfigService configService)
        Sets the config service.
        Parameters:
        configService - the new config service
      • setConnectorService

        public void setConnectorService​(ConnectorService connectorService)
        Sets the connector service.
        Parameters:
        connectorService - the new connector service
      • setBasicHttpAuthChallenge

        @Deprecated
        public void setBasicHttpAuthChallenge​(boolean basicHttpAuthChallenge)
        Deprecated.
        Set if to present a Basic HTTP Auth challenge with a 401 error, otherwise a plain 401 response will be sent when no authorised user is available in the session and no other auth is available. Note: deprecated. @see ProxyControllerInterceptor
        Parameters:
        basicHttpAuthChallenge - true to present a Basic HTTP Auth challenge with a 401 error, false otherwise
      • setProxyControllerInterceptor

        public void setProxyControllerInterceptor​(ProxyControllerInterceptor proxyControllerInterceptor)
        Set the ProxyControllerInterceptor reference
        Parameters:
        proxyControllerInterceptor - the ProxyControllerInterceptor
      • getRemoteConfig

        public RemoteConfigElement getRemoteConfig()
        Gets the remote config.
        Returns:
        the remote config
      • handleRequestInternal

        public org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest req,
                                                                                  javax.servlet.http.HttpServletResponse res)
                                                                           throws java.lang.Exception
        Specified by:
        handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        java.lang.Exception