public interface PushConnection extends Connection
A push connection typically connects to the git-receive-pack
service running where the remote repository is stored. This provides a
one-way object transfer service to copy objects from the local repository
into the remote repository, as well as a way to modify the refs stored by the
remote repository.
Instances of a PushConnection must be created by a
Transport
that implements a specific
object transfer protocol that both sides of the connection understand.
PushConnection instances are not thread safe and may be accessed by only one thread at a time.
Transport
Modifier and Type | Method and Description |
---|---|
void |
push(ProgressMonitor monitor,
Map<String,RemoteRefUpdate> refUpdates)
Pushes to the remote repository basing on provided specification.
|
void |
push(ProgressMonitor monitor,
Map<String,RemoteRefUpdate> refUpdates,
OutputStream out)
Pushes to the remote repository basing on provided specification.
|
close, getMessages, getPeerUserAgent, getRef, getRefs, getRefsMap
void push(ProgressMonitor monitor, Map<String,RemoteRefUpdate> refUpdates) throws TransportException
Only one call per connection is allowed. Subsequent calls will result in
TransportException
.
Implementation may use local repository to send a minimum set of objects
needed by remote repository in efficient way.
Transport.isPushThin()
should be
honored if applicable. refUpdates should be filled with information about
status of each update.
monitor
- progress monitor to update the end-user about the amount of
work completed, or to indicate cancellation. Implementors
should poll the monitor at regular intervals to look for
cancellation requests from the user.refUpdates
- map of remote refnames to remote refs update
specifications/statuses. Can't be empty. This indicate what
refs caller want to update on remote side. Only refs updates
with
RemoteRefUpdate.Status.NOT_ATTEMPTED
should passed. Implementation must ensure that and appropriate
status with optional message should be set during call. No
refUpdate with
RemoteRefUpdate.Status.AWAITING_REPORT
or
RemoteRefUpdate.Status.NOT_ATTEMPTED
can be leaved by implementation after return from this call.TransportException
- objects could not be copied due to a network failure,
critical protocol error, or error on remote side, or
connection was already used for push - new connection must be
created. Non-critical errors concerning only isolated refs
should be placed in refUpdates.void push(ProgressMonitor monitor, Map<String,RemoteRefUpdate> refUpdates, OutputStream out) throws TransportException
Only one call per connection is allowed. Subsequent calls will result in
TransportException
.
Implementation may use local repository to send a minimum set of objects
needed by remote repository in efficient way.
Transport.isPushThin()
should be
honored if applicable. refUpdates should be filled with information about
status of each update.
monitor
- progress monitor to update the end-user about the amount of
work completed, or to indicate cancellation. Implementors
should poll the monitor at regular intervals to look for
cancellation requests from the user.refUpdates
- map of remote refnames to remote refs update
specifications/statuses. Can't be empty. This indicate what
refs caller want to update on remote side. Only refs updates
with
RemoteRefUpdate.Status.NOT_ATTEMPTED
should passed. Implementation must ensure that and appropriate
status with optional message should be set during call. No
refUpdate with
RemoteRefUpdate.Status.AWAITING_REPORT
or
RemoteRefUpdate.Status.NOT_ATTEMPTED
can be leaved by implementation after return from this call.out
- output stream to write sideband messages toTransportException
- objects could not be copied due to a network failure,
critical protocol error, or error on remote side, or
connection was already used for push - new connection must be
created. Non-critical errors concerning only isolated refs
should be placed in refUpdates.Copyright © 2020 Eclipse JGit Project. All rights reserved.