001: /*
002: * Copyright 2001-2006 C:1 Financial Services GmbH
003: *
004: * This software is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License Version 2.1, as published by the Free Software Foundation.
007: *
008: * This software is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011: * Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public
014: * License along with this library; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
016: */
017:
018: package de.finix.contelligent;
019:
020: import java.security.PrivilegedExceptionAction;
021: import java.util.List;
022: import java.util.Map;
023: import java.util.Vector;
024:
025: import javax.servlet.http.Cookie;
026:
027: import org.apache.commons.fileupload.FileItem;
028:
029: import de.finix.contelligent.core.security.User;
030:
031: /**
032: * This interface provides access to all the data which are necessary to resolve
033: * components and their values.
034: */
035: public interface CallData {
036:
037: Contelligent getSystem();
038:
039: ComponentManager getActualManager();
040:
041: User getUser();
042:
043: Session getContelligentSession();
044:
045: Map getResultDataMap();
046:
047: /** marks the current transaction for rollback. */
048: void markForRollback();
049:
050: boolean txMarkedForRollback();
051:
052: Map getSessionStore();
053:
054: void clearSessionStore();
055:
056: Map getParameters();
057:
058: Map getFileParameters();
059:
060: void setParameters(Map parameters);
061:
062: String getParameter(String key);
063:
064: String[] getParameterValues(String key);
065:
066: /**
067: * Store an attribute with request scope in the global (nameless) storage
068: * domain.
069: *
070: * @param key
071: * attribute name
072: * @param value
073: * attribute value
074: */
075: void setRequestAttribute(String key, Object value);
076:
077: Object getRequestAttribute(String key);
078:
079: void removeRequestAttribute(String key);
080:
081: Object getSessionAttribute(String key);
082:
083: void setSessionAttribute(String key, Object value);
084:
085: void removeSessionAttribute(String key);
086:
087: /**
088: * Store an attribute with request scope in the given storage domain.
089: *
090: * @param key
091: * attribute name
092: * @param value
093: * attribute value
094: * @param storageKey
095: * name of the storage domain
096: */
097: void setRequestAttribute(String key, Object value, String storageKey);
098:
099: Object getRequestAttribute(String key, String storageKey);
100:
101: void removeRequestAttribute(String key, String storageKey);
102:
103: Object getSessionAttribute(String key, String storageKey);
104:
105: void setSessionAttribute(String key, Object value, String storageKey);
106:
107: void removeSessionAttribute(String key, String storageKey);
108:
109: void clearRequestStorageDomain(String storageKey);
110:
111: void clearSessionStorageDomain(String storageKey);
112:
113: /**
114: * Answer wether the request uses a secure transfer protocol (e.g. SSL/TLS)
115: */
116: boolean secureTransfer();
117:
118: /**
119: * Answer the category map valid for this request
120: *
121: * @return
122: */
123: Map getCategoryMap();
124:
125: void setCategoryMap(Map categoryMap);
126:
127: /**
128: * Answer the list of locales accepted by the client.
129: *
130: * @return
131: */
132: List getLocales();
133:
134: String getBaseURL();
135:
136: String getSecureBaseURL();
137:
138: String getBaseURL(boolean useHttpAuth);
139:
140: String getSecureBaseURL(boolean useHttpAuth);
141:
142: String getCurrentBaseURL();
143:
144: String getCurrentBaseURL(boolean forceProtocolHttp,
145: boolean forceProtocolHttps, boolean forceHttpAuth,
146: boolean forceWebAuth);
147:
148: boolean isCurrentProtocolHttps();
149:
150: /**
151: * @deprecated use secureTransfer
152: */
153: boolean isCurrentHttpAuth();
154:
155: Object doAsSystem(PrivilegedExceptionAction action)
156: throws Exception;
157:
158: /**
159: * Encode the given url and add the session id if necessary
160: *
161: * @param url
162: * @return
163: */
164: String encodeURL(String url);
165:
166: String encodeRedirectURL(String url);
167:
168: FileItem getFileItem(String source);
169:
170: public long getRequestTimeStamp();
171:
172: boolean shouldCheckRelations();
173:
174: public void pushRenderStack(ComponentPath cp);
175:
176: public ComponentPath popRenderStack();
177:
178: /**
179: * Returns true if a likely recursion of the provided ComponentPath has been
180: * detected in the render stack.
181: */
182: public boolean checkRenderStack(ComponentPath cp);
183:
184: /**
185: * Generates a copy of the current render stack.
186: */
187: public Vector cloneRenderStack();
188:
189: /**
190: * If the underlying transport supports cookies, this method returns them as
191: * an array, otherwise it returns null. It also returns null if cookies are
192: * supported, but none are present.
193: */
194: public Cookie[] getCookies();
195:
196: public String getRawEnvironment();
197:
198: public String getEnvironment();
199:
200: public String getEnvironment(String defaultEnvironment);
201: }
|