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.HttpRequest;
019: import org.apache.openejb.server.httpd.HttpSession;
020:
021: import java.io.IOException;
022: import java.io.InputStream;
023: import java.net.URI;
024: import java.util.HashMap;
025: import java.util.Map;
026:
027: class Axis2Request implements HttpRequest {
028: private int contentLength;
029:
030: private String contentType;
031:
032: private InputStream in;
033:
034: private Method method;
035:
036: private Map<String, String> parameters;
037:
038: private URI uri;
039:
040: private Map<String, String> headers;
041:
042: private Map<String, Object> attributes;
043:
044: private String remoteAddress;
045:
046: public Axis2Request(int contentLength, String contentType,
047: InputStream in, Method method,
048: Map<String, String> parameters, URI uri,
049: Map<String, String> headers, String remoteAddress) {
050: this .contentLength = contentLength;
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<String, Object>();
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 headers.get(name);
071: }
072:
073: public InputStream getInputStream() throws IOException {
074: return in;
075: }
076:
077: public Method getMethod() {
078: return method;
079: }
080:
081: public String getParameter(String name) {
082: return 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: public HttpSession getSession(boolean create) {
110: throw new UnsupportedOperationException();
111: }
112:
113: public HttpSession getSession() {
114: throw new UnsupportedOperationException();
115: }
116: }
|