2
* JBoss, Home of Professional Open Source
3
* Copyright 2005, JBoss Inc., and individual contributors as indicated
4
* by the @authors tag. See the copyright.txt in the distribution for a
5
* full listing of individual contributors.
7
* This is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License as
9
* published by the Free Software Foundation; either version 2.1 of
10
* the License, or (at your option) any later version.
12
* This software is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this software; if not, write to the Free
19
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
22
package org.jboss.remoting.transport.coyote;
24
import java.io.InputStream;
25
import java.util.Collection;
26
import java.util.HashMap;
29
import org.apache.tomcat.util.buf.B2CConverter;
31
public class RequestMap implements Map
34
Map internalMap = new HashMap();
37
* The associated input buffer.
39
protected InputBuffer inputBuffer = new InputBuffer();
44
protected CoyoteInputStream inputStream =
45
new CoyoteInputStream(inputBuffer);
50
protected org.apache.coyote.Request coyoteRequest;
53
* Set the Coyote request.
55
* @param coyoteRequest The Coyote request
57
public void setCoyoteRequest(org.apache.coyote.Request coyoteRequest)
59
this.coyoteRequest = coyoteRequest;
60
inputBuffer.setRequest(coyoteRequest);
64
* Get the Coyote request.
66
public org.apache.coyote.Request getCoyoteRequest()
68
return (this.coyoteRequest);
72
* Get the input stream.
74
public InputStream getInputStream()
76
return (this.inputStream);
80
* URI byte to char converter (not recycled).
82
protected B2CConverter URIConverter = null;
85
* Return the URI converter.
87
protected B2CConverter getURIConverter()
93
* Set the URI converter.
95
* @param URIConverter the new URI connverter
97
protected void setURIConverter(B2CConverter URIConverter)
99
this.URIConverter = URIConverter;
102
public void recycle()
104
inputBuffer.recycle();
110
return internalMap.size();
113
public boolean isEmpty()
115
return internalMap.isEmpty();
118
public boolean containsKey(Object key)
120
return internalMap.containsKey(key);
123
public boolean containsValue(Object value)
125
return internalMap.containsValue(value);
128
public Object get(Object key)
130
if("MethodType".equals(key))
132
return coyoteRequest.method().toString();
134
else if("Path".equals(key))
136
return coyoteRequest.decodedURI().toString();
138
else if("HttpVersion".equals(key))
140
return coyoteRequest.protocol().toString();
144
Object value = internalMap.get(key);
151
return coyoteRequest.getHeader(String.valueOf(key));
156
public Object put(Object arg0, Object arg1)
158
return internalMap.put(arg0, arg1);
161
public Object remove(Object key)
163
return internalMap.remove(key);
166
public void putAll(Map arg0)
168
internalMap.putAll(arg0);
178
return internalMap.keySet();
181
public Collection values()
183
return internalMap.values();
186
public Set entrySet()
188
return internalMap.entrySet();