Fix nested group expansion

When an internal group contains an external group the
universal group backend needs to redispatch any check
to other implementations. Support this inside of the
internal group backend by expanding the query UUIDs
and caching results.

Change-Id: I4e3d163fdaafa8a6df76bd933ca358a4f84d855b
This commit is contained in:
Shawn Pearce
2013-01-17 16:42:36 -08:00
parent 55117d37db
commit 8f07bbbd90
6 changed files with 158 additions and 60 deletions

View File

@@ -16,12 +16,17 @@ package com.google.gerrit.server.account;
import com.google.gerrit.reviewdb.client.AccountGroup;
import java.util.Collection;
import java.util.Set;
/** Tracks group inclusions in memory for efficient access. */
public interface GroupIncludeCache {
public Collection<AccountGroup.UUID> getByInclude(AccountGroup.UUID groupId);
/** @return groups directly a member of the passed group. */
public Set<AccountGroup.UUID> membersOf(AccountGroup.UUID group);
public void evictInclude(AccountGroup.UUID groupId);
/** @return any groups the passed group belongs to. */
public Set<AccountGroup.UUID> memberIn(AccountGroup.UUID groupId);
public void evictMembersOf(AccountGroup.UUID groupId);
public void evictMemberIn(AccountGroup.UUID groupId);
}