Returns information about the session with the given session id. The session information is organized as a HashMap, mapping session attribute names to the String representation of their values. @param sessionId Session id @return HashMap mapping session attribute names to the String representa
(String sessionId)
| 1154 | * session with the specified id exists, or if the session does not have any attributes |
| 1155 | */ |
| 1156 | public HashMap<String,String> getSession(String sessionId) { |
| 1157 | Session s = sessions.get(sessionId); |
| 1158 | if (s == null) { |
| 1159 | if (log.isInfoEnabled()) { |
| 1160 | log.info(sm.getString("managerBase.sessionNotFound", sessionId)); |
| 1161 | } |
| 1162 | return null; |
| 1163 | } |
| 1164 | |
| 1165 | Enumeration<String> ee = s.getSession().getAttributeNames(); |
| 1166 | if (ee == null || !ee.hasMoreElements()) { |
| 1167 | return null; |
| 1168 | } |
| 1169 | |
| 1170 | HashMap<String,String> map = new HashMap<>(); |
| 1171 | while (ee.hasMoreElements()) { |
| 1172 | String attrName = ee.nextElement(); |
| 1173 | map.put(attrName, getSessionAttribute(sessionId, attrName)); |
| 1174 | } |
| 1175 | |
| 1176 | return map; |
| 1177 | } |
| 1178 | |
| 1179 | |
| 1180 | /** |
nothing calls this directly
no test coverage detected