Class RedirectFilter
java.lang.Object
javax.management.StandardMBean
com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
com.adobe.acs.commons.redirects.filter.RedirectFilter
- All Implemented Interfaces:
RedirectFilterMBean,DynamicMBean,MBeanRegistration,javax.servlet.Filter,org.apache.sling.api.resource.observation.ResourceChangeListener,org.osgi.service.event.EventHandler
public class RedirectFilter
extends com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
implements javax.servlet.Filter, org.osgi.service.event.EventHandler, org.apache.sling.api.resource.observation.ResourceChangeListener, RedirectFilterMBean
A request filter that implements support for virtual redirects.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.apache.sling.api.resource.observation.ResourceChangeListener
CHANGE_ADDED, CHANGE_CHANGED, CHANGE_PROVIDER_ADDED, CHANGE_PROVIDER_REMOVED, CHANGE_REMOVED, CHANGES, PATHS, PROPERTY_NAMES_HINT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidactivate(RedirectFilter.Configuration config, org.osgi.framework.BundleContext context) voidvoiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) protected Collection<String>protected Collection<String>protected List<org.apache.http.Header>protected Collection<String>getPaths()JMX Operation: get a list of loaded configurations, e.g.getRedirectRules(String storagePath) JMX Operation: Display loaded rules for a path, e.g.static Collection<RedirectRule>getRules(org.apache.sling.api.resource.Resource resource) voidhandleEvent(org.osgi.service.event.Event event) voidinit(javax.servlet.FilterConfig filterConfig) voidprotected booleanprotected booleanmapUrls()protected voidmodify(org.osgi.framework.BundleContext context, RedirectFilter.Configuration config) voidMethods inherited from class com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
getAnnotation, getConstructor, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getMethod, getParamAnnotation, getParamAnnotation, getParameterName, getParameterName, getReadMethod, getWriteMethodMethods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
Field Details
-
ACS_REDIRECTS_RESOURCE_TYPE
- See Also:
-
REDIRECT_RULE_RESOURCE_TYPE
- See Also:
-
DEFAULT_CONFIG_BUCKET
- See Also:
-
DEFAULT_CONFIG_NAME
- See Also:
-
-
Constructor Details
-
RedirectFilter
- Throws:
NotCompliantMBeanException
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
activate
protected final void activate(RedirectFilter.Configuration config, org.osgi.framework.BundleContext context) -
modify
protected void modify(org.osgi.framework.BundleContext context, RedirectFilter.Configuration config) -
deactivate
public void deactivate() -
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler
-
onChange
- Specified by:
onChangein interfaceorg.apache.sling.api.resource.observation.ResourceChangeListener
-
invalidateAll
public void invalidateAll()- Specified by:
invalidateAllin interfaceRedirectFilterMBean
-
getRules
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Filter
-
mapUrls
protected boolean mapUrls() -
isEnabled
protected boolean isEnabled()- Returns:
- whether redirection is enabled
-
getExtensions
-
getPaths
-
getMethods
-
getOnDeliveryHeaders
-
getRedirectRules
JMX Operation: Display loaded rules for a path, e.g. /conf/global/settings/redirects- Specified by:
getRedirectRulesin interfaceRedirectFilterMBean- Returns:
- the redirect configurations in a tabular format for the MBean
- Throws:
OpenDataException
-
getRedirectConfigurations
JMX Operation: get a list of loaded configurations, e.g. [/conf/global/settings/redirects, /conf/wknd/settings/redirects]- Specified by:
getRedirectConfigurationsin interfaceRedirectFilterMBean
-
getBucket
- Specified by:
getBucketin interfaceRedirectFilterMBean
-
getConfigName
- Specified by:
getConfigNamein interfaceRedirectFilterMBean
-