private void refreshScreen() { AppSessionVoCollection sessions = domain.listSessions(); form.getLocalContext().setSessionCollection(sessions); populateSessionGrid(sessions, COL_USERNAME); setMenuItems(false); updateTotal(); fillServerDetails(); }
public AppSessionVoCollection listSessions() { AppSessionVoCollection voColl = new AppSessionVoCollection(); String[] sessionStrs = null; sessionStrs = SessionManager.getSessions(getSession().getUser().getUsername(), getSession().getUser().getClearPassword()); int arrCounter = 0; while (arrCounter < sessionStrs.length) { AppSessionVo vo = new AppSessionVo(); vo.setSessionId(sessionStrs[arrCounter++]); vo.setUsername(sessionStrs[arrCounter++]); vo.setRealName(sessionStrs[arrCounter++]); vo.setRole(sessionStrs[arrCounter++]); try { String startTime = sessionStrs[arrCounter++]; if(null==startTime) { vo.setStartTime(null); } else { vo.setStartTime(new DateTime(java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.SHORT, java.text.DateFormat.SHORT,Locale.UK).parse(startTime))); } } catch (ParseException e) { vo.setStartTime(null); LocalLogger.warn("Failed to parse Start DateTime for session with ID: "+vo.getSessionId(),e); } vo.setIdleTime(Integer.valueOf(sessionStrs[arrCounter++])); vo.setTimeout(Integer.valueOf(sessionStrs[arrCounter++])); vo.setCurrentForm(sessionStrs[arrCounter++]); vo.setRemoteHost(sessionStrs[arrCounter++]); vo.setRemoteAddress(sessionStrs[arrCounter++]); vo.setIsLoggingEnabled(Boolean.valueOf(sessionStrs[arrCounter++])); vo.setNode(sessionStrs[arrCounter++]); voColl.add(vo); } return voColl; }