3 Replies Latest reply on Mar 20, 2009 5:32 AM by ameo

    Get online users

    ameo

      Hello,

      I want to get the current online users that logged in portal. The reason is that I want to verify during the login if a user is already logged, and if so, to give him an appropriate answer.

      I have see the sample portlet that uses the UsersActivityStatsService.

      Cause I use facelets and jsf, I tried to get the UsersActivityStatsService with the following method:

       private UsersActivityStatsService getStatsService() {
       UsersActivityStatsService activityService = null;
       try {
       MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
       activityService = (UsersActivityStatsService) MBeanProxy.get(UsersActivityStatsService.class, new ObjectName(
       "portal:service=Module,type=UsersActivityStatsService"), mbeanServer);
       } catch (MBeanProxyCreationException e) {
       logger.error("could not obtain a proxy for User Activity Statistics Service", e);
       } catch (MalformedObjectNameException e2) {
       logger.error("object name to obtain User Activity Statistics Service is wrong", e2);
       }
      
       return activityService;
       }
      


      So I get the service, but if I call the method getActiveUsersNames I get no results.

       UsersActivityStatsService uass = getStatsService();
       Set users = uass.getActiveUsersNames(18000000);
      



      Could you tell me, how to use this service correctly ?

        • 1. Re: Get online users
          ameo

          Nobody knows the solution how to get all logged in users ?

          • 2. Re: Get online users
            fribeiro1

            I don't think the portal currently provides that functionality. You might want to open a feature request in JIRA (https://jira.jboss.org/) and provide the link here for other interested people (like me) to vote for it. Thanks.

            • 3. Re: Get online users
              ameo

               

              "fribeiro1" wrote:
              I don't think the portal currently provides that functionality. You might want to open a feature request in JIRA (https://jira.jboss.org/) and provide the link here for other interested people (like me) to vote for it. Thanks.



              Thanks for advice. Here's the feature request

              https://jira.jboss.org/jira/browse/JBPORTAL-2350