Package com.google.gerrit.server.account
Class GroupCacheImpl
- java.lang.Object
-
- com.google.gerrit.server.account.GroupCacheImpl
-
- All Implemented Interfaces:
GroupCache
public class GroupCacheImpl extends Object implements GroupCache
Tracks group objects in memory for efficient access.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evict(AccountGroup.UUID groupUuid, AccountGroup.Id groupId, AccountGroup.NameKey groupName)
void
evictAfterRename(AccountGroup.NameKey oldName)
Optional<InternalGroup>
get(AccountGroup.Id groupId)
Looks up an internal group by its ID.Optional<InternalGroup>
get(AccountGroup.NameKey name)
Looks up an internal group by its name.Optional<InternalGroup>
get(AccountGroup.UUID groupUuid)
Looks up an internal group by its UUID.static com.google.inject.Module
module()
void
onCreateGroup(AccountGroup group)
Notify the cache that a new group was constructed.
-
-
-
Method Detail
-
module
public static com.google.inject.Module module()
-
get
public Optional<InternalGroup> get(AccountGroup.Id groupId)
Description copied from interface:GroupCache
Looks up an internal group by its ID.- Specified by:
get
in interfaceGroupCache
- Parameters:
groupId
- the ID of the internal group- Returns:
- an
Optional
of the internal group, or an emptyOptional
if no internal group with this ID exists on this server or an error occurred during lookup
-
evict
public void evict(AccountGroup.UUID groupUuid, AccountGroup.Id groupId, AccountGroup.NameKey groupName) throws IOException
- Specified by:
evict
in interfaceGroupCache
- Throws:
IOException
-
evictAfterRename
public void evictAfterRename(AccountGroup.NameKey oldName) throws IOException
- Specified by:
evictAfterRename
in interfaceGroupCache
- Throws:
IOException
-
get
public Optional<InternalGroup> get(AccountGroup.NameKey name)
Description copied from interface:GroupCache
Looks up an internal group by its name.- Specified by:
get
in interfaceGroupCache
- Parameters:
name
- the name of the internal group- Returns:
- an
Optional
of the internal group, or an emptyOptional
if no internal group with this name exists on this server or an error occurred during lookup
-
get
public Optional<InternalGroup> get(AccountGroup.UUID groupUuid)
Description copied from interface:GroupCache
Looks up an internal group by its UUID.- Specified by:
get
in interfaceGroupCache
- Parameters:
groupUuid
- the UUID of the internal group- Returns:
- an
Optional
of the internal group, or an emptyOptional
if no internal group with this UUID exists on this server or an error occurred during lookup
-
onCreateGroup
public void onCreateGroup(AccountGroup group) throws IOException
Description copied from interface:GroupCache
Notify the cache that a new group was constructed.- Specified by:
onCreateGroup
in interfaceGroupCache
- Throws:
IOException
-
-