~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to contrib/NGit/NGit.Transport/PushConnection.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
This code is derived from jgit (http://eclipse.org/jgit).
 
3
Copyright owners are documented in jgit's IP log.
 
4
 
 
5
This program and the accompanying materials are made available
 
6
under the terms of the Eclipse Distribution License v1.0 which
 
7
accompanies this distribution, is reproduced below, and is
 
8
available at http://www.eclipse.org/org/documents/edl-v10.php
 
9
 
 
10
All rights reserved.
 
11
 
 
12
Redistribution and use in source and binary forms, with or
 
13
without modification, are permitted provided that the following
 
14
conditions are met:
 
15
 
 
16
- Redistributions of source code must retain the above copyright
 
17
  notice, this list of conditions and the following disclaimer.
 
18
 
 
19
- Redistributions in binary form must reproduce the above
 
20
  copyright notice, this list of conditions and the following
 
21
  disclaimer in the documentation and/or other materials provided
 
22
  with the distribution.
 
23
 
 
24
- Neither the name of the Eclipse Foundation, Inc. nor the
 
25
  names of its contributors may be used to endorse or promote
 
26
  products derived from this software without specific prior
 
27
  written permission.
 
28
 
 
29
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 
30
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 
31
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
32
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
33
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 
34
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
35
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 
36
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 
37
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
38
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 
39
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
40
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
41
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
42
*/
 
43
 
 
44
using System.Collections.Generic;
 
45
using NGit;
 
46
using NGit.Transport;
 
47
using Sharpen;
 
48
 
 
49
namespace NGit.Transport
 
50
{
 
51
        /// <summary>Lists known refs from the remote and sends objects to the remote.</summary>
 
52
        /// <remarks>
 
53
        /// Lists known refs from the remote and sends objects to the remote.
 
54
        /// <p>
 
55
        /// A push connection typically connects to the <code>git-receive-pack</code>
 
56
        /// service running where the remote repository is stored. This provides a
 
57
        /// one-way object transfer service to copy objects from the local repository
 
58
        /// into the remote repository, as well as a way to modify the refs stored by the
 
59
        /// remote repository.
 
60
        /// <p>
 
61
        /// Instances of a PushConnection must be created by a
 
62
        /// <see cref="Transport">Transport</see>
 
63
        /// that
 
64
        /// implements a specific object transfer protocol that both sides of the
 
65
        /// connection understand.
 
66
        /// <p>
 
67
        /// PushConnection instances are not thread safe and may be accessed by only one
 
68
        /// thread at a time.
 
69
        /// </remarks>
 
70
        /// <seealso cref="Transport">Transport</seealso>
 
71
        public interface PushConnection : Connection
 
72
        {
 
73
                /// <summary>Pushes to the remote repository basing on provided specification.</summary>
 
74
                /// <remarks>
 
75
                /// Pushes to the remote repository basing on provided specification. This
 
76
                /// possibly result in update/creation/deletion of refs on remote repository
 
77
                /// and sending objects that remote repository need to have a consistent
 
78
                /// objects graph from new refs.
 
79
                /// <p>
 
80
                /// <p>
 
81
                /// Only one call per connection is allowed. Subsequent calls will result in
 
82
                /// <see cref="NGit.Errors.TransportException">NGit.Errors.TransportException</see>
 
83
                /// .
 
84
                /// </p>
 
85
                /// <p>
 
86
                /// Implementation may use local repository to send a minimum set of objects
 
87
                /// needed by remote repository in efficient way.
 
88
                /// <see cref="Transport.IsPushThin()">Transport.IsPushThin()</see>
 
89
                /// should be honored if applicable.
 
90
                /// refUpdates should be filled with information about status of each update.
 
91
                /// </p>
 
92
                /// </remarks>
 
93
                /// <param name="monitor">
 
94
                /// progress monitor to update the end-user about the amount of
 
95
                /// work completed, or to indicate cancellation. Implementors
 
96
                /// should poll the monitor at regular intervals to look for
 
97
                /// cancellation requests from the user.
 
98
                /// </param>
 
99
                /// <param name="refUpdates">
 
100
                /// map of remote refnames to remote refs update
 
101
                /// specifications/statuses. Can't be empty. This indicate what
 
102
                /// refs caller want to update on remote side. Only refs updates
 
103
                /// with
 
104
                /// <see cref="Status.NOT_ATTEMPTED">Status.NOT_ATTEMPTED</see>
 
105
                /// should passed.
 
106
                /// Implementation must ensure that and appropriate status with
 
107
                /// optional message should be set during call. No refUpdate with
 
108
                /// <see cref="Status.AWAITING_REPORT">Status.AWAITING_REPORT</see>
 
109
                /// or
 
110
                /// <see cref="Status.NOT_ATTEMPTED">Status.NOT_ATTEMPTED</see>
 
111
                /// can be leaved by implementation after return from this call.
 
112
                /// </param>
 
113
                /// <exception cref="NGit.Errors.TransportException">
 
114
                /// objects could not be copied due to a network failure,
 
115
                /// critical protocol error, or error on remote side, or
 
116
                /// connection was already used for push - new connection must be
 
117
                /// created. Non-critical errors concerning only isolated refs
 
118
                /// should be placed in refUpdates.
 
119
                /// </exception>
 
120
                void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates
 
121
                        );
 
122
        }
 
123
}