Hi ..
You can generate the number of active chat sessions and the number of users enrolled in each session by implementing archive providers SPI ( com.sun.im.provider package ). You can use the methods present in it to get the required information.
For more information you can use the api docs by using the below link.
http://<servername>:<port no.>/im/apidoc/index.html
Thanks and Regards,
Vinod
I looked at the html for the API. I wish that there were some more examples on sample applications like getting statistics. Also, it seems that this API could be used to automatically generate public conference rooms from a list of given users. I want to do an LDAP query for users with certain roles and create a conference room with NONE access except for these users. Are there more examples applications out there that use this API? Does this automatic conference room generation seem feasible to do with the API?
I did not understand your first requirement exactly.
Do you want to find out all user's logged into the server ?
Or you you want a specific client to find out how many user's have logged in for a specific user id ?
To address your second requirement :
the ldap access is not exposed to the api user - you can query for a list of xmpp user's based on some userid pattern - but cant set ldap query parameters from the client side.
But if you can find out the list of user's to add to a conference by other means (like directly querying the ldap yourself) and how how they correspond to the xmpp userid (could be cn @ xmppdomain - depends on your configuration) , then yes you can achieve it.
You will essentially create a conference with the affiliation you need and invite the relevent users (userid obtained from above) to it.
For each user , you can set the individual privilage required - so that all others get no access and a subset of user's you are interested in have read/write/moderate access.
Regards,
Mridul
I just want to generate general usage statistics. I do not need specific user ids.
What I was hoping to do was to modify the user lookup in the conference room creation GUI to use nsroledn instead of user name. Or better to keep the user name or uid lookup and add a lookup based on nsroledn. Does this seems feasible? If so, how would I approach doing this?
A user lookup might happen a lot of times - and it is not necessary that a lookup result's in a sucessful chat room join.
Actually a user lookup is common for chat , roster addition and muc addition (among other things) - so this might not help you in what you are looking for.
In the upcoming release, we have a very rich management interface exposed which can be queried for this sort of information through JMX.
The documentation will tell you which all properties and mbeans are exposed - and if you have management enabled at the server , you can pick up realtime stats about a wide range of exposed features.
I dont have the list in hand with me on what all are exposed , but it should not be tough to figure out the required values from the primitives we expose.
Regards,
Mridul
Slight correction - this is not planned for the upcoming release , but the release after that.
So to fix your requirement for now , I guess what Vinodh says would be a good idea.
You can write an archive provider and trap the onCreate() , onJoin() and onLeave() events to find out the statistics ... you could expose this to your applications in some way.
In the future release , we will be exposing similar information from the server over jmx ... when that gets released , you can move to the new jmx interface or continue to use the archive provider approach (it will work , but it is not he intention behind this interface :-) ).
Regards,
Mridul