001: /*
002: * Copyright 2004-2007 the original author or authors.
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.springframework.webflow.context;
017:
018: import org.springframework.webflow.core.collection.MutableAttributeMap;
019: import org.springframework.webflow.core.collection.ParameterMap;
020: import org.springframework.webflow.core.collection.SharedAttributeMap;
021:
022: /**
023: * A facade that provides normalized access to an external system that has
024: * interacted with Spring Web Flow.
025: * <p>
026: * This context object provides a normalized interface for internal web flow
027: * artifacts to use to reason on and manipulate the state of an external actor
028: * calling into SWF to execute flows. It represents the context about a single,
029: * <i>external</i> client request to manipulate a flow execution.
030: * <p>
031: * The design of this interface was inspired by JSF's own ExternalContext
032: * abstraction and shares the same name for consistency. If a particular
033: * external client type does not support all methods defined by this interface,
034: * they can just be implemented as returning an empty map or <code>null</code>.
035: *
036: * @author Keith Donald
037: * @author Erwin Vervaet
038: */
039: public interface ExternalContext {
040:
041: /**
042: * Returns the path (or identifier) of the application that is executing.
043: * @return the application context path (e.g. "/myapp")
044: */
045: public String getContextPath();
046:
047: /**
048: * Returns the path (or identifier) of the dispatcher <i>within</i> the
049: * application that dispatched this request.
050: * @return the dispatcher path (e.g. "/dispatcher")
051: */
052: public String getDispatcherPath();
053:
054: /**
055: * Returns the path info of this external request. Could be null.
056: * @return the request path info (e.g. "/flows.htm")
057: */
058: public String getRequestPathInfo();
059:
060: /**
061: * Provides access to the parameters associated with the user request that
062: * led to SWF being called. This map is expected to be immutable and cannot
063: * be changed.
064: * @return the immutable request parameter map
065: */
066: public ParameterMap getRequestParameterMap();
067:
068: /**
069: * Provides access to the external request attribute map, providing a
070: * storage for data local to the current user request and accessible to both
071: * internal and external SWF artifacts.
072: * @return the mutable request attribute map
073: */
074: public MutableAttributeMap getRequestMap();
075:
076: /**
077: * Provides access to the external session map, providing a storage for data
078: * local to the current user session and accessible to both internal and
079: * external SWF artifacts.
080: * @return the mutable session attribute map
081: */
082: public SharedAttributeMap getSessionMap();
083:
084: /**
085: * Provides access to the <i>global</i> external session map, providing a storage for data
086: * globally accross the user session and accessible to both internal and
087: * external SWF artifacts.
088: * <p>
089: * Note: most external context implementations do not distinguish between the concept of a
090: * "local" user session scope and a "global" session scope. The Portlet world does, but
091: * not the Servlet for example. In those cases calling this method returns the same
092: * map as calling {@link #getSessionMap()}.
093: * @return the mutable global session attribute map
094: */
095: public SharedAttributeMap getGlobalSessionMap();
096:
097: /**
098: * Provides access to the external application map, providing a storage for
099: * data local to the current user application and accessible to both
100: * internal and external SWF artifacts.
101: * @return the mutable application attribute map
102: */
103: public SharedAttributeMap getApplicationMap();
104:
105: }
|