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