KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.servlet.http.Cookie JavaDoc;
33
34
35 /**
36  * An <b>HttpResponse</b> is the Catalina-internal facade for an
37  * <code>HttpServletResponse</code> that is to be produced,
38  * based on the processing of a corresponding <code>HttpRequest</code>.
39  *
40  * @author Craig R. McClanahan
41  * @version $Revision: 1.2 $ $Date: 2005/12/08 01:27:16 $
42  */

43
44 public interface HttpResponse
45     extends Response {
46
47
48     // --------------------------------------------------------- Public Methods
49

50
51     /**
52      * Return an array of all cookies set for this response, or
53      * a zero-length array if no cookies have been set.
54      */

55     public Cookie JavaDoc[] getCookies();
56
57
58     /**
59      * Return the value for the specified header, or <code>null</code> if this
60      * header has not been set. If more than one value was added for this
61      * name, only the first is returned; use getHeaderValues() to retrieve all
62      * of them.
63      *
64      * @param name Header name to look up
65      */

66     public String JavaDoc getHeader(String JavaDoc name);
67
68
69     /**
70      * Return an array of all the header names set for this response, or
71      * a zero-length array if no headers have been set.
72      */

73     public String JavaDoc[] getHeaderNames();
74
75
76     /**
77      * Return an array of all the header values associated with the
78      * specified header name, or an zero-length array if there are no such
79      * header values.
80      *
81      * @param name Header name to look up
82      */

83     public String JavaDoc[] getHeaderValues(String JavaDoc name);
84
85
86     /**
87      * Return the error message that was set with <code>sendError()</code>
88      * for this Response.
89      */

90     public String JavaDoc getMessage();
91
92
93     /**
94      * Return the HTTP status code associated with this Response.
95      */

96     public int getStatus();
97
98
99     /**
100      * Reset this response, and specify the values for the HTTP status code
101      * and corresponding message.
102      *
103      * @exception IllegalStateException if this response has already been
104      * committed
105      */

106     public void reset(int status, String JavaDoc message);
107
108
109 }
110
Popular Tags