1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.portals.bridges.jsf;
18
19 import java.util.Enumeration;
20
21 import javax.portlet.PortletRequest;
22
23 /***
24 * <p>
25 * This must be the set of properties available via the javax.portlet.PortletRequest methods getProperty()
26 * and getPropertyNames(). As such, HTTP headers will only be included if they were provided by the portlet container,
27 * and additional properties provided by the portlet container may also be included.
28 * </p>
29 * <p>
30 * See MyFaces project for servlet implementation.
31 * </p>
32 *
33 * @author <a href="dlestrat@apache.org">David Le Strat </a>
34 */
35 public class RequestHeaderMap extends AbstractAttributeMap
36 {
37 /*** The portlet request. */
38 private final PortletRequest portletRequest;
39
40 /***
41 * @param portletRequest The {@link PortletRequest}.
42 */
43 RequestHeaderMap(PortletRequest portletRequest)
44 {
45 this.portletRequest = portletRequest;
46 }
47
48 /***
49 * @see org.apache.portals.bridges.jsf.AbstractAttributeMap#getAttribute(java.lang.String)
50 */
51 protected Object getAttribute(String key)
52 {
53 return portletRequest.getProperty(key);
54 }
55
56 /***
57 * @see org.apache.portals.bridges.jsf.AbstractAttributeMap#setAttribute(java.lang.String, java.lang.Object)
58 */
59 protected void setAttribute(String key, Object value)
60 {
61 throw new UnsupportedOperationException(
62 "Cannot set PortletRequest Property");
63 }
64
65 /***
66 * @see org.apache.portals.bridges.jsf.AbstractAttributeMap#removeAttribute(java.lang.String)
67 */
68 protected void removeAttribute(String key)
69 {
70 throw new UnsupportedOperationException(
71 "Cannot remove PortletRequest Property");
72 }
73
74 /***
75 * @see org.apache.portals.bridges.jsf.AbstractAttributeMap#getAttributeNames()
76 */
77 protected Enumeration getAttributeNames()
78 {
79 return portletRequest.getPropertyNames();
80 }
81 }