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.geronimo.axis;
017:
018: import java.io.OutputStream;
019: import java.net.URL;
020: import java.util.HashMap;
021: import java.util.Map;
022:
023: import org.apache.geronimo.webservices.WebServiceContainer;
024:
025: public class AxisResponse implements WebServiceContainer.Response {
026: private int contentLength;
027: private String contentType;
028: private String host;
029: private OutputStream out;
030: private int method;
031: private Map parameters;
032: private String path;
033: private URL uri;
034: private int port;
035: private Map headers;
036: private int statusCode;
037: private String statusMessage;
038:
039: /**
040: *
041: */
042: public AxisResponse(String contentType, String host, String path,
043: URL uri, int port, OutputStream out) {
044: this .contentType = contentType;
045: this .host = host;
046: this .parameters = new HashMap();
047: this .path = path;
048: this .uri = uri;
049: this .port = port;
050: this .headers = new HashMap();
051: this .out = out;
052: }
053:
054: public int getContentLength() {
055: return contentLength;
056: }
057:
058: public String getHeader(String name) {
059: return (String) headers.get(name);
060: }
061:
062: public String getHost() {
063: return host;
064: }
065:
066: public OutputStream getOutputStream() {
067: return out;
068: }
069:
070: public int getMethod() {
071: return method;
072: }
073:
074: public String getParameter(String name) {
075: return (String) parameters.get(name);
076: }
077:
078: public Map getParameters() {
079: return parameters;
080: }
081:
082: public String getPath() {
083: return path;
084: }
085:
086: public int getPort() {
087: return port;
088: }
089:
090: public URL getURI() {
091: return uri;
092: }
093:
094: /**
095: * @return
096: */
097: public String getContentType() {
098: return contentType;
099: }
100:
101: /**
102: * @return
103: */
104: public URL getUri() {
105: return uri;
106: }
107:
108: /**
109: * @param i
110: */
111: public void setContentLength(int i) {
112: contentLength = i;
113: }
114:
115: /**
116: * @param string
117: */
118: public void setContentType(String string) {
119: contentType = string;
120: }
121:
122: /**
123: * @param string
124: */
125: public void setHost(String string) {
126: host = string;
127: }
128:
129: /**
130: * @param i
131: */
132: public void setMethod(int i) {
133: method = i;
134: }
135:
136: /**
137: * @param map
138: */
139: public void setParameters(Map map) {
140: parameters = map;
141: }
142:
143: /**
144: * @param string
145: */
146: public void setPath(String string) {
147: path = string;
148: }
149:
150: /**
151: * @param i
152: */
153: public void setPort(int i) {
154: port = i;
155: }
156:
157: /**
158: * @param url
159: */
160: public void setUri(URL url) {
161: uri = url;
162: }
163:
164: public int getStatusCode() {
165: return statusCode;
166: }
167:
168: public void setStatusCode(int code) {
169: statusCode = code;
170:
171: }
172:
173: public void setStatusMessage(String responseString) {
174: statusMessage = responseString;
175:
176: }
177:
178: public void flushBuffer() throws java.io.IOException {
179: }
180:
181: public void setHeader(String name, String value) {
182: headers.put(name, value);
183:
184: }
185:
186: }
|