001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.catalina;
018:
019: import java.security.Principal;
020: import java.util.Locale;
021:
022: import javax.servlet.http.Cookie;
023:
024: import org.apache.tomcat.util.buf.MessageBytes;
025:
026: /**
027: * An <b>HttpRequest</b> is the Catalina internal facade for an
028: * <code>HttpServletRequest</code> that is to be processed, in order to
029: * produce the corresponding <code>HttpResponse</code>.
030: *
031: * @author Craig R. McClanahan
032: * @version $Revision: 1.4 $ $Date: 2004/02/27 14:58:38 $
033: */
034:
035: public interface HttpRequest extends Request {
036:
037: // --------------------------------------------------------- Public Methods
038:
039: /**
040: * Add a Cookie to the set of Cookies associated with this Request.
041: *
042: * @param cookie The new cookie
043: */
044: public void addCookie(Cookie cookie);
045:
046: /**
047: * Add a Header to the set of Headers associated with this Request.
048: *
049: * @param name The new header name
050: * @param value The new header value
051: */
052: public void addHeader(String name, String value);
053:
054: /**
055: * Add a Locale to the set of preferred Locales for this Request. The
056: * first added Locale will be the first one returned by getLocales().
057: *
058: * @param locale The new preferred Locale
059: */
060: public void addLocale(Locale locale);
061:
062: /**
063: * Add a parameter name and corresponding set of values to this Request.
064: * (This is used when restoring the original request on a form based
065: * login).
066: *
067: * @param name Name of this request parameter
068: * @param values Corresponding values for this request parameter
069: */
070: public void addParameter(String name, String values[]);
071:
072: /**
073: * Clear the collection of Cookies associated with this Request.
074: */
075: public void clearCookies();
076:
077: /**
078: * Clear the collection of Headers associated with this Request.
079: */
080: public void clearHeaders();
081:
082: /**
083: * Clear the collection of Locales associated with this Request.
084: */
085: public void clearLocales();
086:
087: /**
088: * Clear the collection of parameters associated with this Request.
089: */
090: public void clearParameters();
091:
092: /**
093: * Set the authentication type used for this request, if any; otherwise
094: * set the type to <code>null</code>. Typical values are "BASIC",
095: * "DIGEST", or "SSL".
096: *
097: * @param type The authentication type used
098: */
099: public void setAuthType(String type);
100:
101: /**
102: * Get the context path.
103: *
104: * @return the context path
105: */
106: public MessageBytes getContextPathMB();
107:
108: /**
109: * Set the context path for this Request. This will normally be called
110: * when the associated Context is mapping the Request to a particular
111: * Wrapper.
112: *
113: * @param path The context path
114: */
115: public void setContextPath(String path);
116:
117: /**
118: * Set the HTTP request method used for this Request.
119: *
120: * @param method The request method
121: */
122: public void setMethod(String method);
123:
124: /**
125: * Set the query string for this Request. This will normally be called
126: * by the HTTP Connector, when it parses the request headers.
127: *
128: * @param query The query string
129: */
130: public void setQueryString(String query);
131:
132: /**
133: * Get the path info.
134: *
135: * @return the path info
136: */
137: public MessageBytes getPathInfoMB();
138:
139: /**
140: * Set the path information for this Request. This will normally be called
141: * when the associated Context is mapping the Request to a particular
142: * Wrapper.
143: *
144: * @param path The path information
145: */
146: public void setPathInfo(String path);
147:
148: /**
149: * Get the request path.
150: *
151: * @return the request path
152: */
153: public MessageBytes getRequestPathMB();
154:
155: /**
156: * Set a flag indicating whether or not the requested session ID for this
157: * request came in through a cookie. This is normally called by the
158: * HTTP Connector, when it parses the request headers.
159: *
160: * @param flag The new flag
161: */
162: public void setRequestedSessionCookie(boolean flag);
163:
164: /**
165: * Set the requested session ID for this request. This is normally called
166: * by the HTTP Connector, when it parses the request headers.
167: *
168: * @param id The new session id
169: */
170: public void setRequestedSessionId(String id);
171:
172: /**
173: * Set a flag indicating whether or not the requested session ID for this
174: * request came in through a URL. This is normally called by the
175: * HTTP Connector, when it parses the request headers.
176: *
177: * @param flag The new flag
178: */
179: public void setRequestedSessionURL(boolean flag);
180:
181: /**
182: * Set the unparsed request URI for this Request. This will normally be
183: * called by the HTTP Connector, when it parses the request headers.
184: *
185: * @param uri The request URI
186: */
187: public void setRequestURI(String uri);
188:
189: /**
190: * Set the decoded request URI.
191: *
192: * @param uri The decoded request URI
193: */
194: public void setDecodedRequestURI(String uri);
195:
196: /**
197: * Get the decoded request URI.
198: *
199: * @return the URL decoded request URI
200: */
201: public String getDecodedRequestURI();
202:
203: /**
204: * Get the decoded request URI.
205: *
206: * @return the URL decoded request URI
207: */
208: public MessageBytes getDecodedRequestURIMB();
209:
210: /**
211: * Get the servlet path.
212: *
213: * @return the servlet path
214: */
215: public MessageBytes getServletPathMB();
216:
217: /**
218: * Set the servlet path for this Request. This will normally be called
219: * when the associated Context is mapping the Request to a particular
220: * Wrapper.
221: *
222: * @param path The servlet path
223: */
224: public void setServletPath(String path);
225:
226: /**
227: * Set the Principal who has been authenticated for this Request. This
228: * value is also used to calculate the value to be returned by the
229: * <code>getRemoteUser()</code> method.
230: *
231: * @param principal The user Principal
232: */
233: public void setUserPrincipal(Principal principal);
234:
235: }
|