Class RequestControllerService
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService
-
- All Implemented Interfaces:
RequestControllerManager
,Adaptable
,Component
,Extensible
,TimestampedService
public class RequestControllerService extends DefaultComponent implements RequestControllerManager
Runtime component that implements theRequestControllerManager
interface. Contains both the Extension point logic and the service implementation.- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,RequestFilterConfig>
configCache
static String
CORS_CONFIG_EP
protected NuxeoCorsFilterDescriptorRegistry
corsFilterRegistry
protected Map<String,FilterConfigDescriptor>
denyPatterns
static String
FILTER_CONFIG_EP
protected Map<String,FilterConfigDescriptor>
grantPatterns
static String
HEADERS_CONFIG_EP
protected NuxeoHeaderDescriptorRegistry
headersRegistry
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description RequestControllerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RequestFilterConfig
computeConfigForRequest(String uri)
RequestFilterConfig
getConfigForRequest(javax.servlet.http.HttpServletRequest request)
javax.servlet.FilterConfig
getCorsConfigForRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.com.thetransactioncompany.cors.CORSFilter
getCorsFilterForRequest(javax.servlet.http.HttpServletRequest request)
Get contributed CORS Filter for an HttpServletRequest.Map<String,String>
getResponseHeaders()
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
registerFilterConfig(String name, String pattern, boolean grant, boolean tx, boolean sync, boolean cached, boolean isPrivate, String cacheTime)
void
registerFilterConfig(FilterConfigDescriptor desc)
void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
FILTER_CONFIG_EP
public static final String FILTER_CONFIG_EP
- See Also:
- Constant Field Values
-
CORS_CONFIG_EP
public static final String CORS_CONFIG_EP
- See Also:
- Constant Field Values
-
HEADERS_CONFIG_EP
public static final String HEADERS_CONFIG_EP
- Since:
- 6.0
- See Also:
- Constant Field Values
-
grantPatterns
protected final Map<String,FilterConfigDescriptor> grantPatterns
-
denyPatterns
protected final Map<String,FilterConfigDescriptor> denyPatterns
-
configCache
protected final Map<String,RequestFilterConfig> configCache
-
corsFilterRegistry
protected final NuxeoCorsFilterDescriptorRegistry corsFilterRegistry
-
headersRegistry
protected final NuxeoHeaderDescriptorRegistry headersRegistry
-
-
Method Detail
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
registerFilterConfig
public void registerFilterConfig(String name, String pattern, boolean grant, boolean tx, boolean sync, boolean cached, boolean isPrivate, String cacheTime)
-
registerFilterConfig
public void registerFilterConfig(FilterConfigDescriptor desc)
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
getCorsFilterForRequest
public com.thetransactioncompany.cors.CORSFilter getCorsFilterForRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface:RequestControllerManager
Get contributed CORS Filter for an HttpServletRequest.- Specified by:
getCorsFilterForRequest
in interfaceRequestControllerManager
- Returns:
- the CORS filter if there is a matching request, otherwise
null
-
getCorsConfigForRequest
@Deprecated public javax.servlet.FilterConfig getCorsConfigForRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.Description copied from interface:RequestControllerManager
Get contributed FilterConfig for an HttpServletRequest.- Specified by:
getCorsConfigForRequest
in interfaceRequestControllerManager
- Returns:
- filter config to init CorsFilter if there is a matching request, null otherwise.
-
getConfigForRequest
public RequestFilterConfig getConfigForRequest(javax.servlet.http.HttpServletRequest request)
- Specified by:
getConfigForRequest
in interfaceRequestControllerManager
-
computeConfigForRequest
public RequestFilterConfig computeConfigForRequest(String uri)
-
getResponseHeaders
public Map<String,String> getResponseHeaders()
- Specified by:
getResponseHeaders
in interfaceRequestControllerManager
- Returns:
- a map with the header names to add to the HTTP response with their values
-
-