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:
@@ -103,6 +103,8 @@ change:: The Gerrit change the event is related to
|
|||||||
|
|
||||||
branch;; Branch name within project
|
branch;; Branch name within project
|
||||||
|
|
||||||
|
topic;; Topic name specified by the uploaded for this change series
|
||||||
|
|
||||||
id;; Change identifier
|
id;; Change identifier
|
||||||
|
|
||||||
number;; Change number (deprecated)
|
number;; Change number (deprecated)
|
||||||
@@ -113,6 +115,11 @@ change:: The Gerrit change the event is related to
|
|||||||
|
|
||||||
url;; Canonical URL to reach this change
|
url;; Canonical URL to reach this change
|
||||||
|
|
||||||
|
lastUpdated;; Time in seconds since the UNIX epoch when this change
|
||||||
|
was last updated.
|
||||||
|
|
||||||
|
sortKey;; Internal key used to sort changes, based on lastUpdated.
|
||||||
|
|
||||||
[[account]]
|
[[account]]
|
||||||
account:: An account that is related to an event or attribute
|
account:: An account that is related to an event or attribute
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ package com.google.gerrit.server.events;
|
|||||||
public class ChangeAttribute {
|
public class ChangeAttribute {
|
||||||
public String project;
|
public String project;
|
||||||
public String branch;
|
public String branch;
|
||||||
|
public String topic;
|
||||||
public String id;
|
public String id;
|
||||||
public String number;
|
public String number;
|
||||||
public String subject;
|
public String subject;
|
||||||
public AccountAttribute owner;
|
public AccountAttribute owner;
|
||||||
public String url;
|
public String url;
|
||||||
|
public long lastUpdated;
|
||||||
|
public String sortKey;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,10 +48,13 @@ public class EventFactory {
|
|||||||
ChangeAttribute a = new ChangeAttribute();
|
ChangeAttribute a = new ChangeAttribute();
|
||||||
a.project = change.getProject().get();
|
a.project = change.getProject().get();
|
||||||
a.branch = change.getDest().getShortName();
|
a.branch = change.getDest().getShortName();
|
||||||
|
a.topic = change.getTopic();
|
||||||
a.id = change.getKey().get();
|
a.id = change.getKey().get();
|
||||||
a.number = change.getId().toString();
|
a.number = change.getId().toString();
|
||||||
a.subject = change.getSubject();
|
a.subject = change.getSubject();
|
||||||
a.url = getChangeUrl(change);
|
a.url = getChangeUrl(change);
|
||||||
|
a.lastUpdated = change.getLastUpdatedOn().getTime() / 1000L;
|
||||||
|
a.sortKey = change.getSortKey();
|
||||||
|
|
||||||
final AccountState owner = accountCache.get(change.getOwner());
|
final AccountState owner = accountCache.get(change.getOwner());
|
||||||
a.owner = asAccountAttribute(owner.getAccount());
|
a.owner = asAccountAttribute(owner.getAccount());
|
||||||
|
|||||||
Reference in New Issue
Block a user