Rename RefOperationReceivedEvent to match event name
The event name is "ref-received". Rename the class to RefReceivedEvent to match it. Change-Id: If435165419734b67c4edcfa0e14254d1d78b0b62
This commit is contained in:
@@ -19,7 +19,7 @@ import com.google.gerrit.server.IdentifiedUser;
|
|||||||
|
|
||||||
import org.eclipse.jgit.transport.ReceiveCommand;
|
import org.eclipse.jgit.transport.ReceiveCommand;
|
||||||
|
|
||||||
public class RefOperationReceivedEvent extends ChangeEvent {
|
public class RefReceivedEvent extends ChangeEvent {
|
||||||
public final String type = "ref-received";
|
public final String type = "ref-received";
|
||||||
public ReceiveCommand command;
|
public ReceiveCommand command;
|
||||||
public Project project;
|
public Project project;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
package com.google.gerrit.server.git.validators;
|
package com.google.gerrit.server.git.validators;
|
||||||
|
|
||||||
import com.google.gerrit.extensions.annotations.ExtensionPoint;
|
import com.google.gerrit.extensions.annotations.ExtensionPoint;
|
||||||
import com.google.gerrit.server.events.RefOperationReceivedEvent;
|
import com.google.gerrit.server.events.RefReceivedEvent;
|
||||||
import com.google.gerrit.server.validators.ValidationException;
|
import com.google.gerrit.server.validators.ValidationException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -32,6 +32,6 @@ public interface RefOperationValidationListener {
|
|||||||
* @return empty list or informational messages on success
|
* @return empty list or informational messages on success
|
||||||
* @throws ValidationException if the ref operation fails to validate
|
* @throws ValidationException if the ref operation fails to validate
|
||||||
*/
|
*/
|
||||||
List<ValidationMessage> onRefOperation(RefOperationReceivedEvent refEvent)
|
List<ValidationMessage> onRefOperation(RefReceivedEvent refEvent)
|
||||||
throws ValidationException;
|
throws ValidationException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import com.google.common.collect.Lists;
|
|||||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||||
import com.google.gerrit.reviewdb.client.Project;
|
import com.google.gerrit.reviewdb.client.Project;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
import com.google.gerrit.server.events.RefOperationReceivedEvent;
|
import com.google.gerrit.server.events.RefReceivedEvent;
|
||||||
import com.google.gerrit.server.validators.ValidationException;
|
import com.google.gerrit.server.validators.ValidationException;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.assistedinject.Assisted;
|
import com.google.inject.assistedinject.Assisted;
|
||||||
@@ -45,7 +45,7 @@ public class RefOperationValidators {
|
|||||||
update.getName(), type);
|
update.getName(), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final RefOperationReceivedEvent event;
|
private final RefReceivedEvent event;
|
||||||
private final DynamicSet<RefOperationValidationListener> refOperationValidationListeners;
|
private final DynamicSet<RefOperationValidationListener> refOperationValidationListeners;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -54,7 +54,7 @@ public class RefOperationValidators {
|
|||||||
@Assisted Project project, @Assisted IdentifiedUser user,
|
@Assisted Project project, @Assisted IdentifiedUser user,
|
||||||
@Assisted ReceiveCommand cmd) {
|
@Assisted ReceiveCommand cmd) {
|
||||||
this.refOperationValidationListeners = refOperationValidationListeners;
|
this.refOperationValidationListeners = refOperationValidationListeners;
|
||||||
event = new RefOperationReceivedEvent();
|
event = new RefReceivedEvent();
|
||||||
event.command = cmd;
|
event.command = cmd;
|
||||||
event.project = project;
|
event.project = project;
|
||||||
event.user = user;
|
event.user = user;
|
||||||
@@ -82,7 +82,7 @@ public class RefOperationValidators {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void throwException(Iterable<ValidationMessage> messages,
|
private void throwException(Iterable<ValidationMessage> messages,
|
||||||
RefOperationReceivedEvent event) throws RefOperationValidationException {
|
RefReceivedEvent event) throws RefOperationValidationException {
|
||||||
Iterable<ValidationMessage> errors = Iterables.filter(messages, GET_ERRORS);
|
Iterable<ValidationMessage> errors = Iterables.filter(messages, GET_ERRORS);
|
||||||
String header = String.format(
|
String header = String.format(
|
||||||
"Ref \"%s\" %S in project %s validation failed", event.command.getRefName(),
|
"Ref \"%s\" %S in project %s validation failed", event.command.getRefName(),
|
||||||
|
|||||||
Reference in New Issue
Block a user