KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > core > DummyRequest


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina.core;
20
21
22 import java.io.BufferedReader JavaDoc;
23 import java.io.IOException JavaDoc;
24 import java.io.InputStream JavaDoc;
25 import java.io.UnsupportedEncodingException JavaDoc;
26 import java.net.Socket JavaDoc;
27 import java.security.Principal JavaDoc;
28 import java.util.Enumeration JavaDoc;
29 import java.util.Iterator JavaDoc;
30 import java.util.Locale JavaDoc;
31 import java.util.Map JavaDoc;
32
33 import javax.servlet.FilterChain JavaDoc;
34 import javax.servlet.RequestDispatcher JavaDoc;
35 import javax.servlet.ServletInputStream JavaDoc;
36 import javax.servlet.ServletRequest JavaDoc;
37 import javax.servlet.http.Cookie JavaDoc;
38 import javax.servlet.http.HttpServletRequest JavaDoc;
39 import javax.servlet.http.HttpSession JavaDoc;
40
41 import org.apache.catalina.Context;
42 import org.apache.catalina.Host;
43 import org.apache.catalina.Wrapper;
44 import org.apache.catalina.connector.Connector;
45 import org.apache.catalina.connector.Response;
46 import org.apache.tomcat.util.buf.MessageBytes;
47
48
49 /**
50  * Dummy request object, used for request dispatcher mapping, as well as
51  * JSP precompilation.
52  *
53  * @author Remy Maucherat
54  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
55  */

