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

public final Class FetchV2Request

extends FetchRequest
Class Inheritance
Static Imports
java.util.Objects.requireNonNull

Fetch request from git protocol v2.

This is used as an input to ProtocolV2Hook.

Since
5.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final List<String>
private final List<ObjectId>
private final List<String>
private final boolean
private final boolean
private final List<String>
Inherited from org.eclipse.jgit.transport.FetchRequest:
agentclientCapabilitiesclientShallowCommitsclientSIDdeepenNotsdeepenSincedepthfilterSpecwantIds

Constructor Summary

AccessConstructor and Description
pack-priv
FetchV2Request(List<ObjectId> peerHas, List<String> wantedRefs, Set<ObjectId> wantIds, Set<ObjectId> clientShallowCommits, int deepenSince, List<String> deepenNots, int depth, FilterSpec filterSpec, boolean doneReceived, boolean waitForDone, Set<String> clientCapabilities, String agent, List<String> serverOptions, boolean sidebandAll, List<String> packfileUriProtocols, String clientSID)

Method Summary

Modifier and TypeMethod and Description
pack-priv static FetchV2Request.Builder

Returns:

A builder of FetchV2Request.
builder
()

Get builder

pack-priv List<String>
pack-priv List<ObjectId>

Returns:

object ids received in the "have" lines
getPeerHas
()

Get object ids received in the "have" lines

public List<String>

Returns:

Immutable list of server options received in the request
getServerOptions
()

Options received in server-option lines.

pack-priv boolean

Returns:

true if "sideband-all" was received
getSidebandAll
()

Whether "sideband-all" was received

public List<String>

Returns:

list of references received in "want-ref" lines
getWantedRefs
()

Get list of references received in "want-ref" lines

pack-priv boolean

Returns:

true if the request had a "done" line
wasDoneReceived
()

Whether the request had a "done" line

pack-priv boolean

Returns:

true if the request had a "wait-for-done" line
wasWaitForDoneReceived
()

Whether the request had a "wait-for-done" line

Inherited from org.eclipse.jgit.transport.FetchRequest:
getAgentgetClientCapabilitiesgetClientShallowCommitsgetClientSIDgetDeepenNotsgetDeepenSincegetDepthgetFilterSpecgetWantIds

Field Detail

doneReceivedback to summary
private final boolean doneReceived
packfileUriProtocolsback to summary
private final List<String> packfileUriProtocols
Annotations
@NonNull
peerHasback to summary
private final List<ObjectId> peerHas
serverOptionsback to summary
private final List<String> serverOptions
Annotations
@NonNull
sidebandAllback to summary
private final boolean sidebandAll
waitForDoneback to summary
private final boolean waitForDone
wantedRefsback to summary
private final List<String> wantedRefs

Constructor Detail

FetchV2Requestback to summary
pack-priv FetchV2Request(List<ObjectId> peerHas, List<String> wantedRefs, Set<ObjectId> wantIds, Set<ObjectId> clientShallowCommits, int deepenSince, List<String> deepenNots, int depth, FilterSpec filterSpec, boolean doneReceived, boolean waitForDone, Set<String> clientCapabilities, String agent, List<String> serverOptions, boolean sidebandAll, List<String> packfileUriProtocols, String clientSID)

Method Detail

builderback to summary
pack-priv static FetchV2Request.Builder builder()

Get builder

Returns:FetchV2Request.Builder

A builder of FetchV2Request.

getPackfileUriProtocolsback to summary
pack-priv List<String> getPackfileUriProtocols()
Annotations
@NonNull
getPeerHasback to summary
pack-priv List<ObjectId> getPeerHas()

Get object ids received in the "have" lines

Returns:List<ObjectId>

object ids received in the "have" lines

Annotations
@NonNull
getServerOptionsback to summary
public List<String> getServerOptions()

Options received in server-option lines. The caller can choose to act on these in an application-specific way

Returns:List<String>

Immutable list of server options received in the request

Annotations
@NonNull
Since
5.2
getSidebandAllback to summary
pack-priv boolean getSidebandAll()

Whether "sideband-all" was received

Returns:boolean

true if "sideband-all" was received

getWantedRefsback to summary
public List<String> getWantedRefs()

Get list of references received in "want-ref" lines

Returns:List<String>

list of references received in "want-ref" lines

Annotations
@NonNull
Since
5.4
wasDoneReceivedback to summary
pack-priv boolean wasDoneReceived()

Whether the request had a "done" line

Returns:boolean

true if the request had a "done" line

wasWaitForDoneReceivedback to summary
pack-priv boolean wasWaitForDoneReceived()

Whether the request had a "wait-for-done" line

Returns:boolean

true if the request had a "wait-for-done" line

org.eclipse.jgit.transport back to summary

