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.server.httpd;
17:
18: import java.io.IOException;
19:
20: /**
21: * This interface takes care of HTTP Responses. It sends data back to the browser.
22: */
23: public interface HttpResponse extends java.io.Serializable {
24: /**
25: * Gets a header based on the name passed in
26: * @param name the header name
27: * @return the header value
28: */
29: public String getHeader(String name);
30:
31: /**
32: * Sets a header to be sent back to the browser
33: * @param name the header name
34: * @param value the header value
35: */
36: public void setHeader(String name, String value);
37:
38: /**
39: * Gets the PrintWriter to send data to the browser
40: * @return the PrintWriter to send data to the browser
41: */
42: public java.io.PrintWriter getPrintWriter() throws IOException;
43:
44: /**
45: * Gets the OutputStream to send data to the browser
46: * @return the OutputStream to send data to the browser
47: */
48: public java.io.OutputStream getOutputStream();
49:
50: /**
51: * Gets the content type that will be sent to the browser.
52: * @return the content type (i.e. "text/html")
53: */
54: public String getContentType();
55:
56: /**
57: * Sets the content type to be sent back to the browser.
58: * @param type the type to be sent to the browser (i.e. "text/html")
59: */
60: public void setContentType(String type);
61:
62: /**
63: * Gets the response status code that will be sent to the browser
64: * @return the HTTP status code
65: */
66: int getStatusCode();
67:
68: /**
69: * Sets the HTTP response status code to be sent to the browser.
70: * @param code the status code to be sent to the browser
71: */
72: void setStatusCode(int code);
73:
74: /**
75: * Sets the response string to be sent to the browser
76: * @param responseString the response string
77: */
78: void setStatusMessage(String responseString);
79:
80: /**
81: * Flushes the output buffer to the client.
82: */
83: void flushBuffer() throws IOException;
84: }
|