001: /*
002: * Copyright 1999-2004 The Apache Software Foundation
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.commons.chain.web;
017:
018: import java.util.Map;
019: import org.apache.commons.chain.impl.ContextBase;
020:
021: /**
022: * <p>Abstract base implementation of {@link org.apache.commons.chain.Context} that
023: * provides web based applications that use it a "generic" view of HTTP related
024: * requests and responses, without tying the application to a particular underlying
025: * Java API (such as servlets). It is expected that a concrete subclass
026: * of {@link WebContext} for each API (such as
027: * {@link org.apache.commons.chain.web.servlet.ServletWebContext})
028: * will support adapting that particular API's implementation of request
029: * and response objects into this generic framework.</p>
030: *
031: * <p>The characteristics of a web request/response are made visible via
032: * a series of JavaBeans properties (and mapped to read-only attributes
033: * of the same name, as supported by {@link ContextBase}.</p>
034: *
035: * @author Craig R. McClanahan
036: * @version $Revision: 411948 $ $Date: 2006-06-06 00:29:02 +0100 (Tue, 06 Jun 2006) $
037: */
038:
039: public abstract class WebContext extends ContextBase {
040:
041: // ---------------------------------------------------------- Public Methods
042:
043: /**
044: * <p>Return a mutable <code>Map</code> that maps application scope
045: * attribute names to their values.</p>
046: *
047: * @return Application scope Map.
048: */
049: public abstract Map getApplicationScope();
050:
051: /**
052: * <p>Return an immutable <code>Map</code> that maps header names to
053: * the first (or only) header value (as a String). Header names must
054: * be matched in a case-insensitive manner.</p>
055: *
056: * @return Header values Map.
057: */
058: public abstract Map getHeader();
059:
060: /**
061: * <p>Return an immutable <code>Map</code> that maps header names to
062: * the set of all values specified in the request (as a String array).
063: * Header names must be matched in a case-insensitive manner.</p>
064: *
065: * @return Header values Map.
066: */
067: public abstract Map getHeaderValues();
068:
069: /**
070: * <p>Return an immutable <code>Map</code> that maps context application
071: * initialization parameters to their values.</p>
072: *
073: * @return Initialization parameter Map.
074: */
075: public abstract Map getInitParam();
076:
077: /**
078: * <p>Return an immutable <code>Map</code> that maps request parameter
079: * names to the first (or only) value (as a String).</p>
080: *
081: * @return Request parameter Map.
082: */
083: public abstract Map getParam();
084:
085: /**
086: * <p>Return an immutable <code>Map</code> that maps request parameter
087: * names to the set of all values (as a String array).</p>
088: *
089: * @return Request parameter Map.
090: */
091: public abstract Map getParamValues();
092:
093: /**
094: * <p>Return an immutable <code>Map</code> that maps cookie names to
095: * the set of cookies specified in the request.
096: *
097: * @return Map of Cookies.
098: * @since Chain 1.1
099: */
100: public abstract Map getCookies();
101:
102: /**
103: * <p>Return a mutable <code>Map</code> that maps request scope
104: * attribute names to their values.</p>
105: *
106: * @return Request scope Map.
107: */
108: public abstract Map getRequestScope();
109:
110: /**
111: * <p>Return a mutable <code>Map</code> that maps session scope
112: * attribute names to their values.</p>
113: *
114: * @return Session scope Map.
115: */
116: public abstract Map getSessionScope();
117:
118: }
|