01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.openejb.webadmin;
17:
18: /**This interface takes care of HTTP Responses. It sends data back to the browser.
19: *
20: * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
21: */
22: public interface HttpResponse extends java.io.Serializable {
23: /** sets a header to be sent back to the browser
24: * @param name the name of the header
25: * @param value the value of the header
26: */
27: public void setHeader(String name, String value);
28:
29: /** Gets a header based on the name passed in
30: * @param name The name of the header
31: * @return the value of the header
32: */
33: public String getHeader(String name);
34:
35: /** Gets the PrintWriter to send data to the browser
36: * @return the PrintWriter to send data to the browser
37: */
38: public java.io.PrintWriter getPrintWriter();
39:
40: /** gets the OutputStream to send data to the browser
41: * @return the OutputStream to send data to the browser
42: */
43: public java.io.OutputStream getOutputStream();
44:
45: /** sets the HTTP response code to be sent to the browser. These codes are:
46: *
47: * OPTIONS = 0
48: * GET = 1
49: * HEAD = 2
50: * POST = 3
51: * PUT = 4
52: * DELETE = 5
53: * TRACE = 6
54: * CONNECT = 7
55: * UNSUPPORTED = 8
56: * @param code the code to be sent to the browser
57: */
58: public void setCode(int code);
59:
60: /** gets the HTTP response code
61: * @return the HTTP response code
62: */
63: public int getCode();
64:
65: /** sets the content type to be sent back to the browser
66: * @param type the type to be sent to the browser (i.e. "text/html")
67: */
68: public void setContentType(String type);
69:
70: /** gets the content type that will be sent to the browser
71: * @return the content type (i.e. "text/html")
72: */
73: public String getContentType();
74:
75: /** Sets the response string to be sent to the browser
76: * @param responseString the response string
77: */
78: public void setResponseString(String responseString);
79:
80: /** resets the data to be sent to the browser */
81: public void reset();
82:
83: /** resets the data to be sent to the browser with the response code and response
84: * string
85: * @param code the code to be sent to the browser
86: * @param responseString the response string to be sent to the browser
87: */
88: public void reset(int code, String responseString);
89:
90: /** gets the name of the server being used
91: * @return the name of the server
92: */
93: public String getServerName();
94: }
|