public class ReplicaPushRequest extends Object
Implementors of KetchReplica
must
populate the command result fields, setRefs(Map)
, and call one of
setException(Repository, Throwable)
or done(Repository)
to
finish processing.
Constructor and Description |
---|
ReplicaPushRequest(KetchReplica replica,
Collection<ReceiveCommand> commands)
Construct a new push request for a replica.
|
Modifier and Type | Method and Description |
---|---|
void |
done(Repository repo)
Mark the request as completed without exception.
|
Collection<ReceiveCommand> |
getCommands()
Get commands to be executed, and their results.
|
Throwable |
getException()
Get exception thrown, if any.
|
Map<String,Ref> |
getRefs()
Get remote references, usually from the advertisement.
|
void |
setException(Repository repo,
Throwable err)
Mark the request as crashing with a communication error.
|
void |
setRefs(Map<String,Ref> refs)
Set references observed from the replica.
|
public ReplicaPushRequest(KetchReplica replica, Collection<ReceiveCommand> commands)
replica
- the replica being pushed to.commands
- commands to be executed.public Collection<ReceiveCommand> getCommands()
@Nullable public Map<String,Ref> getRefs()
public void setRefs(Map<String,Ref> refs)
refs
- references observed from the replica.@Nullable public Throwable getException()
public void setException(@Nullable Repository repo, Throwable err)
This method may take significant time acquiring the leader lock and updating the Ketch state machine with the failure.
repo
- local repository reference used by the push attempt.err
- exception thrown during communication.public void done(Repository repo)
This method may take significant time acquiring the leader lock and updating the Ketch state machine with results from this replica.
repo
- local repository reference used by the push attempt.Copyright © 2019 Eclipse JGit Project. All rights reserved.