Examples of SessionMonitor


Examples of com.dotcms.listeners.SessionMonitor

        }
    }

    public void invalidateSession(String sessionId) throws PortalException, SystemException, NoSuchUserException, DotDataException, DotSecurityException {
        validateUser();
        SessionMonitor sm = (SessionMonitor)
                WebContextFactory.get().getServletContext().getAttribute(WebKeys.USER_SESSIONS);

        HttpServletRequest req = WebContextFactory.get().getHttpServletRequest();
        User currentUser = com.liferay.portal.util.PortalUtil.getUser(req);

        if(sm.getUserSessions().containsKey(sessionId)) {
            HttpSession session=sm.getUserSessions().get(sessionId);
            User user=APILocator.getUserAPI().loadUserById(sm.getSysUsers().get(sessionId), APILocator.getUserAPI().getSystemUser(), false);

            if(!currentUser.getUserId().equals(user.getUserId())) {
            session.invalidate();
          } else {
            throw new IllegalArgumentException("can't invalidate session "+sessionId);
View Full Code Here

Examples of com.dotcms.listeners.SessionMonitor

        }
    }

    public void invalidateAllSessions() throws PortalException, SystemException, NoSuchUserException, DotDataException, DotSecurityException {
        validateUser();
        SessionMonitor sm = (SessionMonitor)
                WebContextFactory.get().getServletContext().getAttribute(WebKeys.USER_SESSIONS);

        HttpServletRequest req = WebContextFactory.get().getHttpServletRequest();
        User currentUser = com.liferay.portal.util.PortalUtil.getUser(req);

        for(String id : sm.getSysUsers().keySet()) {
          HttpSession session=sm.getUserSessions().get(id);
          User user=APILocator.getUserAPI().loadUserById(sm.getSysUsers().get(id), APILocator.getUserAPI().getSystemUser(), false);

          if(!currentUser.getUserId().equals(user.getUserId())) {
            session.invalidate();
          }
        }
View Full Code Here

Examples of com.dotcms.listeners.SessionMonitor

    }

    public List<Map<String,String>> getSessionList() throws NoSuchUserException, DotDataException, DotSecurityException {
        validateUser();
        List<Map<String,String>> sessionList=new ArrayList<Map<String,String>>();
        SessionMonitor sm = (SessionMonitor)
                WebContextFactory.get().getServletContext().getAttribute(WebKeys.USER_SESSIONS);

        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

        for(String id : sm.getSysUsers().keySet()) {
            Map<String,String> ss=new HashMap<String,String>();
            ss.put("sessionId",id);
            User user=APILocator.getUserAPI().loadUserById(sm.getSysUsers().get(id), APILocator.getUserAPI().getSystemUser(), false);
            ss.put("userId",user.getUserId());
            ss.put("userEmail", user.getEmailAddress());
            ss.put("userFullName", user.getFullName());
            ss.put("address", sm.getSysUsersAddress().get(id));
            HttpSession session=sm.getUserSessions().get(id);
            Date d = new Date();
            d.setTime(session.getCreationTime());
            ss.put("sessionTime", DateUtil.prettyDateSince(d, PublicCompanyFactory.getDefaultCompany().getLocale()) );
            sessionList.add(ss);
        }
View Full Code Here

Examples of com.foundationdb.server.service.monitor.SessionMonitor

    protected Collection<SessionMonitor> getAccessibleSessions(Session session) {
        if (securityService.hasRestrictedAccess(session)) {
            return monitor.getSessionMonitors();
        }
        else {
            SessionMonitor sm = monitor.getSessionMonitor(session);
            if (sm == null) {
                return Collections.emptyList();
            }
            else {
                return Collections.singletonList(sm);
View Full Code Here

Examples of com.foundationdb.server.service.monitor.SessionMonitor

            @Override
            public Row next() {
                if (!sessions.hasNext()) {
                    return null;
                }
                SessionMonitor session = sessions.next();
                MonitorStage stage = session.getCurrentStage();
                ValuesRow row = new ValuesRow(rowType,
                                              (long)session.getSessionId(),
                                              session.getCallerSessionId() < 0 ? null : (long)session.getCallerSessionId(),
                                              (int)(session.getStartTimeMillis()/1000),
                                              session.getServerType(),
                                              session.getRemoteAddress(),
                                              (stage == null) ? null : stage.name(),
                                              (long)session.getStatementCount(),
                                              session.getCurrentStatement(),
                                              session.getCurrentStatementStartTimeMillis() > 0 ? (int)(session.getCurrentStatementStartTimeMillis() / 1000) : null,
                                              session.getCurrentStatementEndTimeMillis() > 0 ? (int)(session.getCurrentStatementEndTimeMillis()/1000) : null,
                                              session.getRowsProcessed() < 0 ? null : (long)session.getRowsProcessed(),
                                              session.getCurrentStatementPreparedName(),
                                              ++rowCounter);
                return row;
            }
View Full Code Here

Examples of org.opencustomer.webapp.util.listener.SessionMonitor

    private final static Logger log = Logger.getLogger(ListAction.class);

    @Override
    public ActionForward execute(ActionMapping mapping, ListForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        SessionMonitor monitor = (SessionMonitor)request.getSession().getServletContext().getAttribute(Globals.SESSION_MONITOR_KEY);

        if(log.isDebugEnabled())
            log.debug("found "+monitor.getUserSessions().size()+" monitored sessions");
       
        ArrayList<SessionInfoBean> list = new ArrayList<SessionInfoBean>();
        for (HttpSession session : monitor.getUserSessions()) {
            SessionInfoBean bean = new SessionInfoBean();
            bean.setLoginTime(new Date(session.getCreationTime()));
            bean.setLastAccessTime(new Date(session.getLastAccessedTime()));
            bean.setInactiveTime(System.currentTimeMillis() - session.getLastAccessedTime());
            UserVO user = (UserVO) session.getAttribute(Globals.USER_KEY);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.