KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > scoping > ScopedRequest


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow.scoping;
19
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21 import java.util.Map JavaDoc;
22
23
24 /**
25  * A wrapper around HttpServletRequest, associated with a given scope-key. All calls to setAttribute,
26  * getAttribute, removeAttribute, etc. are scoped to this object, while most other functionality
27  * delegates to the wrapped HttpServletRequest.
28  * Instances of this class also keep track of their own request-URIs, which are independent of the
29  * wrapped request-URIs.
30  */

31 public interface ScopedRequest
32         extends HttpServletRequest JavaDoc
33 {
34     public String JavaDoc AUTOSCOPE_PREFIX = "_autoscope_";
35     
36     
37     public void setRequestURI( String JavaDoc uri );
38
39     /**
40      * Adds a scope to "listen" to. This scope will see all request parameters from a ScopedRequest
41      * of the given scope.
42      */

43     public void addListenScope( Object JavaDoc scopeKey );
44     
45     public void doForward();
46
47     public String JavaDoc getForwardedURI();
48
49     /**
50      * @deprecated Use {@link ScopedResponse#didRedirect} instead.
51      */

52     public boolean didRedirect();
53     
54     /**
55      * Stores the current map of request attributes in the Session.
56      */

57     public void persistAttributes();
58
59     /**
60      * Restores the map of request attributes from a map saved in the Session.
61      */

62     public void restoreAttributes();
63     
64     public HttpServletRequest JavaDoc getOuterRequest();
65     
66     public Object JavaDoc getScopeKey();
67     
68     public void renameScope( Object JavaDoc newScopeKey );
69     
70     /**
71      * Makes this request listen to specially-prefixed request parameters.
72      */

73     public void setActiveRequest();
74     
75     public String JavaDoc getScopedName( String JavaDoc baseName );
76
77     public void registerOuterAttribute( String JavaDoc attrName );
78
79     public String JavaDoc getLocalParameter( String JavaDoc attrName );
80     public String JavaDoc getListenScopeParameter( String JavaDoc attrName );
81     public boolean hasListenScopes();
82     
83     /**
84      * Same as <code>getAttribute</code>, but allows outer request attributes to be hidden explicitly, even if the implementation
85      * of getAttribute shows them by default.
86      */

87     public Object JavaDoc getAttribute( String JavaDoc attrName, boolean allowOuterRequestAttributes );
88     
89     /**
90      * @exclude
91      */

92     public Map JavaDoc filterParameterMap( Map JavaDoc parameterMap );
93     
94     /**
95      * Simply stores the URI that was being forwarded to.
96      */

97     public void setForwardedURI( String JavaDoc uri );
98 }
99
Popular Tags