001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.server.axis2;
017:
018: import org.apache.openejb.server.httpd.HttpResponse;
019:
020: import java.io.IOException;
021: import java.io.OutputStream;
022: import java.io.PrintWriter;
023: import java.net.URL;
024: import java.util.HashMap;
025: import java.util.Map;
026:
027: class Axis2Response implements HttpResponse {
028: private int contentLength;
029:
030: private String contentType;
031:
032: private String host;
033:
034: private OutputStream out;
035:
036: private int method;
037:
038: private Map<String, String> parameters;
039:
040: private String path;
041:
042: private URL uri;
043:
044: private int port;
045:
046: private Map<String, String> headers;
047:
048: private int statusCode;
049:
050: private String statusMessage;
051:
052: public Axis2Response(String contentType, String host, String path,
053: URL uri, int port, OutputStream out) {
054: this .contentType = contentType;
055: this .host = host;
056: this .parameters = new HashMap<String, String>();
057: this .path = path;
058: this .uri = uri;
059: this .port = port;
060: this .headers = new HashMap<String, String>();
061: this .out = out;
062: }
063:
064: public int getContentLength() {
065: return contentLength;
066: }
067:
068: public String getHeader(String name) {
069: return headers.get(name);
070: }
071:
072: public String getHost() {
073: return host;
074: }
075:
076: public OutputStream getOutputStream() {
077: return out;
078: }
079:
080: public int getMethod() {
081: return method;
082: }
083:
084: public String getParameter(String name) {
085: return parameters.get(name);
086: }
087:
088: public Map getParameters() {
089: return parameters;
090: }
091:
092: public String getPath() {
093: return path;
094: }
095:
096: public int getPort() {
097: return port;
098: }
099:
100: public URL getURI() {
101: return uri;
102: }
103:
104: public String getContentType() {
105: return contentType;
106: }
107:
108: public URL getUri() {
109: return uri;
110: }
111:
112: public void setContentLength(int i) {
113: contentLength = i;
114: }
115:
116: public void setContentType(String string) {
117: contentType = string;
118: }
119:
120: public void setHost(String string) {
121: host = string;
122: }
123:
124: public void setMethod(int i) {
125: method = i;
126: }
127:
128: public void setParameters(Map<String, String> map) {
129: parameters = map;
130: }
131:
132: public void setPath(String string) {
133: path = string;
134: }
135:
136: public void setPort(int i) {
137: port = i;
138: }
139:
140: public void setUri(URL url) {
141: uri = url;
142: }
143:
144: public int getStatusCode() {
145: return statusCode;
146: }
147:
148: public void setStatusCode(int code) {
149: statusCode = code;
150: }
151:
152: public String getStatusMessage() {
153: return statusMessage;
154: }
155:
156: public void setStatusMessage(String responseString) {
157: statusMessage = responseString;
158: }
159:
160: public void flushBuffer() throws java.io.IOException {
161: }
162:
163: public void setHeader(String name, String value) {
164: headers.put(name, value);
165: }
166:
167: public PrintWriter getPrintWriter() throws IOException {
168: throw new UnsupportedOperationException();
169: }
170: }
|