56
57 public class DummyRequest
58     implements HttpServletRequest JavaDoc {
59
60     public DummyRequest() {
61     }
62
63     public DummyRequest(String JavaDoc contextPath, String JavaDoc decodedURI,
64                         String JavaDoc queryString) {
65         this.contextPath = contextPath;
66         this.decodedURI = decodedURI;
67         this.queryString = queryString;
68     }
69
70     protected String JavaDoc contextPath = null;
71     protected String JavaDoc decodedURI = null;
72     protected String JavaDoc queryString = null;
73
74     protected String JavaDoc pathInfo = null;
75     protected String JavaDoc servletPath = null;
76     protected Wrapper wrapper = null;
77
78     protected FilterChain JavaDoc filterChain = null;
79     
80     private static Enumeration JavaDoc dummyEnum = new Enumeration JavaDoc(){
81         public boolean hasMoreElements(){
82             return false;
83         }
84         public Object JavaDoc nextElement(){
85             return null;
86         }
87     };
88
89     public String JavaDoc getContextPath() {
90         return (contextPath);
91     }
92
93     public MessageBytes getContextPathMB() {
94         return null;
95     }
96
97     public ServletRequest JavaDoc getRequest() {
98         return (this);
99     }
100
101     public String JavaDoc getDecodedRequestURI() {
102         return decodedURI;
103     }
104
105     public MessageBytes getDecodedRequestURIMB() {
106         return null;
107     }
108
109     public FilterChain JavaDoc getFilterChain() {
110         return (this.filterChain);
111     }
112
113     public void setFilterChain(FilterChain JavaDoc filterChain) {
114         this.filterChain = filterChain;
115     }
116
117     public String JavaDoc getQueryString() {
118         return queryString;
119     }
120
121     public void setQueryString(String JavaDoc query) {
122         queryString = query;
123     }
124
125     public String JavaDoc getPathInfo() {
126         return pathInfo;
127     }
128
129     public void setPathInfo(String JavaDoc path) {
130         pathInfo = path;
131     }
132
133     public MessageBytes getPathInfoMB() {
134         return null;
135     }
136
137     public MessageBytes getRequestPathMB() {
138         return null;
139     }
140
141     public String JavaDoc getServletPath() {
142         return servletPath;
143     }
144
145     public void setServletPath(String JavaDoc path) {
146         servletPath = path;
147     }
148
149     public MessageBytes getServletPathMB() {
150         return null;
151     }
152
153     public Wrapper getWrapper() {
154         return (this.wrapper);
155     }
156
157     public void setWrapper(Wrapper wrapper) {
158         this.wrapper = wrapper;
159     }
160
161     public String JavaDoc getAuthorization() { return null; }
162     public void setAuthorization(String JavaDoc authorization) {}
163     public Connector getConnector() { return null; }
164     public void setConnector(Connector connector) {}
165     public Context getContext() { return null; }
166     public void setContext(Context context) {}
167     public Host getHost() { return null; }
168     public void setHost(Host host) {}
169     public String JavaDoc getInfo() { return null; }
170     public Response getResponse() { return null; }
171     public void setResponse(Response response) {}
172     public Socket JavaDoc getSocket() { return null; }
173     public void setSocket(Socket JavaDoc socket) {}
174     public InputStream JavaDoc getStream() { return null; }
175     public void setStream(InputStream JavaDoc input) {}
176     public void addLocale(Locale JavaDoc locale) {}
177     public ServletInputStream JavaDoc createInputStream() throws IOException JavaDoc {
178         return null;
179     }
180     public void finishRequest() throws IOException JavaDoc {}
181     public Object JavaDoc getNote(String JavaDoc name) { return null; }
182     public Iterator JavaDoc getNoteNames() { return null; }
183     public void removeNote(String JavaDoc name) {}
184     public void setContentType(String JavaDoc type) {}
185     public void setNote(String JavaDoc name, Object JavaDoc value) {}
186     public void setProtocol(String JavaDoc protocol) {}
187     public void setRemoteAddr(String JavaDoc remoteAddr) {}
188     public void setRemoteHost(String JavaDoc remoteHost) {}
189     public void setScheme(String JavaDoc scheme) {}
190     public void setServerName(String JavaDoc name) {}
191     public void setServerPort(int port) {}
192     public Object JavaDoc getAttribute(String JavaDoc name) { return null; }
193     public Enumeration JavaDoc getAttributeNames() { return null; }
194     public String JavaDoc getCharacterEncoding() { return null; }
195     public int getContentLength() { return -1; }
196     public void setContentLength(int length) {}
197     public String JavaDoc getContentType() { return null; }
198     public ServletInputStream JavaDoc getInputStream() throws IOException JavaDoc {
199         return null;
200     }
201     public Locale JavaDoc getLocale() { return null; }
202     public Enumeration JavaDoc getLocales() { return null; }
203     public String JavaDoc getProtocol() { return null; }
204     public BufferedReader JavaDoc getReader() throws IOException JavaDoc { return null; }
205     public String JavaDoc getRealPath(String JavaDoc path) { return null; }
206     public String JavaDoc getRemoteAddr() { return null; }
207     public String JavaDoc getRemoteHost() { return null; }
208     public String JavaDoc getScheme() { return null; }
209     public String JavaDoc getServerName() { return null; }
210     public int getServerPort() { return -1; }
211     public boolean isSecure() { return false; }
212     public void removeAttribute(String JavaDoc name) {}
213     public void setAttribute(String JavaDoc name, Object JavaDoc value) {}
214     public void setCharacterEncoding(String JavaDoc enc)
215         throws UnsupportedEncodingException JavaDoc {}
216     public void addCookie(Cookie JavaDoc cookie) {}
217     public void addHeader(String JavaDoc name, String JavaDoc value) {}
218     public void addParameter(String JavaDoc name, String JavaDoc values[]) {}
219     public void clearCookies() {}
220     public void clearHeaders() {}
221     public void clearLocales() {}
222     public void clearParameters() {}
223     public void recycle() {}
224     public void setAuthType(String JavaDoc authType) {}
225     public void setContextPath(String JavaDoc path) {}
226     public void setMethod(String JavaDoc method) {}
227     public void setRequestedSessionCookie(boolean flag) {}
228     public void setRequestedSessionId(String JavaDoc id) {}
229     public void setRequestedSessionURL(boolean flag) {}
230     public void setRequestURI(String JavaDoc uri) {}
231     public void setSecure(boolean secure) {}
232     public void setUserPrincipal(Principal JavaDoc principal) {}
233     public String JavaDoc getParameter(String JavaDoc name) { return null; }
234     public Map JavaDoc getParameterMap() { return null; }
235     public Enumeration JavaDoc getParameterNames() { return dummyEnum; }
236     public String JavaDoc[] getParameterValues(String JavaDoc name) { return null; }
237     public RequestDispatcher JavaDoc getRequestDispatcher(String JavaDoc path) {
238         return null;
239     }
240     public String JavaDoc getAuthType() { return null; }
241     public Cookie JavaDoc[] getCookies() { return null; }
242     public long getDateHeader(String JavaDoc name) { return -1; }
243     public String JavaDoc getHeader(String JavaDoc name) { return null; }
244     public Enumeration JavaDoc getHeaders(String JavaDoc name) { return null; }
245     public Enumeration JavaDoc getHeaderNames() { return null; }
246     public int getIntHeader(String JavaDoc name) { return -1; }
247     public String JavaDoc getMethod() { return null; }
248     public String JavaDoc getPathTranslated() { return null; }
249     public String JavaDoc getRemoteUser() { return null; }
250     public String JavaDoc getRequestedSessionId() { return null; }
251     public String JavaDoc getRequestURI() { return null; }
252     public void setDecodedRequestURI(String JavaDoc uri) {}
253     public StringBuffer JavaDoc getRequestURL() { return null; }
254     public HttpSession JavaDoc getSession() { return null; }
255     public HttpSession JavaDoc getSession(boolean create) { return null; }
256     public boolean isRequestedSessionIdFromCookie() { return false; }
257     public boolean isRequestedSessionIdFromURL() { return false; }
258     public boolean isRequestedSessionIdFromUrl() { return false; }
259     public boolean isRequestedSessionIdValid() { return false; }
260     public boolean isUserInRole(String JavaDoc role) { return false; }
261     public Principal JavaDoc getUserPrincipal() { return null; }
262     public String JavaDoc getLocalAddr() { return null; }
263     public String JavaDoc getLocalName() { return null; }
264     public int getLocalPort() { return -1; }
265     public int getRemotePort() { return -1; }
266     
267 }
268
269
Popular Tags