01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: *
19: */
20: package org.safehaus.asyncweb.common;
21:
22: import java.io.UnsupportedEncodingException;
23: import java.net.URI;
24: import java.util.List;
25: import java.util.Map;
26:
27: /**
28: * A mutable {@link HttpRequest}.
29: * @author trustin
30: * @version $Rev: 240 $, $Date: 2007-09-26 14:53:47 -0700 (Wed, 26 Sep 2007) $
31: */
32: public interface MutableHttpRequest extends MutableHttpMessage,
33: HttpRequest {
34:
35: /**
36: * Sets the cookies of this message by parsing the specified <tt>headerValue</tt>.
37: */
38: void setCookies(String headerValue);
39:
40: /**
41: * Adds a query parameter to this request.
42: * Adding a query parameter does not cause any existing parameters with the
43: * same name to be overwritten
44: *
45: * @param name The header name
46: * @param value The header value
47: */
48: void addParameter(String name, String value);
49:
50: /**
51: * Removes all query parameters with the specified name.
52: */
53: boolean removeParameter(String name);
54:
55: /**
56: * Sets the value of a query parameter.
57: * Any existing query parameters with the specified name are removed.
58: */
59: void setParameter(String name, String value);
60:
61: /**
62: * Sets query parameters with the specified {@link Map} whose key is a {@link String} and
63: * whose value is a {@link List} of {@link String}s.
64: */
65: void setParameters(Map<String, List<String>> parameters);
66:
67: /**
68: * Sets query parameters from the specified <tt>queryString</tt> which is encoded with UTF-8
69: * encoding.
70: */
71: void setParameters(String queryString);
72:
73: /**
74: * Sets query parameters from the specified <tt>queryString</tt> which is encoded with the
75: * specified charset <tt>encoding</tt>.
76: */
77: void setParameters(String queryString, String encoding)
78: throws UnsupportedEncodingException;
79:
80: /**
81: * Removes all query parameters from this request.
82: */
83: void clearParameters();
84:
85: /**
86: * Sets the {@link HttpMethod} associated with this request.
87: */
88: void setMethod(HttpMethod method);
89:
90: /**
91: * Sets the URI of the request.
92: */
93: void setRequestUri(URI requestUri);
94: }
|