Class GroupCacheImpl

  • All Implemented Interfaces:
    GroupCache

    public class GroupCacheImpl
    extends Object
    implements GroupCache
    Tracks group objects in memory for efficient access.
    • 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 interface GroupCache
        Parameters:
        groupId - the ID of the internal group
        Returns:
        an Optional of the internal group, or an empty Optional if no internal group with this ID exists on this server or an error occurred during lookup
      • 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 interface GroupCache
        Parameters:
        name - the name of the internal group
        Returns:
        an Optional of the internal group, or an empty Optional 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 interface GroupCache
        Parameters:
        groupUuid - the UUID of the internal group
        Returns:
        an Optional of the internal group, or an empty Optional if no internal group with this UUID exists on this server or an error occurred during lookup
      • get

        public Map<AccountGroup.UUID,​InternalGroup> get​(Collection<AccountGroup.UUID> groupUuids)
        Description copied from interface: GroupCache
        Returns a Map of AccountGroup.UUID to InternalGroup 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 interface GroupCache
        Parameters:
        groupUuids - UUIDs of the groups that should be retrieved
        Returns:
        Map of AccountGroup.UUID to InternalGroup 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.
      • evict

        public void evict​(AccountGroup.Id groupId)
        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 interface GroupCache
        Parameters:
        groupId - the ID of a possibly associated group
      • evict

        public void evict​(AccountGroup.NameKey groupName)
        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 interface GroupCache
        Parameters:
        groupName - the name of a possibly associated group
      • evict

        public void evict​(AccountGroup.UUID groupUuid)
        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 interface GroupCache
        Parameters:
        groupUuid - the UUID of a possibly associated group