KickJava   Java API By Example, From Geeks To Geeks.

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


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.io.InputStream JavaDoc;
33 import java.io.IOException JavaDoc;
34 import java.net.Socket JavaDoc;
35 import java.util.Iterator JavaDoc;
36 import javax.servlet.FilterChain JavaDoc;
37 import javax.servlet.ServletException JavaDoc;
38 import javax.servlet.ServletInputStream JavaDoc;
39 import javax.servlet.ServletRequest JavaDoc;
40
41
42 /**
43  * A <b>Request</b> is the Catalina-internal facade for a
44  * <code>ServletRequest</code> that is to be processed, in order to
45  * produce the corresponding <code>Response</code>.
46  *
47  * @author Craig R. McClanahan
48  * @version $Revision: 1.3 $ $Date: 2005/12/08 01:27:19 $
49  */

50
51 public interface Request {
52
53
54     // ------------------------------------------------------------- Properties
55

56
57     /**
58      * Return the authorization credentials sent with this request.
59      */

60     public String JavaDoc getAuthorization();
61
62
63     /**
64      * Set the authorization credentials sent with this request.
65      *
66      * @param authorization The new authorization credentials
67      */

68     public void setAuthorization(String JavaDoc authorization);
69
70
71     /**
72      * Return the Connector through which this Request was received.
73      */

74     public Connector getConnector();
75
76
77     /**
78      * Set the Connector through which this Request was received.
79      *
80      * @param connector The new connector
81      */

82     public void setConnector(Connector connector);
83
84
85     /**
86      * Return the Context within which this Request is being processed.
87      */

88     public Context getContext();
89
90
91     /**
92      * Set the Context within which this Request is being processed. This
93      * must be called as soon as the appropriate Context is identified, because
94      * it identifies the value to be returned by <code>getContextPath()</code>,
95      * and thus enables parsing of the request URI.
96      *
97      * @param context The newly associated Context
98      */

99     public void setContext(Context context);
100
101
102     /**
103      * Get filter chain associated with the request.
104      */

105     public FilterChain JavaDoc getFilterChain();
106
107
108     /**
109      * Set filter chain associated with the request.
110      *
111      * @param filterChain new filter chain
112      */

113     public void setFilterChain(FilterChain JavaDoc filterChain);
114
115
116     /**
117      * Return the Host within which this Request is being processed.
118      */

119     public Host getHost();
120
121
122     /**
123      * Set the Host within which this Request is being processed. This
124      * must be called as soon as the appropriate Host is identified, and
125      * before the Request is passed to a context.
126      *
127      * @param host The newly associated Host
128      */

129     public void setHost(Host host);
130
131
132     /**
133      * Return descriptive information about this Request implementation and
134      * the corresponding version number, in the format
135      * <code>&lt;description&gt;/&lt;version&gt;</code>.
136      */

137     public String JavaDoc getInfo();
138
139
140     /**
141      * Return the <code>ServletRequest</code> for which this object
142      * is the facade.
143      */

144     public ServletRequest JavaDoc getRequest();
145
146
147     /**
148      * Return the Response with which this Request is associated.
149      */

150     public Response getResponse();
151
152
153     /**
154      * Set the Response with which this Request is associated.
155      *
156      * @param response The new associated response
157      */

158     public void setResponse(Response response);
159
160
161     /**
162      * Return the Socket (if any) through which this Request was received.
163      * This should <strong>only</strong> be used to access underlying state
164      * information about this Socket, such as the SSLSession associated with
165      * an SSLSocket.
166      */

167     public Socket JavaDoc getSocket();
168
169
170     /**
171      * Set the Socket (if any) through which this Request was received.
172      *
173      * @param socket The socket through which this request was received
174      */

175     public void setSocket(Socket JavaDoc socket);
176
177
178     /**
179      * Return the input stream associated with this Request.
180      */

181     public InputStream JavaDoc getStream();
182
183
184     /**
185      * Set the input stream associated with this Request.
186      *
187      * @param stream The new input stream
188      */

189     public void setStream(InputStream JavaDoc stream);
190
191     // START OF IASRI 4665318
192
/**
193      * Get valve context.
194      */

195     public ValveContext getValveContext();
196
197
198     /**
199      * Set valve context.
200      *
201      * @param valveContext New valve context object
202      */

203     public void setValveContext(ValveContext valveContext);
204     // END OF IASRI 4665318
205

206
207     /**
208      * Return the Wrapper within which this Request is being processed.
209      */

210     public Wrapper getWrapper();
211
212
213     /**
214      * Set the Wrapper within which this Request is being processed. This
215      * must be called as soon as the appropriate Wrapper is identified, and
216      * before the Request is ultimately passed to an application servlet.
217      *
218      * @param wrapper The newly associated Wrapper
219      */

220     public void setWrapper(Wrapper wrapper);
221
222
223     // --------------------------------------------------------- Public Methods
224

225
226     /**
227      * Create and return a ServletInputStream to read the content
228      * associated with this Request.
229      *
230      * @exception IOException if an input/output error occurs
231      */

232     public ServletInputStream JavaDoc createInputStream() throws IOException JavaDoc;
233
234
235     /**
236      * Perform whatever actions are required to flush and close the input
237      * stream or reader, in a single operation.
238      *
239      * @exception IOException if an input/output error occurs
240      */

241     public void finishRequest() throws IOException JavaDoc;
242
243
244     /**
245      * Return the object bound with the specified name to the internal notes
246      * for this request, or <code>null</code> if no such binding exists.
247      *
248      * @param name Name of the note to be returned
249      */

250     public Object JavaDoc getNote(String JavaDoc name);
251
252
253     /**
254      * Return an Iterator containing the String names of all notes bindings
255      * that exist for this request.
256      */

257     public Iterator JavaDoc getNoteNames();
258
259
260     /**
261      * Release all object references, and initialize instance variables, in
262      * preparation for reuse of this object.
263      */

264     public void recycle();
265
266
267     /**
268      * Remove any object bound to the specified name in the internal notes
269      * for this request.
270      *
271      * @param name Name of the note to be removed
272      */

273     public void removeNote(String JavaDoc name);
274
275
276     /**
277      * Set the content length associated with this Request.
278      *
279      * @param length The new content length
280      */

281     public void setContentLength(int length);
282
283
284     /**
285      * Set the content type (and optionally the character encoding)
286      * associated with this Request. For example,
287      * <code>text/html; charset=ISO-8859-4</code>.
288      *
289      * @param type The new content type
290      */

291     public void setContentType(String JavaDoc type);
292
293
294     /**
295      * Bind an object to a specified name in the internal notes associated
296      * with this request, replacing any existing binding for this name.
297      *
298      * @param name Name to which the object should be bound
299      * @param value Object to be bound to the specified name
300      */

301     public void setNote(String JavaDoc name, Object JavaDoc value);
302
303
304     /**
305      * Set the protocol name and version associated with this Request.
306      *
307      * @param protocol Protocol name and version
308      */

309     public void setProtocol(String JavaDoc protocol);
310
311
312     /**
313      * Set the remote IP address associated with this Request. NOTE: This
314      * value will be used to resolve the value for <code>getRemoteHost()</code>
315      * if that method is called.
316      *
317      * @param remote The remote IP address
318      */

319     public void setRemoteAddr(String JavaDoc remote);
320
321
322     /**
323      * Set the name of the scheme associated with this request. Typical values
324      * are <code>http</code>, <code>https</code>, and <code>ftp</code>.
325      *
326      * @param scheme The scheme
327      */

328     public void setScheme(String JavaDoc scheme);
329
330
331     /**
332      * Set the value to be returned by <code>isSecure()</code>
333      * for this Request.
334      *
335      * @param secure The new isSecure value
336      */

337     public void setSecure(boolean secure);
338
339
340     /**
341      * Set the name of the server (virtual host) to process this request.
342      *
343      * @param name The server name
344      */

345     public void setServerName(String JavaDoc name);
346
347
348     /**
349      * Set the port number of the server to process this request.
350      *
351      * @param port The server port
352      */

353     public void setServerPort(int port);
354
355
356     // START SJSAS 6346226
357
/**
358      * Gets the jroute id of this request, which may have been
359      * sent as a separate <code>JROUTE</code> cookie or appended to the
360      * session identifier encoded in the URI (if cookies have been disabled).
361      *
362      * @return The jroute id of this request, or null if this request does not
363      * carry any jroute id
364      */

365     public String JavaDoc getJrouteId();
366     // END SJSAS 6346226
367

368 }
369
Popular Tags