@Override
 public void takeSample() {
   SessionStatsManager manager = CoreSpringFactory.getImpl(SessionStatsManager.class);
   if (manager != null) { // check if the manager is loaded
     manager.takeSample();
   }
 }
  private SessionsVO getSessionsVO() {
    SessionsVO vo = new SessionsVO();

    SessionStatsManager sessionStatsManager = CoreSpringFactory.getImpl(SessionStatsManager.class);
    UserSessionManager sessionManager = CoreSpringFactory.getImpl(UserSessionManager.class);
    vo.setCount(sessionManager.getUserSessionsCnt());

    Set<UserSession> userSessions = sessionManager.getAuthenticatedUserSessions();
    int webdavcount = 0;
    int secureWebdavCount = 0;
    int authenticatedcount = 0;
    int secureAuthenticatedCount = 0;
    int restCount = 0;
    int secureRestCount = 0;
    for (UserSession usess : userSessions) {
      SessionInfo sessInfo = usess.getSessionInfo();
      if (sessInfo.isWebDAV()) {
        webdavcount++;
        if (sessInfo.isSecure()) {
          secureWebdavCount++;
        }
      } else if (sessInfo.isREST()) {
        restCount++;
        if (sessInfo.isSecure()) {
          secureRestCount++;
        }
      } else {
        authenticatedcount++;
        if (sessInfo.isSecure()) {
          secureAuthenticatedCount++;
        }
      }
    }

    vo.setAuthenticatedCount(authenticatedcount);
    vo.setSecureAuthenticatedCount(secureAuthenticatedCount);
    vo.setWebdavCount(webdavcount);
    vo.setSecureWebdavCount(secureWebdavCount);
    vo.setRestCount(restCount);
    vo.setSecureRestCount(secureRestCount);
    // Instant messaging
    vo.setInstantMessagingCount(-1);

    SessionsStats statsLastMinute = sessionStatsManager.getSessionsStatsLast(60);
    SessionsStats statsLast5Minutes = sessionStatsManager.getSessionsStatsLast(300);
    vo.setAuthenticatedClickCountLastMinute(statsLastMinute.getAuthenticatedClickCalls());
    vo.setAuthenticatedClickCountLastFiveMinutes(statsLast5Minutes.getAuthenticatedPollerCalls());
    vo.setAuthenticatedPollCountLastMinute(statsLastMinute.getAuthenticatedPollerCalls());
    vo.setAuthenticatedPollCountLastFiveMinutes(statsLast5Minutes.getAuthenticatedPollerCalls());
    vo.setRequestLastMinute(statsLastMinute.getRequests());
    vo.setRequestLastFiveMinutes(statsLast5Minutes.getRequests());
    vo.setConcurrentDispatchThreads(sessionStatsManager.getConcurrentCounter());
    return vo;
  }