Commit 9690e3aa authored by guus's avatar guus

OF-616: Group names are cached in two manners: one time in a collection that...

OF-616: Group names are cached in two manners: one time in a collection that contains all group names, but also for paginated requests. Upon changing the cache, those paginated cached collections should also be tossed.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13493 b35dd754-fafc-0310-a699-88a17e54d16e
parent caf0a8e9
...@@ -22,6 +22,7 @@ package org.jivesoftware.openfire.group; ...@@ -22,6 +22,7 @@ package org.jivesoftware.openfire.group;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
...@@ -105,6 +106,9 @@ public class GroupManager { ...@@ -105,6 +106,9 @@ public class GroupManager {
// Evict cached information for affected users // Evict cached information for affected users
evictCachedUsersForGroup(group); evictCachedUsersForGroup(group);
// Evict cached paginated group names
evictCachedPaginatedGroupNames();
} }
public void groupDeleting(Group group, Map params) { public void groupDeleting(Group group, Map params) {
...@@ -642,4 +646,13 @@ public class GroupManager { ...@@ -642,4 +646,13 @@ public class GroupManager {
groupMetaCache.remove(user.getNode()); groupMetaCache.remove(user.getNode());
} }
} }
private void evictCachedPaginatedGroupNames() {
for(Map.Entry<String, Object> entry : groupMetaCache.entrySet())
{
if (entry.getKey().startsWith(GROUP_NAMES_KEY)) {
groupMetaCache.remove(entry.getKey());
}
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment