Restrict stream-events command to master

Currently, slave do not generate events. Restrict the command to master
to prevent someone from executing by mistake stream-events command on a
slave.

Change-Id: Id36033e476031e0d900d03119b92c61a3daa60a0
This commit is contained in:
Hugo Arès
2015-06-12 11:27:13 -04:00
parent 44c7e61601
commit e4a28aeb4f

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.sshd.commands;
import static com.google.gerrit.sshd.CommandMetaData.Mode.MASTER_OR_SLAVE;
import static com.google.gerrit.sshd.CommandMetaData.Mode.MASTER;
import com.google.gerrit.common.EventListener;
import com.google.gerrit.common.EventSource;
@@ -40,7 +40,7 @@ import java.util.concurrent.LinkedBlockingQueue;
@RequiresCapability(GlobalCapability.STREAM_EVENTS)
@CommandMetaData(name = "stream-events", description = "Monitor events occurring in real time",
runsAt = MASTER_OR_SLAVE)
runsAt = MASTER)
final class StreamEvents extends BaseCommand {
/** Maximum number of events that may be queued up for each connection. */
private static final int MAX_EVENTS = 128;