{
Iterator userKeyIter = userMap.keySet().iterator();
while(userKeyIter.hasNext())
{
String userStatKey = String.valueOf(userKeyIter.next());
UserStats userStat = (UserStats)userMap.get(userStatKey);
Map singleUserMap = new HashMap();
singleUserMap.put(USERNAME, userStat.getUsername());
singleUserMap.put(SESSIONS, new Integer(userStat.getNumberOfSessions()));
singleUserMap.put(STATUS, ONLINE);
singleUserMap.put(IPADDRESS, userStat.getInetAddress().getHostAddress());
if(includeUserInfo)
{
singleUserMap.put(USERINFO, getUserInfo(userStat.getUsername()));
}
// Add user to the helper if not added yet
if(!addedUserNames.contains(userStat.getUsername()))
addedUserNames.add(userStat.getUsername());
loggedInUsers.add(singleUserMap);
}
}