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.axis;
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: public class AxisResponse implements HttpResponse {
028: private int contentLength;
029: private String contentType;
030: private String host;
031: private OutputStream out;
032: private int method;
033: private Map<String, String> parameters;
034: private String path;
035: private URL uri;
036: private int port;
037: private Map<String, String> headers;
038: private int statusCode;
039: private String statusMessage;
040:
041: public AxisResponse(String contentType, String host, String path,
042: URL uri, int port, OutputStream out) {
043: this .contentType = contentType;
044: this .host = host;
045: this .parameters = new HashMap<String, String>();
046: this .path = path;
047: this .uri = uri;
048: this .port = port;
049: this .headers = new HashMap<String, String>();
050: this .out = out;
051: }
052:
053: public int getContentLength() {
054: return contentLength;
055: }
056:
057: public String getHeader(String name) {
058: return headers.get(name);
059: }
060:
061: public String getHost() {
062: return host;
063: }
064:
065: public OutputStream getOutputStream() {
066: return out;
067: }
068:
069: public int getMethod() {
070: return method;
071: }
072:
073: public String getParameter(String name) {
074: return parameters.get(name);
075: }
076:
077: public Map getParameters() {
078: return parameters;
079: }
080:
081: public String getPath() {
082: return path;
083: }
084:
085: public int getPort() {
086: return port;
087: }
088:
089: public URL getURI() {
090: return uri;
091: }
092:
093: public String getContentType() {
094: return contentType;
095: }
096:
097: public URL getUri() {
098: return uri;
099: }
100:
101: public void setContentLength(int i) {
102: contentLength = i;
103: }
104:
105: public void setContentType(String string) {
106: contentType = string;
107: }
108:
109: public void setHost(String string) {
110: host = string;
111: }
112:
113: public void setMethod(int i) {
114: method = i;
115: }
116:
117: public void setParameters(Map<String, String> map) {
118: parameters = map;
119: }
120:
121: public void setPath(String string) {
122: path = string;
123: }
124:
125: public void setPort(int i) {
126: port = i;
127: }
128:
129: public void setUri(URL url) {
130: uri = url;
131: }
132:
133: public int getStatusCode() {
134: return statusCode;
135: }
136:
137: public void setStatusCode(int code) {
138: statusCode = code;
139:
140: }
141:
142: public String getStatusMessage() {
143: return statusMessage;
144: }
145:
146: public void setStatusMessage(String responseString) {
147: statusMessage = responseString;
148:
149: }
150:
151: public void flushBuffer() throws java.io.IOException {
152: }
153:
154: public void setHeader(String name, String value) {
155: headers.put(name, value);
156: }
157:
158: public PrintWriter getPrintWriter() throws IOException {
159: throw new UnsupportedOperationException();
160: }
161: }
|