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.axis2;
017:
018: import java.io.IOException;
019: import java.io.InputStream;
020: import java.net.URI;
021: import java.util.HashMap;
022: import java.util.Map;
023:
024: import org.apache.geronimo.webservices.WebServiceContainer;
025:
026: class Axis2Request implements WebServiceContainer.Request {
027: private int contentLength;
028:
029: private String contentType;
030:
031: private InputStream in;
032:
033: private int method;
034:
035: private Map parameters;
036:
037: private URI uri;
038:
039: private Map headers;
040:
041: private Map attributes;
042:
043: private String remoteAddress;
044:
045: /**
046: *
047: */
048: public Axis2Request(int contentLength, String contentType,
049: InputStream in, int method, Map parameters, URI uri,
050: Map headers, String remoteAddress) {
051: this .contentType = contentType;
052: this .in = in;
053: this .method = method;
054: this .parameters = parameters;
055: this .uri = uri;
056: this .headers = headers;
057: this .attributes = new HashMap();
058: this .remoteAddress = remoteAddress;
059: }
060:
061: public int getContentLength() {
062: return contentLength;
063: }
064:
065: public String getContentType() {
066: return contentType;
067: }
068:
069: public String getHeader(String name) {
070: return (String) headers.get(name);
071: }
072:
073: public InputStream getInputStream() throws IOException {
074: return in;
075: }
076:
077: public int getMethod() {
078: return method;
079: }
080:
081: public String getParameter(String name) {
082: return (String) parameters.get(name);
083: }
084:
085: public Map getParameters() {
086: return parameters;
087: }
088:
089: public URI getURI() {
090: return uri;
091: }
092:
093: public Object getAttribute(String name) {
094: return attributes.get(name);
095: }
096:
097: public void setAttribute(String name, Object value) {
098: attributes.put(name, value);
099: }
100:
101: public String getRemoteAddr() {
102: return remoteAddress;
103: }
104:
105: public String getContextPath() {
106: return "/axis2";
107: }
108:
109: }
|