BasePackFetchConnection, BasePackPushConnection
| Modifier and Type | Field and Description |
|---|---|
| protected final Set | additionalHaves
Extra objects the remote has, but which aren't offered as refs. |
| protected static final String | CAPABILITY_SYMREF_PREFIX
The capability prefix for a symlink |
| protected InputStream | in
Input stream reading from the remote. |
| protected final Repository | local
The repository this transport fetches into, or pushes out of. |
| private InterruptTimer | myTimer
Timer to manage |
| protected OutputStream | out
Output stream sending to the remote. |
| protected boolean | outNeedsEnd
Send |
| protected PacketLineIn | pckIn
Packet line decoder around |
| protected PacketLineOut | pckOut
Packet line encoder around |
| private TransferConfig. | |
| private final Map | remoteCapabilities
Capability tokens advertised by the remote side. |
| protected boolean | statelessRPC
True if this is a stateless RPC connection. |
| protected TimeoutInputStream | timeoutIn
Low-level input stream, if a timeout was configured. |
| protected TimeoutOutputStream | timeoutOut
Low-level output stream, if a timeout was configured. |
| protected final Transport | transport
A transport connected to |
| protected final URIish | uri
Remote repository location. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected void | |
| public void | close()
Implements abstract org. Implements org. Closes this resource, relinquishing any underlying resources. |
| private PackProtocolException | |
| protected void | |
| protected String | |
| public String | getPeerUserAgent()
Overrides org. Implements org. User agent advertised by the remote server. |
| pack-priv TransferConfig. | |
| private Collection | |
| protected final void | init(InputStream
input stream to receive data from the peer. Caller must ensure
the input is buffered, otherwise read performance may suffer. myIn, OutputStream output stream to transmit data to the peer. Caller must ensure
the output is buffered, otherwise write performance may
suffer. myOut)Configure this connection with the directional pipes. |
| private PackProtocolException | |
| protected boolean | Returns: whether this option is supportedoption string option)Whether this option is supported |
| protected void | lsRefs(Collection<RefSpec>
to produce ref prefixes from if the server supports git
protocol V2 refSpecs, String... to use for ref prefixes if the server supports git protocol V2 additionalPatterns)Issue a protocol V2 ls-refs command and read its response. |
| private void | |
| protected TransportException | Returns: a TransportException saying a repository cannot be found and possibly why.root cause exception cause)Create an exception to indicate problems finding a remote repository. |
| private void | |
| private void | |
| protected boolean | |
| private boolean | |
| private void | |
| private String | |
| pack-priv void | |
| private ObjectId | |
| pack-priv static void | updateWithSymRefs(Map<String, Ref>
a non-null, modifiable, Map to update, and the provider of
symref targets. refMap, Map<String, String> a non-null, modifiable, Map of symrefs. symRefs)Updates the given refMap with |
| protected boolean | Returns: true if the requested option is supportedbuffer b, String option we want option)Request capability |
| additionalHaves | back to summary |
|---|---|
| protected final Set<ObjectId> additionalHaves Extra objects the remote has, but which aren't offered as refs. | |
| CAPABILITY_SYMREF_PREFIX | back to summary |
|---|---|
| protected static final String CAPABILITY_SYMREF_PREFIX The capability prefix for a symlink | |
| in | back to summary |
|---|---|
| protected InputStream in Input stream reading from the remote. | |
| local | back to summary |
|---|---|
| protected final Repository local The repository this transport fetches into, or pushes out of. | |
| myTimer | back to summary |
|---|---|
| private InterruptTimer myTimer Timer to manage | |
| out | back to summary |
|---|---|
| protected OutputStream out Output stream sending to the remote. | |
| outNeedsEnd | back to summary |
|---|---|
| protected boolean outNeedsEnd Send | |
| pckIn | back to summary |
|---|---|
| protected PacketLineIn pckIn Packet line decoder around | |
| pckOut | back to summary |
|---|---|
| protected PacketLineOut pckOut Packet line encoder around | |
| protocol | back to summary |
|---|---|
| private TransferConfig. | |
| remoteCapabilities | back to summary |
|---|---|
| private final Map<String, String> remoteCapabilities Capability tokens advertised by the remote side. | |
| statelessRPC | back to summary |
|---|---|
| protected boolean statelessRPC True if this is a stateless RPC connection. | |
| timeoutIn | back to summary |
|---|---|
| protected TimeoutInputStream timeoutIn Low-level input stream, if a timeout was configured. | |
| timeoutOut | back to summary |
|---|---|
| protected TimeoutOutputStream timeoutOut Low-level output stream, if a timeout was configured. | |
| transport | back to summary |
|---|---|
| protected final Transport transport A transport connected to | |
| uri | back to summary |
|---|---|
| protected final URIish uri Remote repository location. | |
| BasePackConnection | back to summary |
|---|---|
| pack-priv BasePackConnection(PackTransport packTransport) | |
| addCapability | back to summary |
|---|---|
| private void addCapability(String capability) | |
| addUserAgentCapability | back to summary |
|---|---|
| protected void addUserAgentCapability(StringBuilder b) Add user agent capability
| |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements org. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
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
| |
| duplicateAdvertisement | back to summary |
|---|---|
| private PackProtocolException duplicateAdvertisement(String name) | |
| endOut | back to summary |
|---|---|
| protected void endOut() Tell the peer we are disconnecting, if it cares to know. | |
| getCapability | back to summary |
|---|---|
| protected String getCapability(String option) Return a capability value. | |
| getPeerUserAgent | back to summary |
|---|---|
| public String getPeerUserAgent() Overrides org. Implements org. Doc from org. User agent advertised by the remote server. User agent advertised by the remote server.
| |
| getProtocolVersion | back to summary |
|---|---|
| pack-priv TransferConfig. | |
| getRefPrefixes | back to summary |
|---|---|
| private Collection | |
| init | back to summary |
|---|---|
| protected final void init(InputStream myIn, OutputStream myOut) Configure this connection with the directional pipes.
| |
| invalidRefAdvertisementLine | back to summary |
|---|---|
| private PackProtocolException invalidRefAdvertisementLine(String line) | |
| isCapableOf | back to summary |
|---|---|
| protected boolean isCapableOf(String option) Whether this option is supported
| |
| lsRefs | back to summary |
|---|---|
| protected void lsRefs(Collection<RefSpec> refSpecs, String... additionalPatterns) throws TransportException Issue a protocol V2 ls-refs command and read its response.
| |
| lsRefsImpl | back to summary |
|---|---|
| private void lsRefsImpl(Collection<RefSpec> refSpecs, String... additionalPatterns) throws IOException | |
| noRepository | back to summary |
|---|---|
| protected TransportException noRepository(Throwable cause) Create an exception to indicate problems finding a remote repository. The caller is expected to throw the returned exception. Subclasses may override this method to provide better diagnostics.
| |
| processLineV1 | back to summary |
|---|---|
| private void processLineV1(String name, ObjectId id, Map<String, Ref> avail) throws IOException | |
| processLineV2 | back to summary |
|---|---|
| private void processLineV2(String line, ObjectId id, String rest, Map<String, Ref> avail, Map<String, String> symRefs) throws IOException | |
| readAdvertisedRefs | back to summary |
|---|---|
| protected boolean readAdvertisedRefs() throws TransportException Reads the advertised references through the initialized stream.
Subclass implementations may call this method only after setting up the
input and output streams with
If any errors occur, this connection is automatically closed by invoking
| |
| readAdvertisedRefsImpl | back to summary |
|---|---|
| private boolean readAdvertisedRefsImpl() throws IOException | |
| readCapabilitiesV2 | back to summary |
|---|---|
| private void readCapabilitiesV2() throws IOException | |
| readLine | back to summary |
|---|---|
| private String readLine() throws IOException | |
| setProtocolVersion | back to summary |
|---|---|
| pack-priv void setProtocolVersion(TransferConfig. | |
| toId | back to summary |
|---|---|
| private ObjectId toId(String line, String value) throws PackProtocolException | |
| updateWithSymRefs | back to summary |
|---|---|
| pack-priv static void updateWithSymRefs(Map<String, Ref> refMap, Map<String, String> symRefs) Updates the given refMap with
For each entry, symRef, in symRefs, whose value is a key in refMap, adds
a new entry to refMap with that same key and value of a new
If refMap already contains an entry for symRef.key, it is replaced. For example, given:
refMap.put("refs/heads/main", ref);
symRefs.put("HEAD", "refs/heads/main");
then:
updateWithSymRefs(refMap, symRefs);has the effect of:
refMap.put("HEAD",
new SymbolicRef("HEAD", refMap.get(symRefs.remove("HEAD"))))
Any entry in symRefs whose value is not a key in refMap is ignored. Any circular symRefs are ignored. Upon completion, symRefs will contain only any unresolvable entries. | |
| wantCapability | back to summary |
|---|---|
| protected boolean wantCapability(StringBuilder b, String option) Request capability
| |