[Building Sakai] Count user online in Sakai.

David Wafula davidwaf at gmail.com
Wed Apr 4 02:10:57 PDT 2012


I usually inject PresenceService into the tool then:

List<String> locationIds = presenceService.getLocations();

        for (String locationId : locationIds) {
            List<UsageSession> usageSessions =
presenceService.getPresence(locationId);
            for (UsageSession usageSession : usageSessions) {
                String userEid = usageSession.getUserEid();   //or
userid
              //i then total up the unique users somewhere from here.
             }
         }

Regards,
dww.

On Wed, Apr 4, 2012 at 9:59 AM, Tram Bao <baotram144 at gmail.com> wrote:
> Dear all,
>
> I want to count user online in Sakai.
> Does Sakai has a API to do that?
>
> Thanks,
> TramBao.
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"



-- 
David Wafula


More information about the sakai-dev mailing list