gerrit/plugins
Shawn Pearce 8702a88523 CurrentUser.PropertyKey<T>: allow plugins to cache data on users
This new map inside of both IdentifiedUser and AccountState allows
plugins to store their own information within a single user instance,
or the cached AccountState.

A property cache is primarily useful for an expensive AvatarProvider
that may need to lookup data based on AccountExternalIds on the
AccountState or the IdentifiedUser and reuse this for multiple
getUrl() invocations of varying image sizes.

Plugins can use it like this:

  private static final CurrentUser.PropertyKey<String> imageUrl =
      CurrentUser.PropertyKey.create();

  public String getUrl(IdentifiedUser user, int size) {
    String url = user.get(imageUrl);
    if (url == null) {
      url = "http://image.host/" + userId + "?size=";
      user.set(imageUrl, url);
    }
    return url + size;
  }

Begin using this for the notification filters, which are only used
inside of IsWatchedByPredicate, a non-common predicate. This gets
the database code out of IdentifiedUser and isolates it down to the
sole user in the query system.

Change-Id: Ica7409411eaf60af8d554c33b873c930b9abea6f
2016-05-15 22:21:36 -07:00
..
commit-message-length-validator@8d295ed48e Update commit-message-length-validator plugin to latest revision 2015-05-19 17:35:58 +09:00
cookbook-plugin@3e801bd7d4 Upgrade cookbook-plugin to latest revision 2016-05-03 13:45:23 -04:00
download-commands@fb05fb988e Upgrade download-commands to latest revision 2016-05-03 13:51:08 -04:00
replication@945c842f9c CurrentUser.PropertyKey<T>: allow plugins to cache data on users 2016-05-15 22:21:36 -07:00
reviewnotes@c167df08a8 Add missing whitespace around keywords, operators and braces 2016-04-11 19:51:18 +09:00
singleusergroup@141898f9e1 Use native constructors instead of Guava to instantiate empty collections 2016-05-04 22:41:39 +09:00
BUCK Allow to add custom core plugins in release build 2015-12-14 19:25:49 +09:00