001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020
021package org.apache.mina.http.api;
022
023import java.util.List;
024import java.util.Map;
025
026/**
027 * An HTTP request
028 * 
029 * @author jvermillar
030 * 
031 */
032public interface HttpRequest extends HttpMessage {
033
034    /**
035     * Determines whether this request contains at least one parameter with the specified name
036     * 
037     * @param name The parameter name
038     * @return <tt>true</tt> if this request contains at least one parameter with the specified name
039     */
040    boolean containsParameter(String name);
041
042    /**
043     * Returns the value of a request parameter as a String, or null if the parameter does not exist.
044     * 
045     * If the request contained multiple parameters with the same name, this method returns the first parameter
046     * encountered in the request with the specified name
047     * 
048     * @param name The parameter name
049     * @return The value
050     */
051    String getParameter(String name);
052    
053    String getQueryString();
054
055    /**
056     * @return a read only {@link Map} of query parameters whose key is a {@link String} and whose value is a
057     * {@link List} of {@link String}s.
058     */
059    Map<String, List<String>> getParameters();
060
061    /**
062     * Return the HTTP method used for this message {@link HttpMethod}
063     * 
064     * @return the method
065     */
066    HttpMethod getMethod();
067    
068    /**
069     * Retrurn the HTTP request path
070     * @return the request path
071     */
072    String getRequestPath();
073}