KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > core > helper > servlet > BarracudaServletRequestWrapper


1 /*
2  * Copyright (C) 2003 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: BarracudaServletRequestWrapper.java,v 1.2 2004/02/01 05:16:28 christianc Exp $
19  */

20 package org.enhydra.barracuda.core.helper.servlet;
21
22 import java.io.*;
23 import java.util.*;
24 import java.security.*;
25 import javax.servlet.*;
26 import javax.servlet.http.*;
27
28 import org.apache.log4j.Logger;
29
30 import org.enhydra.barracuda.core.helper.state.*;
31 import org.enhydra.barracuda.plankton.data.*;
32
33 /**
34  * <p>This class acts as a thin wrapper around a ServletRequest, adding several additional
35  * methods which enabled the request parameters to be modified programatically
36  *
37  * @author christianc@granitepeaks.com
38  * @since //csc_010404_1
39  */

40 public interface BarracudaServletRequestWrapper extends HttpServletRequest {
41
42     /**
43      * Set the underlying request method.
44      *
45      * @param method the underlying request method (GET, POST, etc)
46      */

47     public void setMethod(String JavaDoc method);
48
49     /**
50      * Set the underlying request object.
51      *
52      * @param ireq the underlying HttpServletRequest
53      */

54 // public void setRequest(ServletRequest ireq);
55

56     /**
57      * Set a given parameter (note that this is backed by a hashmap,
58      * so the structure is slightly different than that of the
59      * underlying ServletRequest which allows multiple paramters
60      * with the same name). This means that if you attempt to
61      * set a parameter whose key already exists you will effectively
62      * overwrite the existing value.
63      *
64      * @param name the key name for the parameter
65      * @param value the value associated with the given key
66      */

67     public void addParameter(String JavaDoc name, String JavaDoc value);
68
69     /**
70      * Remove the first parameter whose key matches the specified name
71      *
72      * @param name the key name for the parameter
73      */

74     public void removeParameter(String JavaDoc name);
75
76     /**
77      * Remove all parameters for a specified name
78      *
79      * @param name the key name for the parameter
80      */

81     public void removeAllParameters(String JavaDoc name);
82
83     /**
84      * Reset the parameter values to their original state
85      * (ie. the actual values in the request)
86      */

87     public void resetParameters();
88 }
Popular Tags