01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.context;
06:
07: import java.util.Set;
08: import java.util.HashSet;
09: import java.util.Map;
10: import java.util.HashMap;
11: import java.util.Iterator;
12:
13: import javax.servlet.http.HttpServletRequest;
14:
15: import com.sun.portal.desktop.DesktopServlet;
16:
17: /*
18: * This class represents a Session Application Context using a properties file.
19: *
20: * This class is assumed to be executing in a static environment. Meaning,
21: * it is declared statically or the class that declares this class is
22: * declared statically, etc. The reason for this is that is uses several
23: * data members that are most effectively used per-JVM.
24: */
25:
26: public class PropertiesSessionAppContext implements SessionAppContext {
27:
28: public PropertiesSessionAppContext() {
29: }
30:
31: public boolean validateSession(HttpServletRequest req) {
32: return true;
33: }
34:
35: public String getUserID(HttpServletRequest req) {
36: return "userid";
37: }
38:
39: public String getSessionID(HttpServletRequest req) {
40: return "sessionid";
41: }
42:
43: public String getSessionProperty(HttpServletRequest req, String name) {
44: log("PropertiesSessionAppContext.getSessionProperty(" + name
45: + ") = null");
46: return null;
47: }
48:
49: public void log(String msg) {
50: System.out.println(msg);
51: }
52:
53: }
|