Top Description Fields Constructors Methods
org.eclipse.jgit.transport

pack-priv Class BundleFetchConnection

extends BaseFetchConnection
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Fetch connection for bundle based classes. It used by instances of TransportBundle

Field Summary

Modifier and TypeField and Description
pack-priv InputStream
private String
private PackLock
pack-priv final Map<ObjectId, String>
private final Transport

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract org.eclipse.jgit.transport.BaseConnection.close.

Implements org.eclipse.jgit.transport.Connection.close.

Closes this resource, relinquishing any underlying resources.

public boolean
protected void
private PackProtocolException
public Collection<PackLock>
private void
private String
readLine(byte[] hdrbuf)

private int
public void
setPackLockMessage(String
message to use when holding a pack in place.
message
)

Implements org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Set the lock message used when holding a pack out of garbage collection.

private void
Inherited from org.eclipse.jgit.transport.BaseFetchConnection:
didFetchIncludeTagsfetchfetch

Field Detail

binback to summary
pack-priv InputStream bin
lockMessageback to summary
private String lockMessage
packLockback to summary
private PackLock packLock
prereqsback to summary
pack-priv final Map<ObjectId, String> prereqs
transportback to summary
private final Transport transport

Constructor Detail

BundleFetchConnectionback to summary
pack-priv BundleFetchConnection(Transport transportBundle, InputStream src) throws TransportException

Method Detail

closeback to summary
public void close()

Implements abstract org.eclipse.jgit.transport.BaseConnection.close.

Implements org.eclipse.jgit.transport.Connection.close.

Doc from org.eclipse.jgit.transport.Connection.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Close any resources used by this connection.

If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.

If additional messages were produced by the remote peer, these should still be retained in the connection instance for getMessages().

AutoClosable.close() declares that it throws Exception. Implementers shouldn't throw checked exceptions. This override narrows the signature to prevent them from doing so.

Annotations
@Override
didFetchTestConnectivityback to summary
public boolean didFetchTestConnectivity()

Implements org.eclipse.jgit.transport.FetchConnection.didFetchTestConnectivity.

Doc from org.eclipse.jgit.transport.FetchConnection.didFetchTestConnectivity.

Did the last fetch(ProgressMonitor, Collection, Set) validate graph?

Some transports walk the object graph on the client side, with the client looking for what objects it is missing and requesting them individually from the remote peer. By virtue of completing the fetch call the client implicitly tested the object connectivity, as every object in the graph was either already local or was requested successfully from the peer. In such transports this method returns true.

Some transports assume the remote peer knows the Git object graph and is able to supply a fully connected graph to the client (although it may only be transferring the parts the client does not yet have). Its faster to assume such remote peers are well behaved and send the correct response to the client. In such transports this method returns false.

Returns:boolean

true if the last fetch had to perform a connectivity check on the client side in order to succeed; false if the last fetch assumed the remote peer supplied a complete graph.

Annotations
@Override
doFetchback to summary
protected void doFetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have) throws TransportException

Implements abstract org.eclipse.jgit.transport.BaseFetchConnection.doFetch.

Doc from org.eclipse.jgit.transport.BaseFetchConnection.doFetch.

Implementation of fetch(ProgressMonitor, Collection, Set) without checking for multiple fetch.

Parameters
monitor:ProgressMonitor

as in fetch(ProgressMonitor, Collection, Set)

want:Collection<Ref>

as in fetch(ProgressMonitor, Collection, Set)

have:Set<ObjectId>

as in fetch(ProgressMonitor, Collection, Set)

Annotations
@Override
Exceptions
TransportException:
as in fetch(ProgressMonitor, Collection, Set), but implementation doesn't have to care about multiple fetch(ProgressMonitor, Collection, Set) calls, as it is checked in this class.
duplicateAdvertisementback to summary
private PackProtocolException duplicateAdvertisement(String name)
getPackLocksback to summary
public Collection<PackLock> getPackLocks()

Implements org.eclipse.jgit.transport.FetchConnection.getPackLocks.

Doc from org.eclipse.jgit.transport.FetchConnection.getPackLocks.

All locks created by the last fetch(ProgressMonitor, Collection, Set) call.

Returns:Collection<PackLock>

collection (possibly empty) of locks created by the last call to fetch. The caller must release these after refs are updated in order to safely permit garbage collection.

Annotations
@Override
readBundleV2back to summary
private void readBundleV2() throws IOException
readLineback to summary
private String readLine(byte[] hdrbuf) throws IOException
readSignatureback to summary
private int readSignature() throws IOException
setPackLockMessageback to summary
public void setPackLockMessage(String message)

Implements org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Doc from org.eclipse.jgit.transport.FetchConnection.setPackLockMessage.

Set the lock message used when holding a pack out of garbage collection.

Callers that set a lock message must ensure they call getPackLocks() after fetch(ProgressMonitor, Collection, Set), even if an exception was thrown, and release the locks that are held.

Parameters
message:String

message to use when holding a pack in place.

Annotations
@Override
verifyPrerequisitesback to summary
private void verifyPrerequisites() throws TransportException