pack-priv final Class FetchV2Request.Builder

extends Object
Class Inheritance

A builder for FetchV2Request.

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv final Set<String>
pack-priv final Set<ObjectId>
pack-priv String
pack-priv final List<String>
pack-priv int
pack-priv int
pack-priv boolean
pack-priv FilterSpec
pack-priv final List<String>
pack-priv final List<ObjectId>
pack-priv final List<String>
pack-priv boolean
pack-priv boolean
pack-priv final List<String>
pack-priv final Set<ObjectId>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv FetchV2Request.Builder

Returns:

this builder
addClientCapability
(String
capability line sent by the client
clientCapability
)

Add client capability

pack-priv FetchV2Request.Builder

Returns:

this builder
addClientShallowCommit
(ObjectId
object id received in a "shallow" line
shallowOid
)

Add Object received in a "shallow" line

pack-priv FetchV2Request.Builder

Returns:

this builder
addDeepenNot
(String
reference received in a "deepen not" line
deepenNot
)

Add reference received in a "deepen not" line

pack-priv FetchV2Request.Builder
pack-priv FetchV2Request.Builder

Returns:

this builder
addPeerHas
(ObjectId
object id received in a "have" line
objectId
)

Add object the peer has

pack-priv FetchV2Request.Builder

Returns:

this builder
addServerOption
(String
the client-supplied server-option capability, without leading "server-option=".
value
)

Records an application-specific option supplied in a server-option line, for later retrieval with FetchV2Request#getServerOptions.

pack-priv FetchV2Request.Builder

Returns:

this builder
addWantedRef
(String
reference name
refName
)

Add Ref received in "want-ref" line and the object-id it refers to

pack-priv FetchV2Request.Builder

Returns:

this builder
addWantId
(ObjectId
object id received in a "want" line
wantId
)

Add object received in "want" line

pack-priv FetchV2Request

Returns:

Initialized fetch request
build
()

Build initialized fetch request

pack-priv int

Returns:

shallow since value, sent before in a "deepen since" line. 0 by default.
getDeepenSince
()

Get shallow since value

pack-priv int

Returns:

depth set in the request (via a "deepen" line). Defaulting to 0 if not set.
getDepth
()

Get depth set in request

pack-priv boolean

Returns:

true if there has been at least one "deepen not" line in the request so far
hasDeepenNots
()

Whether there has been at least one ""deepen not" line

pack-priv FetchV2Request.Builder

Returns:

this builder
setAgent
(String
the client-supplied agent capability, without the leading "agent="
agentValue
)

Value of an agent line received after the command and before the arguments.

pack-priv FetchV2Request.Builder

Returns:

this builder
setClientSID
(String
the client-supplied session capability, without the leading "session-id="
clientSIDValue
)

Set value of client-supplied session capability

pack-priv FetchV2Request.Builder

Returns:

this builder
setDeepenSince
(int
Unix timestamp received in a "deepen since" line
value
)

Set Unix timestamp received in a "deepen since" line

pack-priv FetchV2Request.Builder

Returns:

this builder
setDepth
(int
Depth received in a "deepen" line
d
)

Set depth received in "deepen" line

pack-priv FetchV2Request.Builder

Returns:

this builder
setDoneReceived
()

Mark that the "done" line has been received.

pack-priv FetchV2Request.Builder

Returns:

this builder
setFilterSpec
(FilterSpec
spec set in a "filter" line
filter
)

Set filter spec

pack-priv FetchV2Request.Builder

Returns:

this builder
setSidebandAll
(boolean
true if client sent "sideband-all"
value
)

Set whether client sent "sideband-all

pack-priv FetchV2Request.Builder

Returns:

this builder
setWaitForDone
()

Mark that the "wait-for-done" line has been received.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

agentback to summary
pack-priv String agent
Annotations
@Nullable
clientCapabilitiesback to summary
pack-priv final Set<String> clientCapabilities
clientShallowCommitsback to summary
pack-priv final Set<ObjectId> clientShallowCommits
clientSIDback to summary
pack-priv String clientSID
Annotations
@Nullable
deepenNotsback to summary
pack-priv final List<String> deepenNots
deepenSinceback to summary
pack-priv int deepenSince
depthback to summary
pack-priv int depth
doneReceivedback to summary
pack-priv boolean doneReceived
filterSpecback to summary
pack-priv FilterSpec filterSpec
packfileUriProtocolsback to summary
pack-priv final List<String> packfileUriProtocols
peerHasback to summary
pack-priv final List<ObjectId> peerHas
serverOptionsback to summary
pack-priv final List<String> serverOptions
sidebandAllback to summary
pack-priv boolean sidebandAll
waitForDoneback to summary
pack-priv boolean waitForDone
wantedRefsback to summary
pack-priv final List<String> wantedRefs
wantIdsback to summary
pack-priv final Set<ObjectId> wantIds

