1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.portals.bridges.portletfilter;
18
19
20 import java.io.IOException;
21
22 import javax.portlet.ActionRequest;
23 import javax.portlet.ActionResponse;
24 import javax.portlet.PortletException;
25 import javax.portlet.RenderRequest;
26 import javax.portlet.RenderResponse;
27
28 /***
29 * A filter is an object that performs filtering tasks on either the request
30 * to a resource (a portlet), or on the response from a resource, or both.
31 *
32 * Filters perform filtering in the renderFilter and processActionFilter
33 * method. Every Filter has access to a PortletFilterConfig object from
34 * which it can obtain its initialization parameters, a reference to the
35 * PortletConfig which it can use, for example, to load resources needed
36 * for filtering tasks. Filters are configured in the deployment descriptor
37 * of a portlet(portlet.xml).
38 *
39 * @author <a href="mailto:shinsuke@yahoo.co.jp">Shinsuke Sugaya</a>
40 */
41 public interface PortletFilter
42 {
43
44 /***
45 * Called by init method of FilterPortlet to initialize this
46 * portlet filter.
47 *
48 * @param filterConfig
49 * @throws PortletException
50 */
51 public abstract void init(PortletFilterConfig filterConfig) throws PortletException;
52
53 /***
54 * Called by render method of FilterPortlet to put tags, such as
55 * <style>, into <head>.
56 *
57 * @param request
58 * @param response
59 * @param chain PortletFilterChain instance
60 * @throws PortletException
61 */
62 public abstract void renderFilter(RenderRequest request, RenderResponse response, PortletFilterChain chain)
63 throws PortletException, IOException;
64
65 /***
66 * Called by render method of FilterPortlet to wrap the request
67 * when it has a multipart content.
68 *
69 * @param request
70 * @param response
71 * @param chain PortletFilterChain instance
72 * @throws PortletException
73 */
74 public abstract void processActionFilter(ActionRequest request, ActionResponse response, PortletFilterChain chain)
75 throws PortletException, IOException;
76
77 /***
78 * Called by destroy method of FilterPortlet to destroy this
79 * portlet filter.
80 *
81 * @throws PortletException
82 */
83 public abstract void destroy();
84
85 }