Class GroupCacheImpl
- All Implemented Interfaces:
GroupCache
-
Method Summary
Modifier and TypeMethodDescriptionvoid
evict
(AccountGroup.Id groupId) Removes the association of the given ID with a group.void
evict
(AccountGroup.NameKey groupName) Removes the association of the given name with a group.void
evict
(AccountGroup.UUID groupUuid) Removes the association of the given UUID with a group.void
evict
(Collection<AccountGroup.UUID> groupUuids) Removes the association of the given UUIDs with groupsget
(AccountGroup.Id groupId) Looks up an internal group by its ID.get
(AccountGroup.NameKey name) Looks up an internal group by its name.get
(AccountGroup.UUID groupUuid) Looks up an internal group by its UUID.get
(Collection<AccountGroup.UUID> groupUuids) Returns aMap
ofAccountGroup.UUID
toInternalGroup
for the given groups UUIDs.getFromMetaId
(AccountGroup.UUID groupUuid, org.eclipse.jgit.lib.ObjectId metaId) Returns anInternalGroup
instance for the givenAccountGroup.UUID
at the givenmetaId
ofRefNames.refsGroups(com.google.gerrit.entities.AccountGroup.UUID)
ref.static com.google.inject.Module
module()
-
Method Details
-
module
public static com.google.inject.Module module() -
get
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
-
get
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
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
-
get
Description copied from interface:GroupCache
Returns aMap
ofAccountGroup.UUID
toInternalGroup
for the given groups UUIDs. If not cached yet the groups are loaded. If a group can't be loaded (e.g. because it is missing), the entry will be missing from the result.- Specified by:
get
in interfaceGroupCache
- Parameters:
groupUuids
- UUIDs of the groups that should be retrieved- Returns:
Map
ofAccountGroup.UUID
toInternalGroup
instances for the given group UUIDs, if a group can't be loaded (e.g. because it is missing), the entry will be missing from the result.
-
getFromMetaId
public InternalGroup getFromMetaId(AccountGroup.UUID groupUuid, org.eclipse.jgit.lib.ObjectId metaId) throws com.google.gerrit.exceptions.StorageException Description copied from interface:GroupCache
Returns anInternalGroup
instance for the givenAccountGroup.UUID
at the givenmetaId
ofRefNames.refsGroups(com.google.gerrit.entities.AccountGroup.UUID)
ref.The caller is responsible to ensure the presence of
metaId
and the corresponding meta ref.- Specified by:
getFromMetaId
in interfaceGroupCache
- Parameters:
groupUuid
- the UUID of the internal groupmetaId
- the sha1 of commit inRefNames.refsGroups(com.google.gerrit.entities.AccountGroup.UUID)
ref.- Returns:
- the internal group at specific sha1
metaId
- Throws:
com.google.gerrit.exceptions.StorageException
- if no internal group with this UUID exists on this server at the specific sha1, or if an error occurred during lookup.
-
evict
Description copied from interface:GroupCache
Removes the association of the given ID with a group.The next call to
GroupCache.get(AccountGroup.Id)
won't provide a cached value.It's safe to call this method if no association exists.
Note: This method doesn't touch any associations between names/UUIDs and groups!
- Specified by:
evict
in interfaceGroupCache
- Parameters:
groupId
- the ID of a possibly associated group
-
evict
Description copied from interface:GroupCache
Removes the association of the given name with a group.The next call to
GroupCache.get(AccountGroup.NameKey)
won't provide a cached value.It's safe to call this method if no association exists.
Note: This method doesn't touch any associations between IDs/UUIDs and groups!
- Specified by:
evict
in interfaceGroupCache
- Parameters:
groupName
- the name of a possibly associated group
-
evict
Description copied from interface:GroupCache
Removes the association of the given UUID with a group.The next call to
GroupCache.get(AccountGroup.UUID)
won't provide a cached value.It's safe to call this method if no association exists.
Note: This method doesn't touch any associations between names/IDs and groups!
- Specified by:
evict
in interfaceGroupCache
- Parameters:
groupUuid
- the UUID of a possibly associated group
-
evict
Description copied from interface:GroupCache
Removes the association of the given UUIDs with groups- Specified by:
evict
in interfaceGroupCache
-