1
2
3
4
5 package org.directdemocracyportal.democracy.web;
6
7 import java.util.Locale;
8 import java.util.Map;
9
10 import org.directdemocracyportal.democracy.model.application.User;
11
12 import thinwire.ui.Application;
13
14 /***
15 * The Class UserState.
16 */
17 public class UserState
18 {
19
20 /*** The Constant user. */
21 public final static Application.Local<User> user = new Application.Local<User>();
22
23 /*** The Constant locale. */
24 public final static Application.Local<Locale> locale = new Application.Local<Locale>();
25
26 /*** The Constant userSettings. */
27 public final static Application.Local<Map<String, String>> userSettings = new Application.Local<Map<String, String>>();
28
29 /***
30 * Gets the session id.
31 *
32 * @return the session id
33 */
34 public static String getSessionId() {
35 return userSettings.get().get("HEADER_COOKIE");
36 }
37
38 /***
39 * Gets the accept language.
40 *
41 * @return the accept language
42 */
43 public static String getAcceptLanguage() {
44 return userSettings.get().get("HEADER_ACCEPT-LANGUAGE");
45 }
46
47 }