KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > web > JacRequest


1 /*
2   Copyright (C) 2002 Laurent Martelli <laurent@aopsys.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program 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
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.aspects.gui.web;
19
20
21 /**
22  * This interface represents an HttpRequest.
23  */

24 public interface JacRequest {
25     /**
26      * Tells wether there is a parameter with a given name
27      * @param name the parameter's name whose presence to test
28      */

29     boolean contains(String JavaDoc name);
30
31     /**
32      * Returns a parameter. The result can be a String or a FileParameter object.
33      * @param name the name of the parameter
34      * @return the value of the parameter (a String a or FileParameter)
35      * if the parameter exists in the request, null otherwise.
36      */

37     Object JavaDoc getParameter(String JavaDoc name);
38
39     /**
40      * Returns a parameter. The result can be a String or a FileParameter object.
41      * @param name the name of the parameter
42      * @return the value of the parameter (a String a or FileParameter)
43      * if the parameter exists in the request, null otherwise.
44      */

45     Object JavaDoc[] getParameters(String JavaDoc name);
46
47     /**
48      * Tells if the user agent of the request is Internet Explorer
49      *
50      * @return true if the user agent is Internet Explorer, false otherwise
51      * @see #userAgentMatch(String)
52      */

53     boolean isIEUserAgent();
54
55     /**
56      * Tells if the user agent contains a given string
57      *
58      * @param s string to be searched in user agent
59      * @return true if the user agent is Internet Explorer, false otherwise
60      */

61     boolean userAgentMatch(String JavaDoc s);
62
63     /**
64      * Returns the user agent of this request
65      * @return the user agent of this request
66      */

67     String JavaDoc getUserAgent();
68    
69     /**
70      * Gets the value of a header.
71      *
72      * @param name name of the header
73      * @return the value of the header
74      */

75     String JavaDoc getHeader(String JavaDoc name);
76
77     /**
78      * Makes the current requesting thread block and wait until the
79      * response is available.
80      *
81      * <p>The thread that call this method waits until a call to
82      * <code>setResponse</code> occurs or a timeout occurs.
83      *
84      * @return false if a timeout occured, true otherwise.
85      *
86      * @see #setResponse()
87      */

88     boolean waitForResponse();
89
90     /**
91      * Unblock a thread that was blocked by a <code>waitForResult</code> call.
92      *
93      * @see #waitForResponse()
94      */

95     void setResponse();
96
97 }
98
Popular Tags