001// Copyright 2006 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014package org.apache.tapestry.portlet.multipart;
015
016import java.io.BufferedReader;
017import java.io.IOException;
018import java.io.InputStream;
019import java.io.UnsupportedEncodingException;
020import java.security.Principal;
021import java.util.Enumeration;
022import java.util.Locale;
023import java.util.Map;
024
025import javax.portlet.ActionRequest;
026import javax.portlet.PortalContext;
027import javax.portlet.PortletMode;
028import javax.portlet.PortletPreferences;
029import javax.portlet.PortletSession;
030import javax.portlet.WindowState;
031
032/**
033 * @author Raphael Jean
034 *
035 */
036public class ActionRequestWrapper extends Object implements ActionRequest 
037{
038        private ActionRequest wrapped;
039        
040    public ActionRequestWrapper(ActionRequest request)
041    {
042        wrapped = request;
043    }
044    
045        public InputStream getPortletInputStream() throws IOException {
046                return wrapped.getPortletInputStream();
047        }
048
049        public void setCharacterEncoding(String arg0)
050                        throws UnsupportedEncodingException {
051                wrapped.setCharacterEncoding(arg0);
052        }
053
054        public BufferedReader getReader() throws UnsupportedEncodingException,
055                        IOException {
056                return wrapped.getReader();
057        }
058
059        public String getCharacterEncoding() {
060                return wrapped.getCharacterEncoding();
061        }
062
063        public String getContentType() {
064                return wrapped.getContentType();
065        }
066
067        public int getContentLength() {
068                return wrapped.getContentLength();
069        }
070
071        public boolean isWindowStateAllowed(WindowState arg0) {
072                return wrapped.isWindowStateAllowed(arg0);
073        }
074
075        public boolean isPortletModeAllowed(PortletMode arg0) {
076                return wrapped.isPortletModeAllowed(arg0);
077        }
078
079        public PortletMode getPortletMode() {
080                return wrapped.getPortletMode();
081        }
082
083        public WindowState getWindowState() {
084                return wrapped.getWindowState();
085        }
086
087        public PortletPreferences getPreferences() {
088                return wrapped.getPreferences();
089        }
090
091        public PortletSession getPortletSession() {
092                return wrapped.getPortletSession();
093        }
094
095        public PortletSession getPortletSession(boolean arg0) {
096                return wrapped.getPortletSession(arg0);
097        }
098
099        public String getProperty(String arg0) {
100                return wrapped.getProperty(arg0);
101        }
102
103        public Enumeration getProperties(String arg0) {
104                return wrapped.getProperties(arg0);
105        }
106
107        public Enumeration getPropertyNames() {
108                return wrapped.getPropertyNames();
109        }
110
111        public PortalContext getPortalContext() {
112                return wrapped.getPortalContext();
113        }
114
115        public String getAuthType() {
116                return wrapped.getAuthType();
117        }
118
119        public String getContextPath() {
120                return wrapped.getContextPath();
121        }
122
123        public String getRemoteUser() {
124                return wrapped.getRemoteUser();
125        }
126
127        public Principal getUserPrincipal() {
128                return wrapped.getUserPrincipal();
129        }
130
131        public boolean isUserInRole(String arg0) {
132                return wrapped.isUserInRole(arg0);
133        }
134
135        public Object getAttribute(String arg0) {
136                return wrapped.getAttribute(arg0);
137        }
138
139        public Enumeration getAttributeNames() {
140                return wrapped.getAttributeNames();
141        }
142
143        public String getParameter(String arg0) {
144                return wrapped.getParameter(arg0);
145        }
146
147        public Enumeration getParameterNames() {
148                return wrapped.getParameterNames();
149        }
150
151        public String[] getParameterValues(String arg0) {
152                return wrapped.getParameterValues(arg0);
153        }
154
155        public Map getParameterMap() {
156                return wrapped.getParameterMap();
157        }
158
159        public boolean isSecure() {
160                return wrapped.isSecure();
161        }
162
163        public void setAttribute(String arg0, Object arg1) {
164                wrapped.setAttribute(arg0, arg1);
165        }
166
167        public void removeAttribute(String arg0) {
168                wrapped.removeAttribute(arg0);
169        }
170
171        public String getRequestedSessionId() {
172                return wrapped.getRequestedSessionId();
173        }
174
175        public boolean isRequestedSessionIdValid() {
176                return wrapped.isRequestedSessionIdValid();
177        }
178
179        public String getResponseContentType() {
180                return wrapped.getResponseContentType();
181        }
182
183        public Enumeration getResponseContentTypes() {
184                return wrapped.getResponseContentTypes();
185        }
186
187        public Locale getLocale() {
188                return wrapped.getLocale();
189        }
190
191        public Enumeration getLocales() {
192                return wrapped.getLocales();
193        }
194
195        public String getScheme() {
196                return wrapped.getScheme();
197        }
198
199        public String getServerName() {
200                return wrapped.getServerName();
201        }
202
203        public int getServerPort() {
204                return wrapped.getServerPort();
205        }
206
207        protected ActionRequest getRequest() {
208                return wrapped;
209        }
210
211}