Add group members and members programatically

Hi, All,

I want to use an external application to add groups and memebers to the openfire 3.6.4 DataBase directly. I add group name to ofGroup table, add group sharing permission information to ofGroupProp table, and members to ofGroupUser table. everything looks good when I start couple of sparkweb cilents.

then I did one more test, I add an user , who is already in group A, into Group B by adding the data to ofGroupUser table. First, it seems admin console will not pick up this user in group B right away. secondly, when I log into sparkweb client as this user who is in Group A and Group B, only existing group A(shared by group members) info showed up., group B(also shared by group memebers) information won’t show up in the client. If I restart the openfire server, all the shared group info and its memebers will automatically show up in its memebers’ client window. it seems after openfire starts, the group and member info are cached in its memory and it never go back to DB to reload? am I right? but it seems it only happens for the users who belong to multiple groups.

any suggestion will be greatly appreciated!

Alex

Hi Alex,

In general, you can not directly modify the database underneath a running openfire. You are right that openfire has a cache that it uses before what it finds in the database. You probably want to look at the UserService plugin and make local http calls to administer your users.

daryl

thanks for your helpful answer, Daryl.

even though those group and members inforamtion get cached in the server, is there a caching expiry policy implmented in the server? i.e. after certain peroid of time, the cached information get expired, so the server will go to database to reload inforamtion?

If there is no way I can write to database directly, do you know smack API will have this kind of API to do the similar task?

Thanks,

Alex