Add topic, lastUpdated, sortKey to ChangeAttribute

Some of these are really meant for the query results more than
for the streaming event system, but its still good to dump out
the topic in either case.

Change-Id: I47e59458b22647210090d9ec3190eaf71c067f6e
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-07-19 07:14:52 -07:00
parent 4de2f75bb8
commit 6a4ff33e80
3 changed files with 13 additions and 0 deletions

View File

@@ -17,9 +17,12 @@ package com.google.gerrit.server.events;
public class ChangeAttribute {
public String project;
public String branch;
public String topic;
public String id;
public String number;
public String subject;
public AccountAttribute owner;
public String url;
public long lastUpdated;
public String sortKey;
}

View File

@@ -48,10 +48,13 @@ public class EventFactory {
ChangeAttribute a = new ChangeAttribute();
a.project = change.getProject().get();
a.branch = change.getDest().getShortName();
a.topic = change.getTopic();
a.id = change.getKey().get();
a.number = change.getId().toString();
a.subject = change.getSubject();
a.url = getChangeUrl(change);
a.lastUpdated = change.getLastUpdatedOn().getTime() / 1000L;
a.sortKey = change.getSortKey();
final AccountState owner = accountCache.get(change.getOwner());
a.owner = asAccountAttribute(owner.getAccount());