ChangeEvent: Add 'who' and 'when' fields and methods

The 'when' field tells when the event occurred, and 'who' tells which
account performed the action that triggered the event.

Deprecate the existing events' get..() methods in favor of getWho().

Change-Id: I3fdae6c5b76eda8494bf3b5c95ea6bb077690d04
This commit is contained in:
David Pursehouse
2016-07-12 12:05:41 +09:00
parent 7923a93f5b
commit ed3cba635e
37 changed files with 178 additions and 99 deletions

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface ChangeAbandonedListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getAbandoner();
String getReason();
}

View File

@@ -14,10 +14,14 @@
package com.google.gerrit.extensions.events;
import com.google.gerrit.extensions.common.AccountInfo;
import com.google.gerrit.extensions.common.ChangeInfo;
import java.sql.Timestamp;
/** Interface to be extended by Events with a Change. */
public interface ChangeEvent extends GerritEvent {
ChangeInfo getChange();
AccountInfo getWho();
Timestamp getWhen();
}

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface ChangeMergedListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getMerger();
/**
* Represents the merged Revision when the submit strategy is cherry-pick or

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface ChangeRestoredListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getRestorer();
String getReason();
}

View File

@@ -24,6 +24,7 @@ import java.util.Map;
@ExtensionPoint
public interface CommentAddedListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getAuthor();
String getComment();
Map<String, ApprovalInfo> getApprovals();

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface DraftPublishedListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getPublisher();
}

View File

@@ -23,6 +23,7 @@ import java.util.Collection;
@ExtensionPoint
public interface HashtagsEditedListener {
interface Event extends ChangeEvent {
@Deprecated
AccountInfo getEditor();
Collection<String> getHashtags();
Collection<String> getAddedHashtags();

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface RevisionCreatedListener {
interface Event extends RevisionEvent {
@Deprecated
AccountInfo getUploader();
}

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.common.AccountInfo;
@ExtensionPoint
public interface TopicEditedListener {
interface Event extends ChangeEvent {
@Deprecated
AccountInfo getEditor();
String getOldTopic();
}