Clearing Cache

Is there an way to programatically clear Wildfire’'s cache or send it some sort of message?

I need to add users to the jiveRoster table (basically adding users to an existing user’‘s buddy list) and have them be immediately available for presence information to the existing user’'s client, but they only show if I clear the cache in the interface, or restart.

Is there another way to make the user visible instantly, without it being loaded into the cache?

Help!

Message was edited by: ckuske

ckuske wrote:

Is there an way to programatically clear Wildfire’'s cache or send it some sort of message?

Sure, you could do something like:

CacheManager.getCache(“username2roster”).clear();

Take a look at the javadocs for more information. But…

I need to add users to the jiveRoster table (basically adding users to an existing user’‘s buddy list) and have them be immediately available for presence information to the existing user’'s client, but they only show if I clear the cache in the interface, or restart.

If you wipe out the cache each time you make a change to a users roster then depending on how often you’‘re doing this, you’'re going to lose any benefit you gain from having the cache in first place. A better way to handle this would be to programically make changes to the the users roster list via the Wildfire API by doing something like:

XMPPServer.getInstance().getUserManager().getUser(“bob”).getRoster().createRoste rItem(new JID("newbuddy@example.com"), true);

This will not only allow you to take advantage of Wildfire’'s caching but it will also notify the user (“bob”) that a new roster item has been added.

Hope that helps,

Ryan

Hi Ryan,

I was able to solve my problem by modifying the User Service plugin to setup the roster information. It was really easy to do, and very cool!

You guys do great work!

Chris

I’‘m wonder how? It’'s very interesting to me.

Update doesn’'t help. Delete and Add the same user?