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