Class EndPointProxyController

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.extensions.webscripts.servlet.mvc.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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected org.springframework.extensions.config.ConfigService
     
     
     

    Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

    HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the remote config.
    org.springframework.web.servlet.ModelAndView
    handleRequestInternal(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
     
    void
    setBasicHttpAuthChallenge(boolean basicHttpAuthChallenge)
    Deprecated.
    void
    setConfigService(org.springframework.extensions.config.ConfigService configService)
    Sets the config service.
    void
    Sets the connector service.
    void
    Set the ProxyControllerInterceptor reference
    void
    setUriBlacklist(List<String> uriBlacklist)
     
    void
    setUriWhitelist(List<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, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, 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
  • Field Details

  • Constructor Details

    • EndPointProxyController

      public EndPointProxyController()
  • Method Details

    • setUriWhitelist

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

      public void setUriBlacklist(List<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(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws Exception
      Specified by:
      handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
      Throws:
      Exception