Package org.eclipse.jgit.transport
Class FetchRequest
- java.lang.Object
-
- org.eclipse.jgit.transport.FetchRequest
-
- Direct Known Subclasses:
FetchV0Request
,FetchV2Request
abstract class FetchRequest extends java.lang.Object
Common fields between v0/v1/v2 fetch requests.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
agent
(package private) java.util.Set<java.lang.String>
clientCapabilities
(package private) java.util.Set<ObjectId>
clientShallowCommits
(package private) java.util.List<java.lang.String>
deepenNotRefs
(package private) int
deepenSince
(package private) int
depth
(package private) FilterSpec
filterSpec
(package private) java.util.Set<ObjectId>
wantIds
-
Constructor Summary
Constructors Constructor Description FetchRequest(java.util.Set<ObjectId> wantIds, int depth, java.util.Set<ObjectId> clientShallowCommits, FilterSpec filterSpec, java.util.Set<java.lang.String> clientCapabilities, int deepenSince, java.util.List<java.lang.String> deepenNotRefs, java.lang.String agent)
Initialize the common fields of a fetch request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.String
getAgent()
(package private) java.util.Set<java.lang.String>
getClientCapabilities()
Capabilities that the client wants enabled from the server.(package private) java.util.Set<ObjectId>
getClientShallowCommits()
Shallow commits the client already has.(package private) java.util.List<java.lang.String>
getDeepenNotRefs()
(package private) int
getDeepenSince()
The value in a "deepen-since" line in the request, indicating the timestamp where to stop fetching/cloning.(package private) int
getDepth()
(package private) FilterSpec
getFilterSpec()
(package private) java.util.Set<ObjectId>
getWantIds()
-
-
-
Field Detail
-
wantIds
final java.util.Set<ObjectId> wantIds
-
depth
final int depth
-
clientShallowCommits
final java.util.Set<ObjectId> clientShallowCommits
-
filterSpec
final FilterSpec filterSpec
-
clientCapabilities
final java.util.Set<java.lang.String> clientCapabilities
-
deepenSince
final int deepenSince
-
deepenNotRefs
final java.util.List<java.lang.String> deepenNotRefs
-
agent
@Nullable final java.lang.String agent
-
-
Constructor Detail
-
FetchRequest
FetchRequest(@NonNull java.util.Set<ObjectId> wantIds, int depth, @NonNull java.util.Set<ObjectId> clientShallowCommits, @NonNull FilterSpec filterSpec, @NonNull java.util.Set<java.lang.String> clientCapabilities, int deepenSince, @NonNull java.util.List<java.lang.String> deepenNotRefs, @Nullable java.lang.String agent)
Initialize the common fields of a fetch request.- Parameters:
wantIds
- list of want idsdepth
- how deep to go in the treeclientShallowCommits
- commits the client has without historyfilterSpec
- the filter specclientCapabilities
- capabilities sent in the requestdeepenNotRefs
- Requests that the shallow clone/fetch should be cut at these specific revisions instead of a depth.deepenSince
- Requests that the shallow clone/fetch should be cut at a specific time, instead of depthagent
- agent as reported by the client in the request body
-
-
Method Detail
-
getWantIds
@NonNull java.util.Set<ObjectId> getWantIds()
- Returns:
- object ids in the "want" (and "want-ref") lines of the request
-
getDepth
int getDepth()
- Returns:
- the depth set in a "deepen" line. 0 by default.
-
getClientShallowCommits
@NonNull java.util.Set<ObjectId> getClientShallowCommits()
Shallow commits the client already has. These are sent by the client in "shallow" request lines.- Returns:
- set of commits the client has declared as shallow.
-
getFilterSpec
@NonNull FilterSpec getFilterSpec()
- Returns:
- the filter spec given in a "filter" line
-
getClientCapabilities
@NonNull java.util.Set<java.lang.String> getClientCapabilities()
Capabilities that the client wants enabled from the server. Capabilities are options that tune the expected response from the server, like "thin-pack", "no-progress" or "ofs-delta". This list should be a subset of the capabilities announced by the server in its first response. These options are listed and well-defined in the git protocol specification. The agent capability is not included in this set. It can be retrieved viagetAgent()
.- Returns:
- capabilities sent by the client (excluding the "agent" capability)
-
getDeepenSince
int getDeepenSince()
The value in a "deepen-since" line in the request, indicating the timestamp where to stop fetching/cloning.- Returns:
- timestamp in seconds since the epoch, where to stop the shallow fetch/clone. Defaults to 0 if not set in the request.
-
getDeepenNotRefs
@NonNull java.util.List<java.lang.String> getDeepenNotRefs()
- Returns:
- refs received in "deepen-not" lines.
-
getAgent
@Nullable java.lang.String getAgent()
- Returns:
- string identifying the agent (as sent in the request body by the client)
-
-