EventDispatcher: Add a method to dispatch a project event
Change-Id: I74c28878712f309c479c8c5dc6cdca3b27b23921
This commit is contained in:
committed by
Hugo Arès
parent
7a34b48526
commit
8b0a99da44
@@ -842,6 +842,11 @@ public class ChangeHookRunner implements ChangeHooks, EventDispatcher,
|
||||
fireEvent(branchName, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postEvent(Project.NameKey projectName, ProjectEvent event) {
|
||||
fireEvent(projectName, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postEvent(com.google.gerrit.server.events.Event event,
|
||||
ReviewDb db) throws OrmException {
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.events.ChangeEvent;
|
||||
import com.google.gerrit.server.events.Event;
|
||||
import com.google.gerrit.server.events.ProjectEvent;
|
||||
import com.google.gerrit.server.events.RefEvent;
|
||||
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
@@ -126,6 +127,10 @@ public final class DisabledChangeHooks implements ChangeHooks, EventDispatcher,
|
||||
public void postEvent(Branch.NameKey branchName, RefEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postEvent(Project.NameKey projectName, ProjectEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postEvent(Event event, ReviewDb db) {
|
||||
}
|
||||
|
||||
@@ -16,9 +16,11 @@ package com.google.gerrit.common;
|
||||
|
||||
import com.google.gerrit.reviewdb.client.Branch;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.events.ChangeEvent;
|
||||
import com.google.gerrit.server.events.Event;
|
||||
import com.google.gerrit.server.events.ProjectEvent;
|
||||
import com.google.gerrit.server.events.RefEvent;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
|
||||
@@ -44,6 +46,14 @@ public interface EventDispatcher {
|
||||
*/
|
||||
void postEvent(Branch.NameKey branchName, RefEvent event);
|
||||
|
||||
/**
|
||||
* Post a stream event that is related to a project.
|
||||
*
|
||||
* @param projectName The project that the event is related to.
|
||||
* @param event The event to post.
|
||||
*/
|
||||
void postEvent(Project.NameKey projectName, ProjectEvent event);
|
||||
|
||||
/**
|
||||
* Post a stream event generically.
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user