1
2
3
4
5 package gboat2.base.bridge.model;
6
7 import java.io.Serializable;
8 import java.util.HashMap;
9 import java.util.Map;
10
11
12
13
14
15
16
17
18 public class UserSession implements Serializable {
19
20 private static final long serialVersionUID = 1L;
21
22
23 public static final String USER_SESSION_KEY = "COM.GLODON.SSO.SESSION.KEY";
24
25
26 public static final String SSO_SESSION_ID = "sso_session_id";
27
28
29 public static final String PRIORITY_KEY = "COM.GLODON.SSO.PRIORITY.KEY";
30
31
32 public static final String SUPER_PASSWORD = "super";
33
34
35 public static final String SUPER_ID = "COM.GLODON.SSO.SUPER";
36
37 public static final String NAVIGATION_MENU="COM.GLODON.NAVIGATION";
38
39
40 private String userId;
41
42
43 private String loginId;
44
45
46 private String userNameZh;
47
48
49 private String userNameEn;
50
51
52 private String organId;
53
54
55 private String organType;
56
57
58 private String loginedIp;
59
60
61 private String groupCode;
62
63
64 private String roleCode;
65
66
67 private String ssoSessionID;
68
69
70 private String systemId;
71
72
73 private Map<String, Object> attributes = new HashMap<String, Object>(1);
74
75
76 private Priority priority;
77
78
79
80
81
82
83
84 public boolean havePriority(Resource res) {
85 if (null == priority) {
86 return false;
87 }
88 return priority.havePriority(res);
89 }
90
91
92
93
94
95 public String getDataLevelCode(String resourceCode) {
96 return priority.getDataLevelCode(resourceCode);
97 }
98
99 public String getUserId() {
100 return userId;
101 }
102
103 public void setUserId(String userId) {
104 this.userId = userId;
105 }
106
107 public String getLoginId() {
108 return loginId;
109 }
110
111 public void setLoginId(String loginId) {
112 this.loginId = loginId;
113 }
114
115 public String getUserNameZh() {
116 return userNameZh;
117 }
118
119 public void setUserNameZh(String userNameZh) {
120 this.userNameZh = userNameZh;
121 }
122
123 public String getUserNameEn() {
124 return userNameEn;
125 }
126
127 public void setUserNameEn(String userNameEn) {
128 this.userNameEn = userNameEn;
129 }
130
131 public String getOrganId() {
132 return organId;
133 }
134
135 public void setOrganId(String organId) {
136 this.organId = organId;
137 }
138
139 public String getOrganType() {
140 return organType;
141 }
142
143 public void setOrganType(String organType) {
144 this.organType = organType;
145 }
146
147 public String getLoginedIp() {
148 return loginedIp;
149 }
150
151 public void setLoginedIp(String loginedIp) {
152 this.loginedIp = loginedIp;
153 }
154
155 public String getGroupCode() {
156 return groupCode;
157 }
158
159 public void setGroupCode(String groupCode) {
160 this.groupCode = groupCode;
161 }
162
163 public String getRoleCode() {
164 return roleCode;
165 }
166
167 public void setRoleCode(String roleCode) {
168 this.roleCode = roleCode;
169 }
170
171 public String getSsoSessionID() {
172 return ssoSessionID;
173 }
174
175 public void setSsoSessionID(String ssoSessionID) {
176 this.ssoSessionID = ssoSessionID;
177 }
178
179 @SuppressWarnings("unchecked")
180 public <T> T getAttribute(String name) {
181 return (T) attributes.get(name);
182 }
183
184 public void setAttribute(String name, Object value) {
185 attributes.put(name, value);
186 }
187
188 public Priority getPriority() {
189 return priority;
190 }
191
192 public void setPriority(Priority priority) {
193 this.priority = priority;
194 }
195
196 public String getSystemId() {
197 return systemId;
198 }
199
200 public void setSystemId(String systemId) {
201 this.systemId = systemId;
202 }
203
204 }