Constructor Detail

Builderback to summary
private Builder()

Method Detail

addClientCapabilityback to summary
pack-priv FetchV2Request.Builder addClientCapability(String clientCapability)

Add client capability

Parameters
clientCapability:String

capability line sent by the client

Returns:FetchV2Request.Builder

this builder

addClientShallowCommitback to summary
pack-priv FetchV2Request.Builder addClientShallowCommit(ObjectId shallowOid)

Add Object received in a "shallow" line

Parameters
shallowOid:ObjectId

object id received in a "shallow" line

Returns:FetchV2Request.Builder

this builder

addDeepenNotback to summary
pack-priv FetchV2Request.Builder addDeepenNot(String deepenNot)

Add reference received in a "deepen not" line

Parameters
deepenNot:String

reference received in a "deepen not" line

Returns:FetchV2Request.Builder

this builder

addPackfileUriProtocolback to summary
pack-priv FetchV2Request.Builder addPackfileUriProtocol(String value)
addPeerHasback to summary
pack-priv FetchV2Request.Builder addPeerHas(ObjectId objectId)

Add object the peer has

Parameters
objectId:ObjectId

object id received in a "have" line

Returns:FetchV2Request.Builder

this builder

addServerOptionback to summary
pack-priv FetchV2Request.Builder addServerOption(String value)

Records an application-specific option supplied in a server-option line, for later retrieval with FetchV2Request#getServerOptions.

Parameters
value:String

the client-supplied server-option capability, without leading "server-option=".

Returns:FetchV2Request.Builder

this builder

addWantedRefback to summary
pack-priv FetchV2Request.Builder addWantedRef(String refName)

Add Ref received in "want-ref" line and the object-id it refers to

Parameters
refName:String

reference name

Returns:FetchV2Request.Builder

this builder

addWantIdback to summary
pack-priv FetchV2Request.Builder addWantId(ObjectId wantId)

Add object received in "want" line

Parameters
wantId:ObjectId

object id received in a "want" line

Returns:FetchV2Request.Builder

this builder

buildback to summary
pack-priv FetchV2Request build()

Build initialized fetch request

Returns:FetchV2Request

Initialized fetch request

getDeepenSinceback to summary
pack-priv int getDeepenSince()

Get shallow since value

Returns:int

shallow since value, sent before in a "deepen since" line. 0 by default.

getDepthback to summary
pack-priv int getDepth()

Get depth set in request

Returns:int

depth set in the request (via a "deepen" line). Defaulting to 0 if not set.

hasDeepenNotsback to summary
pack-priv boolean hasDeepenNots()

Whether there has been at least one ""deepen not" line

Returns:boolean

true if there has been at least one "deepen not" line in the request so far

setAgentback to summary
pack-priv FetchV2Request.Builder setAgent(String agentValue)

Value of an agent line received after the command and before the arguments. E.g. "agent=a.b.c/1.0" should set "a.b.c/1.0".

Parameters
agentValue:String

the client-supplied agent capability, without the leading "agent="

Returns:FetchV2Request.Builder

this builder

setClientSIDback to summary
pack-priv FetchV2Request.Builder setClientSID(String clientSIDValue)

Set value of client-supplied session capability

Parameters
clientSIDValue:String

the client-supplied session capability, without the leading "session-id="

Returns:FetchV2Request.Builder

this builder

setDeepenSinceback to summary
pack-priv FetchV2Request.Builder setDeepenSince(int value)

Set Unix timestamp received in a "deepen since" line

Parameters
value:int

Unix timestamp received in a "deepen since" line

Returns:FetchV2Request.Builder

this builder

setDepthback to summary
pack-priv FetchV2Request.Builder setDepth(int d)

Set depth received in "deepen" line

Parameters
d:int

Depth received in a "deepen" line

Returns:FetchV2Request.Builder

this builder

setDoneReceivedback to summary
pack-priv FetchV2Request.Builder setDoneReceived()

Mark that the "done" line has been received.

Returns:FetchV2Request.Builder

this builder

setFilterSpecback to summary
pack-priv FetchV2Request.Builder setFilterSpec(FilterSpec filter)

Set filter spec

Parameters
filter:FilterSpec

spec set in a "filter" line

Returns:FetchV2Request.Builder

this builder

setSidebandAllback to summary
pack-priv FetchV2Request.Builder setSidebandAll(boolean value)

Set whether client sent "sideband-all

Parameters
value:boolean

true if client sent "sideband-all"

Returns:FetchV2Request.Builder

this builder

setWaitForDoneback to summary
pack-priv FetchV2Request.Builder setWaitForDone()

Mark that the "wait-for-done" line has been received.

Returns:FetchV2Request.Builder

this builder