1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.portlet;
24  
25  import java.security.Principal;
26  
27  import java.util.Enumeration;
28  import java.util.Locale;
29  import java.util.Map;
30  
31  import javax.portlet.PortalContext;
32  import javax.portlet.PortletMode;
33  import javax.portlet.PortletPreferences;
34  import javax.portlet.PortletRequest;
35  import javax.portlet.PortletSession;
36  import javax.portlet.WindowState;
37  
38  /**
39   * <a href="PortletRequestWrapper.java.html"><b><i>View Source</i></b></a>
40   *
41   * @author Brian Wing Shun Chan
42   *
43   */
44  public class PortletRequestWrapper implements PortletRequest {
45  
46      public PortletRequestWrapper(PortletRequest req) {
47          _req = req;
48      }
49  
50      public boolean isWindowStateAllowed(WindowState state) {
51          return _req.isWindowStateAllowed(state);
52      }
53  
54      public boolean isPortletModeAllowed(PortletMode mode) {
55          return _req.isPortletModeAllowed(mode);
56      }
57  
58      public PortletMode getPortletMode() {
59          return _req.getPortletMode();
60      }
61  
62      public WindowState getWindowState() {
63          return _req.getWindowState();
64      }
65  
66      public PortletPreferences getPreferences() {
67          return _req.getPreferences();
68      }
69  
70      public PortletSession getPortletSession() {
71          return _req.getPortletSession();
72      }
73  
74      public PortletSession getPortletSession(boolean create) {
75          return _req.getPortletSession(create);
76      }
77  
78      public String getProperty(String name) {
79          return _req.getProperty(name);
80      }
81  
82      public Enumeration getProperties(String name) {
83          return _req.getProperties(name);
84      }
85  
86      public Enumeration getPropertyNames() {
87          return _req.getPropertyNames();
88      }
89  
90      public PortalContext getPortalContext() {
91          return _req.getPortalContext();
92      }
93  
94      public String getAuthType() {
95          return _req.getAuthType();
96      }
97  
98      public String getContextPath() {
99          return _req.getContextPath();
100     }
101 
102     public String getRemoteUser() {
103         return _req.getRemoteUser();
104     }
105 
106     public Principal getUserPrincipal() {
107         return _req.getUserPrincipal();
108     }
109 
110     public boolean isUserInRole(String role) {
111         return _req.isUserInRole(role);
112     }
113 
114     public Object getAttribute(String name) {
115         return _req.getAttribute(name);
116     }
117 
118     public Enumeration getAttributeNames() {
119         return _req.getAttributeNames();
120     }
121 
122     public String getParameter(String name) {
123         return _req.getParameter(name);
124     }
125 
126     public Enumeration getParameterNames() {
127         return _req.getParameterNames();
128     }
129 
130     public String[] getParameterValues(String name) {
131         return _req.getParameterValues(name);
132     }
133 
134     public Map getParameterMap() {
135         return _req.getParameterMap();
136     }
137 
138     public boolean isSecure() {
139         return _req.isSecure();
140     }
141 
142     public void setAttribute(String name, Object obj) {
143         _req.setAttribute(name, obj);
144     }
145 
146     public void removeAttribute(String name) {
147         _req.removeAttribute(name);
148     }
149 
150     public String getRequestedSessionId() {
151         return _req.getRequestedSessionId();
152     }
153 
154     public boolean isRequestedSessionIdValid() {
155         return _req.isRequestedSessionIdValid();
156     }
157 
158     public String getResponseContentType() {
159         return _req.getResponseContentType();
160     }
161 
162     public Enumeration getResponseContentTypes() {
163         return _req.getResponseContentTypes();
164     }
165 
166     public Locale getLocale() {
167         return _req.getLocale();
168     }
169 
170     public Enumeration getLocales() {
171         return _req.getLocales();
172     }
173 
174     public String getScheme() {
175         return _req.getScheme();
176     }
177 
178     public String getServerName() {
179         return _req.getServerName();
180     }
181 
182     public int getServerPort() {
183         return _req.getServerPort();
184     }
185 
186     public PortletRequest getPortletRequest() {
187         return _req;
188     }
189 
190     public void setPortletRequest(PortletRequest req) {
191         _req = req;
192     }
193 
194     private PortletRequest _req;
195 
196 }