KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > axis > AxisResponse


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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  */

17 package org.apache.geronimo.axis;
18 import java.io.OutputStream JavaDoc;
19 import java.net.URL JavaDoc;
20 import java.util.HashMap JavaDoc;
21 import java.util.Map JavaDoc;
22
23 import org.apache.geronimo.webservices.WebServiceContainer;
24
25 public class AxisResponse implements WebServiceContainer.Response {
26     private int contentLength;
27     private String JavaDoc contentType;
28     private String JavaDoc host;
29     private OutputStream JavaDoc out;
30     private int method;
31     private Map JavaDoc parameters;
32     private String JavaDoc path;
33     private URL JavaDoc uri;
34     private int port;
35     private Map JavaDoc headers;
36     private int statusCode;
37     private String JavaDoc statusMessage;
38
39     /**
40      *
41      */

42     public AxisResponse(String JavaDoc contentType,
43         String JavaDoc host,
44         String JavaDoc path,
45         URL JavaDoc uri,
46         int port,
47         OutputStream JavaDoc out) {
48         this.contentType = contentType;
49         this.host = host;
50         this.parameters = new HashMap JavaDoc();
51         this.path = path;
52         this.uri = uri;
53         this.port = port;
54         this.headers = new HashMap JavaDoc();
55         this.out = out;
56     }
57
58     public int getContentLength() {
59         return contentLength;
60     }
61
62
63     public String JavaDoc getHeader(String JavaDoc name) {
64         return (String JavaDoc) headers.get(name);
65     }
66
67     public String JavaDoc getHost() {
68         return host;
69     }
70
71     public OutputStream JavaDoc getOutputStream() {
72         return out;
73     }
74
75     public int getMethod() {
76         return method;
77     }
78
79     public String JavaDoc getParameter(String JavaDoc name) {
80         return (String JavaDoc) parameters.get(name);
81     }
82
83     public Map JavaDoc getParameters() {
84         return parameters;
85     }
86
87     public String JavaDoc getPath() {
88         return path;
89     }
90
91     public int getPort() {
92         return port;
93     }
94
95     public URL JavaDoc getURI() {
96         return uri;
97     }
98
99     /**
100      * @return
101      */

102     public String JavaDoc getContentType() {
103         return contentType;
104     }
105
106     /**
107      * @return
108      */

109     public URL JavaDoc getUri() {
110         return uri;
111     }
112
113     /**
114      * @param i
115      */

116     public void setContentLength(int i) {
117         contentLength = i;
118     }
119
120     /**
121      * @param string
122      */

123     public void setContentType(String JavaDoc string) {
124         contentType = string;
125     }
126
127     /**
128      * @param string
129      */

130     public void setHost(String JavaDoc string) {
131         host = string;
132     }
133
134     /**
135      * @param i
136      */

137     public void setMethod(int i) {
138         method = i;
139     }
140
141     /**
142      * @param map
143      */

144     public void setParameters(Map JavaDoc map) {
145         parameters = map;
146     }
147
148     /**
149      * @param string
150      */

151     public void setPath(String JavaDoc string) {
152         path = string;
153     }
154
155     /**
156      * @param i
157      */

158     public void setPort(int i) {
159         port = i;
160     }
161
162     /**
163      * @param url
164      */

165     public void setUri(URL JavaDoc url) {
166         uri = url;
167     }
168
169     public int getStatusCode() {
170         return statusCode;
171     }
172
173     public void setStatusCode(int code) {
174         statusCode = code;
175
176     }
177
178     public void setStatusMessage(String JavaDoc responseString) {
179         statusMessage = responseString;
180
181     }
182
183     public void setHeader(String JavaDoc name, String JavaDoc value) {
184         headers.put(name,value);
185
186     }
187
188 }
189
Popular Tags