About the Room Occupants' Information

Hello,everyone.

we know,in the Openfire Admin Console,in the menu we can find the information of the room occupants,in here we can fide who user is staying in the chat room.

My question is,where preserve the data of the Room Occupants’ Information in the serve? In other words,can i get the list of users whose in the chat room from the database?I have tried it form the database but didn’t get it…Whether have any other solution for it?

Thanks!

veryam

Hey veryam,

That information is not persisted in the database. Room activity is something that changes a lot and keeping it in the database is not an optimal solution. Moreover, if a server goes down then nobody will be in the room thus the database would have incorrect information. Therefore, it makes sense to keep that information only in memory (and shared across cluster nodes). If you need to access that information you should create an Openfire plugin that makes use of the internal API.

Regards,

– Gato

This is a very dynamic data (at any time users entering and leaving). So i see no point to hold this in database. It’s probably cached. So i think one should be some API provider (if there is some) to retrieve such info.

UPD: well, Gato has explained that better

Thanks to Gato and wroot ! you are very nice.

I just found the way to get occupants. You need to have “roomname” and “jid” to get the occupants list

MultiUserChatService muChatService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServices().g et(0);

Collection occupants = muChatService.getChatRoom(“roomnamehere”, jid).getOccupants();