KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > HttpRequest


1
2
3 /*
4  * The contents of this file are subject to the terms
5  * of the Common Development and Distribution License
6  * (the "License"). You may not use this file except
7  * in compliance with the License.
8  *
9  * You can obtain a copy of the license at
10  * glassfish/bootstrap/legal/CDDLv1.0.txt or
11  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
12  * See the License for the specific language governing
13  * permissions and limitations under the License.
14  *
15  * When distributing Covered Code, include this CDDL
16  * HEADER in each file and include the License file at
17  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
18  * add the following below this CDDL HEADER, with the
19  * fields enclosed by brackets "[]" replaced with your
20  * own identifying information: Portions Copyright [yyyy]
21  * [name of copyright owner]
22  *
23  * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24  *
25  * Portions Copyright Apache Software Foundation.
26  */

27
28
29 package org.apache.catalina;
30
31
32 import java.security.Principal JavaDoc;
33 import java.util.Locale JavaDoc;
34
35 import javax.servlet.http.Cookie JavaDoc;
36
37 import org.apache.tomcat.util.buf.MessageBytes;
38
39 /**
40  * An <b>HttpRequest</b> is the Catalina internal facade for an
41  * <code>HttpServletRequest</code> that is to be processed, in order to
42  * produce the corresponding <code>HttpResponse</code>.
43  *
44  * @author Craig R. McClanahan
45  * @version $Revision: 1.2 $ $Date: 2005/12/08 01:27:16 $
46  */

47
48 public interface HttpRequest extends Request {
49
50
51     // --------------------------------------------------------- Public Methods
52

53
54     /**
55      * Add a Cookie to the set of Cookies associated with this Request.
56      *
57      * @param cookie The new cookie
58      */

59     public void addCookie(Cookie JavaDoc cookie);
60
61
62     /**
63      * Add a Header to the set of Headers associated with this Request.
64      *
65      * @param name The new header name
66      * @param value The new header value
67      */

68     public void addHeader(String JavaDoc name, String JavaDoc value);
69
70
71     /**
72      * Add a Locale to the set of preferred Locales for this Request. The
73      * first added Locale will be the first one returned by getLocales().
74      *
75      * @param locale The new preferred Locale
76      */

77     public void addLocale(Locale JavaDoc locale);
78
79
80     /**
81      * Add a parameter name and corresponding set of values to this Request.
82      * (This is used when restoring the original request on a form based
83      * login).
84      *
85      * @param name Name of this request parameter
86      * @param values Corresponding values for this request parameter
87      */

88     public void addParameter(String JavaDoc name, String JavaDoc values[]);
89
90
91     /**
92      * Clear the collection of Cookies associated with this Request.
93      */

94     public void clearCookies();
95
96
97     /**
98      * Clear the collection of Headers associated with this Request.
99      */

100     public void clearHeaders();
101
102
103     /**
104      * Clear the collection of Locales associated with this Request.
105      */

106     public void clearLocales();
107
108
109     /**
110      * Clear the collection of parameters associated with this Request.
111      */

112     public void clearParameters();
113
114
115     /**
116      * Set the authentication type used for this request, if any; otherwise
117      * set the type to <code>null</code>. Typical values are "BASIC",
118      * "DIGEST", or "SSL".
119      *
120      * @param type The authentication type used
121      */

122     public void setAuthType(String JavaDoc type);
123
124
125     /**
126      * Get the context path.
127      *
128      * @return the context path
129      */

130     public MessageBytes getContextPathMB();
131
132
133     /**
134      * Set the context path for this Request. This will normally be called
135      * when the associated Context is mapping the Request to a particular
136      * Wrapper.
137      *
138      * @param path The context path
139      */

140     public void setContextPath(String JavaDoc path);
141
142
143     /**
144      * Set the HTTP request method used for this Request.
145      *
146      * @param method The request method
147      */

148     public void setMethod(String JavaDoc method);
149
150
151     /**
152      * Set the query string for this Request. This will normally be called
153      * by the HTTP Connector, when it parses the request headers.
154      *
155      * @param query The query string
156      */

157     public void setQueryString(String JavaDoc query);
158
159
160     /**
161      * Get the path info.
162      *
163      * @return the path info
164      */

165     public MessageBytes getPathInfoMB();
166
167
168     /**
169      * Set the path information for this Request. This will normally be called
170      * when the associated Context is mapping the Request to a particular
171      * Wrapper.
172      *
173      * @param path The path information
174      */

175     public void setPathInfo(String JavaDoc path);
176
177
178     /**
179      * Get the request path.
180      *
181      * @return the request path
182      */

183     public MessageBytes getRequestPathMB();
184
185
186     /**
187      * Set a flag indicating whether or not the requested session ID for this
188      * request came in through a cookie. This is normally called by the
189      * HTTP Connector, when it parses the request headers.
190      *
191      * @param flag The new flag
192      */

193     public void setRequestedSessionCookie(boolean flag);
194
195
196     /**
197      * Set the requested session ID for this request. This is normally called
198      * by the HTTP Connector, when it parses the request headers.
199      *
200      * @param id The new session id
201      */

202     public void setRequestedSessionId(String JavaDoc id);
203
204
205     /**
206      * Set a flag indicating whether or not the requested session ID for this
207      * request came in through a URL. This is normally called by the
208      * HTTP Connector, when it parses the request headers.
209      *
210      * @param flag The new flag
211      */

212     public void setRequestedSessionURL(boolean flag);
213
214
215     /**
216      * Set the unparsed request URI for this Request. This will normally be
217      * called by the HTTP Connector, when it parses the request headers.
218      *
219      * @param uri The request URI
220      */

221     public void setRequestURI(String JavaDoc uri);
222
223
224     /**
225      * Set the decoded request URI.
226      *
227      * @param uri The decoded request URI
228      */

229     public void setDecodedRequestURI(String JavaDoc uri);
230
231
232     /**
233      * Get the decoded request URI.
234      *
235      * @return the URL decoded request URI
236      */

237     public String JavaDoc getDecodedRequestURI();
238
239
240     /**
241      * Get the decoded request URI.
242      *
243      * @return the URL decoded request URI
244      */

245     public MessageBytes getDecodedRequestURIMB();
246
247
248     /**
249      * Get the servlet path.
250      *
251      * @return the servlet path
252      */

253     public MessageBytes getServletPathMB();
254
255
256     /**
257      * Set the servlet path for this Request. This will normally be called
258      * when the associated Context is mapping the Request to a particular
259      * Wrapper.
260      *
261      * @param path The servlet path
262      */

263     public void setServletPath(String JavaDoc path);
264
265
266     /**
267      * Set the Principal who has been authenticated for this Request. This
268      * value is also used to calculate the value to be returned by the
269      * <code>getRemoteUser()</code> method.
270      *
271      * @param principal The user Principal
272      */

273     public void setUserPrincipal(Principal JavaDoc principal);
274
275
276 }
277
Popular Tags