Changeset 8038 for branches/3.19-stable
- Timestamp:
- May 25, 2022, 10:44:28 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.19-stable/src/core/net/sf/basedb/core/SessionControl.java
r7962 r8038 143 143 */ 144 144 private boolean closed; 145 146 /** 147 Stores name and value of session settings. 148 @since 3.19.3 149 */ 150 private Map<String,Object> sessionSettings; 145 151 146 152 /** … … 188 194 this.currentClient = parent.currentClient; 189 195 this.remoteId = parent.remoteId; 196 this.sessionSettings = parent.sessionSettings; 190 197 this.dbControlCache = Collections.synchronizedMap(new WeakHashMap<DbControl,String>()); 191 198 this.currentContexts = parent.currentContexts; … … 219 226 this.id = id; 220 227 this.remoteId = remoteId; 228 this.sessionSettings = Collections.synchronizedMap(new HashMap<String,Object>()); 221 229 this.dbControlCache = Collections.synchronizedMap(new WeakHashMap<DbControl,String>()); 222 230 this.currentContexts = Collections.synchronizedMap(new HashMap<ContextKey, ItemContext>()); … … 1237 1245 li.userName = userData.getName(); 1238 1246 li.authenticationMethod = authenticationMethod; 1239 li.sessionSettings = Collections.synchronizedMap(new HashMap<String,Object>());1240 1247 return li; 1241 1248 } … … 1291 1298 currentContexts.clear(); 1292 1299 allowedClients.clear(); 1300 sessionSettings.clear(); 1293 1301 loginInfo = null; 1294 1302 } … … 2593 2601 public <T> T getSessionSetting(String name) 2594 2602 { 2595 return loginInfo == null ? null : (T)loginInfo.sessionSettings.get(name);2603 return (T)sessionSettings.get(name); 2596 2604 } 2597 2605 … … 2607 2615 public <T> T setSessionSetting(String name, Object value) 2608 2616 { 2609 if (loginInfo == null || loginInfo.sessionSettings == null) return null;2610 2617 if (value == null) 2611 2618 { 2612 return (T) loginInfo.sessionSettings.remove(name);2619 return (T)sessionSettings.remove(name); 2613 2620 } 2614 2621 else 2615 2622 { 2616 return (T) loginInfo.sessionSettings.put(name, value);2623 return (T)sessionSettings.put(name, value); 2617 2624 } 2618 2625 } … … 2938 2945 private Map<String,SettingInfo> userDefaultSettings; 2939 2946 2940 /**2941 Stores name and value of session settings.2942 */2943 private Map<String,Object> sessionSettings;2944 2945 2947 private LoginInfo() 2946 2948 {} … … 2961 2963 this.userClientSettings = parent.userClientSettings; 2962 2964 this.userDefaultSettings = parent.userDefaultSettings; 2963 this.sessionSettings = parent.sessionSettings;2964 2965 } 2965 2966
Note: See TracChangeset
for help on using the changeset viewer.