001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package de.schlund.pfixcore.workflow;
020:
021: import java.util.Properties;
022:
023: import javax.servlet.http.Cookie;
024:
025: import de.schlund.pfixcore.auth.Authentication;
026: import de.schlund.pfixcore.exception.PustefixApplicationException;
027: import de.schlund.pfixcore.workflow.context.PageFlow;
028: import de.schlund.pfixxml.Variant;
029: import de.schlund.pfixxml.config.ContextConfig;
030: import de.schlund.pfixxml.config.PageRequestConfig;
031: import de.schlund.util.statuscodes.StatusCode;
032:
033: /**
034: *
035: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
036: */
037: public interface Context {
038: ContextResourceManager getContextResourceManager();
039:
040: Properties getProperties();
041:
042: Properties getPropertiesForCurrentPageRequest();
043:
044: PageRequestConfig getConfigForCurrentPageRequest();
045:
046: PageRequest getCurrentPageRequest();
047:
048: PageFlow getCurrentPageFlow();
049:
050: void setCurrentPageFlow(String pageflow);
051:
052: void setJumpToPage(String pagename);
053:
054: void setJumpToPageFlow(String pageflow);
055:
056: void prohibitContinue();
057:
058: void forceStopAtNextStep(boolean forcestop);
059:
060: Cookie[] getRequestCookies();
061:
062: void setLanguage(String lang);
063:
064: String getLanguage();
065:
066: void addCookie(Cookie cookie);
067:
068: Variant getVariant();
069:
070: void setVariant(Variant variant);
071:
072: void setVariantForThisRequestOnly(Variant variant);
073:
074: String getVisitId();
075:
076: void addSessionStatusListener(SessionStatusListener l);
077:
078: void removeSessionStatusListener(SessionStatusListener l);
079:
080: boolean precedingFlowNeedsData()
081: throws PustefixApplicationException;
082:
083: boolean finalPageIsRunning();
084:
085: boolean jumpToPageIsRunning();
086:
087: boolean flowIsRunning();
088:
089: boolean isCurrentPageRequestInCurrentFlow();
090:
091: boolean isCurrentPageFlowRequestedByUser();
092:
093: boolean isJumpToPageSet();
094:
095: boolean isJumpToPageFlowSet();
096:
097: boolean isProhibitContinueSet();
098:
099: boolean stateMustSupplyFullDocument();
100:
101: String getName();
102:
103: Throwable getLastException();
104:
105: void addPageMessage(StatusCode scode);
106:
107: void addPageMessage(StatusCode scode, String level);
108:
109: void addPageMessage(StatusCode scode, String[] args);
110:
111: void addPageMessage(StatusCode scode, String[] args, String level);
112:
113: Properties getPropertiesForContextResource(ContextResource res);
114:
115: ContextConfig getContextConfig();
116:
117: Authentication getAuthentication();
118:
119: /**
120: * Tells the servlet that the session for this context is not longer needed
121: * and can be deleted. However, there is no guarantee <b>when</b> the session
122: * will be deleted. Usually, there will be some delay, between the call of
123: * this method and the actual invalidation taking place, so the output page
124: * of the current request can still be rendered.
125: * <b>Do not use this method if you are concerned about security!</b> As the
126: * session is not invalidated immediately, session data is still available for
127: * some time after calling this method. If you keep sensitive data in the
128: * session (e.g. login data), you should reset the corresponding context
129: * resources instead of using this method. This method is only provided for
130: * memory reasons (so that memory allocated by this session can be freed, if
131: * it is not needed any more).
132: */
133: void markSessionForCleanup();
134: }
|