Class BaseFetchConnection

    • Constructor Detail

      • BaseFetchConnection

        BaseFetchConnection()
    • Method Detail

      • fetch

        public final void fetch​(ProgressMonitor monitor,
                                java.util.Collection<Ref> want,
                                java.util.Set<ObjectId> have)
                         throws TransportException
        Fetch objects we don't have but that are reachable from advertised refs.

        Only one call per connection is allowed. Subsequent calls will result in TransportException.

        Implementations are free to use network connections as necessary to efficiently (for both client and server) transfer objects from the remote repository into this repository. When possible implementations should avoid replacing/overwriting/duplicating an object already available in the local destination repository. Locally available objects and packs should always be preferred over remotely available objects and packs. Transport.isFetchThin() should be honored if applicable.

        Specified by:
        fetch in interface FetchConnection
        Parameters:
        monitor - progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.
        want - one or more refs advertised by this connection that the caller wants to store locally.
        have - additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.
        Throws:
        TransportException - objects could not be copied due to a network failure, protocol error, or error on remote side, or connection was already used for fetch.
      • fetch

        public final void fetch​(ProgressMonitor monitor,
                                java.util.Collection<Ref> want,
                                java.util.Set<ObjectId> have,
                                java.io.OutputStream out)
                         throws TransportException
        Fetch objects we don't have but that are reachable from advertised refs.

        Only one call per connection is allowed. Subsequent calls will result in TransportException.

        Implementations are free to use network connections as necessary to efficiently (for both client and server) transfer objects from the remote repository into this repository. When possible implementations should avoid replacing/overwriting/duplicating an object already available in the local destination repository. Locally available objects and packs should always be preferred over remotely available objects and packs. Transport.isFetchThin() should be honored if applicable.

        Specified by:
        fetch in interface FetchConnection
        Parameters:
        monitor - progress monitor to inform the end-user about the amount of work completed, or to indicate cancellation. Implementations should poll the monitor at regular intervals to look for cancellation requests from the user.
        want - one or more refs advertised by this connection that the caller wants to store locally.
        have - additional objects known to exist in the destination repository, especially if they aren't yet reachable by the ref database. Connections should take this set as an addition to what is reachable through all Refs, not in replace of it.
        out - OutputStream to write sideband messages to
        Throws:
        TransportException - objects could not be copied due to a network failure, protocol error, or error on remote side, or connection was already used for fetch.