protected void onBtnLogRefreshClick() throws PresentationLogicException { //WDEV-17041 if (form.lyr1().tabLog().intNumKb().getValue()==null) { engine.showMessage("'Retrieve Last' field is mandatory"); return; } AppSessionVo vo = form.lyr1().tabSess().grdSess().getValue(); LogFileVo log; try { log = domain.getLogFile(vo, form.lyr1().tabLog().intNumKb().getValue()); setLogDetails(log); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); } }
protected void onGrdSessSelectionChanged() throws PresentationLogicException { AppSessionVo vo = form.lyr1().tabSess().grdSess().getValue(); setMenuItems(true); if (vo.getIsLoggingEnabled().booleanValue()) { form.getContextMenus().getAppSessionAdminLOGGINGItem().setText("Disable Session Logging"); } else { form.getContextMenus().getAppSessionAdminLOGGINGItem().setText("Enable Session Logging"); } }
public int compare(AppSessionVo s1, AppSessionVo s2) { if (s1 != null && s2 != null && s1.getUsernameIsNotNull() && s2.getUsernameIsNotNull()) return direction * s1.getUsername().compareToIgnoreCase(s2.getUsername()); return 0; }
public int compare(AppSessionVo s1, AppSessionVo s2) { if (s1 != null && s2 != null && s1.getIdleTimeIsNotNull() && s2.getIdleTimeIsNotNull()) return direction * s1.getIdleTime().compareTo(s2.getIdleTime()); return 0; }
public LogFileVo getLogFile(AppSessionVo vo, Integer tailSize) throws DomainInterfaceException { LogFileVo ret = new LogFileVo(); ret.setLocation(ConfigFlag.GEN.SESSION_LOG_LOCATION.getValue()); String logFileName = "Ims_" + vo.getUsername() + "_" + vo.getSessionId() + ".log"; ret.setLogContent(getLogFileContent(logFileName,tailSize.intValue())); ret.setFileName(logFileName); ret.setSize(Integer.valueOf(getLogFileSize(logFileName))); return ret; }
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; }
public void terminateSession(AppSessionVo vo) throws DomainInterfaceException { SessionManager.endSession(vo.getSessionId(),getSession().getUser().getUsername(), getSession().getUser().getClearPassword()); }
public AppSessionVo toggleLogging(AppSessionVo vo) throws DomainInterfaceException { SessionManager.toggleLogging(vo.getSessionId(),getSession().getUser().getUsername(), getSession().getUser().getClearPassword()); vo.setIsLoggingEnabled(!vo.getIsLoggingEnabled()); return vo; }