Package org.eclipse.jgit.internal.ketch
Class KetchPreReceive
- java.lang.Object
-
- org.eclipse.jgit.internal.ketch.KetchPreReceive
-
- All Implemented Interfaces:
PreReceiveHook
public class KetchPreReceive extends java.lang.Object implements PreReceiveHook
PreReceiveHook for handling push traffic in a Ketch system.Install an instance on
ReceivePack
to capture the commands and other connection state and relay them through theKetchLeader
, allowing the leader to gain consensus about the new reference state.
-
-
Field Summary
Fields Modifier and Type Field Description private KetchLeader
leader
private static org.slf4j.Logger
log
-
Fields inherited from interface org.eclipse.jgit.transport.PreReceiveHook
NULL
-
-
Constructor Summary
Constructors Constructor Description KetchPreReceive(KetchLeader leader)
Construct a hook executing updates through aKetchLeader
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onPreReceive(ReceivePack rp, java.util.Collection<ReceiveCommand> cmds)
Invoked just before commands are executed.private void
waitForPropose(Proposal proposal, ProgressSpinner spinner)
private void
waitForQueue(Proposal proposal, ProgressSpinner spinner)
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
leader
private final KetchLeader leader
-
-
Constructor Detail
-
KetchPreReceive
public KetchPreReceive(KetchLeader leader)
Construct a hook executing updates through aKetchLeader
.- Parameters:
leader
- leader for this repository.
-
-
Method Detail
-
onPreReceive
public void onPreReceive(ReceivePack rp, java.util.Collection<ReceiveCommand> cmds)
Invoked just before commands are executed.See the class description for how this method can impact execution.
- Specified by:
onPreReceive
in interfacePreReceiveHook
- Parameters:
rp
- the process handling the current receive. Hooks may obtain details about the destination repository through this handle.cmds
- unmodifiable set of valid commands still pending execution. May be the empty set.
-
waitForQueue
private void waitForQueue(Proposal proposal, ProgressSpinner spinner) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
waitForPropose
private void waitForPropose(Proposal proposal, ProgressSpinner spinner) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-