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

pack-priv final Class ProtocolV2Parser

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.transport.GitProtocolConstants.OPTION_DEEPEN_RELATIVE, .GitProtocolConstants.OPTION_FILTER, .GitProtocolConstants.OPTION_AGENT, .GitProtocolConstants.OPTION_INCLUDE_TAG, .GitProtocolConstants.OPTION_NO_PROGRESS, .GitProtocolConstants.OPTION_OFS_DELTA, .GitProtocolConstants.OPTION_SERVER_OPTION, .GitProtocolConstants.OPTION_SIDEBAND_ALL, .GitProtocolConstants.OPTION_SIDE_BAND_64K, .GitProtocolConstants.OPTION_THIN_PACK, .GitProtocolConstants.OPTION_WAIT_FOR_DONE, .GitProtocolConstants.OPTION_SESSION_ID, .GitProtocolConstants.PACKET_DEEPEN, .GitProtocolConstants.PACKET_DEEPEN_NOT, .GitProtocolConstants.PACKET_DEEPEN_SINCE, .GitProtocolConstants.PACKET_DONE, .GitProtocolConstants.PACKET_HAVE, .GitProtocolConstants.PACKET_SHALLOW, .GitProtocolConstants.PACKET_WANT, .GitProtocolConstants.PACKET_WANT_REF

Parse the incoming git protocol lines from the wire and translate them into a Request object. It requires a transferConfig object to know what the server supports (e.g. ref-in-want and/or filters).

Field Summary

Modifier and TypeField and Description
private final TransferConfig

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static String
consumeCapabilities(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer, Consumer<String> clientSIDConsumer)

pack-priv FetchV2Request

Returns:

A FetchV2Request populated with information received from the wire.
parseFetchRequest
(PacketLineIn
incoming lines
pckIn
)

Parse the incoming fetch request arguments from the wire.

pack-priv LsRefsV2Request

Returns:

a LsRefsV2Request object with the data received in the wire.
parseLsRefsRequest
(PacketLineIn
incoming lines. This method will read until an END line.
pckIn
)

Parse the incoming ls-refs request arguments from the wire.

pack-priv ObjectInfoRequest
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transferConfigback to summary
private final TransferConfig transferConfig

Constructor Detail

ProtocolV2Parserback to summary
pack-priv ProtocolV2Parser(TransferConfig transferConfig)

Method Detail

consumeCapabilitiesback to summary
private static String consumeCapabilities(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer, Consumer<String> clientSIDConsumer) throws IOException
parseFetchRequestback to summary
pack-priv FetchV2Request parseFetchRequest(PacketLineIn pckIn) throws PackProtocolException, IOException

Parse the incoming fetch request arguments from the wire. The caller must be sure that what is comings is a fetch request before coming here.

Parameters
pckIn:PacketLineIn

incoming lines

Returns:FetchV2Request

A FetchV2Request populated with information received from the wire.

Exceptions
PackProtocolException:
incompatible options, wrong type of arguments or other issues where the request breaks the protocol.
IOException:
an IO error prevented reading the incoming message.
parseLsRefsRequestback to summary
pack-priv LsRefsV2Request parseLsRefsRequest(PacketLineIn pckIn) throws PackProtocolException, IOException

Parse the incoming ls-refs request arguments from the wire. This is meant for calling immediately after the caller has consumed a "command=ls-refs" line indicating the beginning of a ls-refs request. The incoming PacketLineIn is consumed until an END line, but the caller is responsible for closing it (if needed)

Parameters
pckIn:PacketLineIn

incoming lines. This method will read until an END line.

Returns:LsRefsV2Request

a LsRefsV2Request object with the data received in the wire.

Exceptions
PackProtocolException:
for inconsistencies in the protocol (e.g. unexpected lines)
IOException:
reporting problems reading the incoming messages from the wire
parseObjectInfoRequestback to summary
pack-priv ObjectInfoRequest parseObjectInfoRequest(PacketLineIn pckIn) throws PackProtocolException, IOException