/** * Allows sorting session info according to the user names.<p> * * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(CmsSessionInfo obj) { if (obj == this) { return 0; } return m_userId.compareTo(obj.getUserId()); }
/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CmsSessionInfo) { return m_userId.equals(((CmsSessionInfo)obj).getUserId()); } return false; }
/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CmsSessionInfo) { return m_userId.equals(((CmsSessionInfo)obj).getUserId()); } return false; }
/** * Allows sorting session info according to the user names.<p> * * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object obj) { if (obj == this) { return 0; } if (obj instanceof CmsSessionInfo) { return m_userId.compareTo(((CmsSessionInfo)obj).getUserId()); } return 0; }
/** * Returns all sessions or all sessions matching the user id from the provided Map.<p> * * @param allSessions the Map of existing sessions * @param userId the id of the user, if null all sessions will be returned * * @return all sessions or all sessions matching the user id from the provided Map */ private List<CmsSessionInfo> getAllSelected(Map<CmsUUID, CmsSessionInfo> allSessions, CmsUUID userId) { List<CmsSessionInfo> userSessions = new ArrayList<CmsSessionInfo>(); Iterator<Map.Entry<CmsUUID, CmsSessionInfo>> i = allSessions.entrySet().iterator(); while (i.hasNext()) { Map.Entry<CmsUUID, CmsSessionInfo> entry = i.next(); CmsSessionInfo sessionInfo = entry.getValue(); if ((sessionInfo != null) && ((userId == null) || userId.equals(sessionInfo.getUserId()))) { // sessionInfo == null may be the case in case of concurrent modification userSessions.add(sessionInfo); } } return userSessions; } }
/** * Returns all sessions or all sessions matching the user id from the provided Map.<p> * * @param allSessions the Map of existing sessions * @param userId the id of the user, if null all sessions will be returned * * @return all sessions or all sessions matching the user id from the provided Map */ private List getAllSelected(Map allSessions, CmsUUID userId) { List userSessions = new ArrayList(); Iterator i = allSessions.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); CmsSessionInfo sessionInfo = (CmsSessionInfo)entry.getValue(); if ((sessionInfo != null) && ((userId == null) || userId.equals(sessionInfo.getUserId()))) { // sessionInfo == null may be the case in case of concurrent modification userSessions.add(sessionInfo); } } return userSessions; } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer output = new StringBuffer(); Iterator i = m_sessionStorageProvider.getAll().iterator(); output.append("[CmsSessions]:\n"); while (i.hasNext()) { CmsSessionInfo sessionInfo = (CmsSessionInfo)i.next(); output.append(sessionInfo.getSessionId().toString()); output.append(" : "); output.append(sessionInfo.getUserId().toString()); output.append('\n'); } return output.toString(); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer output = new StringBuffer(); Iterator<CmsSessionInfo> i = m_sessionStorageProvider.getAll().iterator(); output.append("[CmsSessions]:\n"); while (i.hasNext()) { CmsSessionInfo sessionInfo = i.next(); output.append(sessionInfo.getSessionId().toString()); output.append(" : "); output.append(sessionInfo.getUserId().toString()); output.append('\n'); } return output.toString(); }
if (session != null) { try { String userName = getCms().readUser(session.getUserId()).getFullName(); if (!users.contains(userName)) { users.add(userName);
if (session != null) { try { String emailAddress = getCms().readUser(session.getUserId()).getEmail(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(emailAddress) && !emails.contains(emailAddress)) { emails.add(emailAddress);
/** * Adds a new session info into the session storage.<p> * * @param sessionInfo the session info to store for the id */ protected void addSessionInfo(CmsSessionInfo sessionInfo) { if (getUserSessionMode() == UserSessionMode.standard) { m_sessionStorageProvider.put(sessionInfo); } else if (getUserSessionMode() == UserSessionMode.single) { CmsUUID userId = sessionInfo.getUserId(); List<CmsSessionInfo> infos = getSessionInfos(userId); if (infos.isEmpty() || ((infos.size() == 1) && infos.get(0).getSessionId().equals(sessionInfo.getSessionId()))) { m_sessionStorageProvider.put(sessionInfo); } else { throw new RuntimeException("Can't create another session for the same user."); } } }
if (session != null) { try { CmsUser user = getCms().readUser(session.getUserId()); String userName = user.getFullName(); if (!users.contains(userName)) {
/** * @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String) */ @Override protected void fillDetails(String detailId) { // get content List<CmsListItem> sessions = getList().getAllContent(); Iterator<CmsListItem> i = sessions.iterator(); while (i.hasNext()) { CmsListItem item = i.next(); CmsSessionInfo session = OpenCms.getSessionManager().getSessionInfo(new CmsUUID(item.getId())); StringBuffer html = new StringBuffer(32); if (detailId.equals(LIST_DETAIL_EMAIL)) { // email try { CmsUser user = getCms().readUser(session.getUserId()); html.append(user.getEmail()); } catch (CmsException e) { // should never happen } } else { continue; } item.set(detailId, html.toString()); } }
CmsUUID userId = null; if (sessionInfo != null) { userId = sessionInfo.getUserId(); m_sessionStorageProvider.remove(sessionInfo.getSessionId());
CmsUUID userId = null; if (sessionInfo != null) { userId = sessionInfo.getUserId(); m_sessionStorageProvider.remove(sessionInfo.getSessionId());
CmsUser user; try { user = getCms().readUser(sessionInfo.getUserId()); } catch (CmsException e) { if (LOG.isWarnEnabled()) {
CmsUser user = m_securityManager.readUser(null, sessionInfo.getUserId());
CmsUser user = m_securityManager.readUser(null, sessionInfo.getUserId());
CmsSessionInfo sessionInfo = itSessions.next(); CmsListItem item = getList().newItem(sessionInfo.getSessionId().toString()); CmsUser user = getCms().readUser(sessionInfo.getUserId()); CmsOrganizationalUnit userOu = OpenCms.getOrgUnitManager().readOrganizationalUnit( getCms(),