| Modifier and Type | Class and Description |
|---|---|
| public static class | UploadPack.
Validator corresponding to |
| public static class | UploadPack.
Validator corresponding to |
| private static interface | |
| private static interface | |
| private static enum | |
| private class | |
| public static class | UploadPack.
Validator corresponding to |
| public static class | UploadPack.
Validator corresponding to |
| public static enum | UploadPack.
Policy the server uses to validate client requests |
| public static interface | UploadPack.
Validator for client requests. |
| private static class | |
| private class | |
| public static class | UploadPack.
Validator corresponding to |
| Modifier and Type | Field and Description |
|---|---|
| private Set | advertised
Objects we sent in our advertisement list. |
| private AdvertiseRefsHook | advertiseRefsHook
Hook used while advertising the refs to the client. |
| private boolean | advertiseRefsHookCalled
Whether the |
| private boolean | biDirectionalPipe
Is the client connection a bi-directional socket or pipe? |
| private CachedPackUriProvider | |
| private boolean | clientRequestedV2
Whether the client requested to use protocol V2 through a side channel (such as the Git-Protocol HTTP header). |
| private final RevFlag | COMMON
Marked on objects in |
| private final Set | commonBase
Objects on both sides, these don't have to be sent. |
| private FetchRequest | currentRequest
Request this instance is handling. |
| private final Repository | db
Database we read the objects from. |
| private UploadPack. | |
| private OutputStream | |
| private GitProtocolConstants. | |
| private boolean | |
| private Boolean | okToGiveUp
null if |
| private int | oldestTime
Commit time of the oldest common commit, in seconds. |
| private PackConfig | packConfig
Configuration to pass into the PackWriter. |
| private PacketLineIn | |
| private final RevFlag | PEER_HAS
Marked on objects both we and the client have. |
| private PostUploadHook | postUploadHook
Hook for taking post upload actions. |
| private PreUploadHook | preUploadHook
Hook handling the various upload phases. |
| private ProtocolV2Hook | protocolV2Hook
Hook used while processing Git protocol v2 requests. |
| private InputStream | |
| private UploadPack. | |
| private RefFilter | refFilter
Filter used while advertising the refs to the client. |
| private Map | refs
Refs eligible for advertising to the client, set using
|
| private UploadPack. | |
| private final RevFlag | SATISFIED
Objects where we found a path from the want list to a common base. |
| private final RevFlagSet | |
| private boolean | |
| private PackStatistics | |
| private int | timeout
Timeout in seconds to wait for client interaction. |
| private InterruptTimer | |
| private TransferConfig | transferConfig
Configuration for various transfer options. |
| pack-priv String | userAgent
Caller user agent |
| private final RevWalk | |
| private final RevFlag | WANT
Marked on objects the client has asked us to give them. |
| private final Set | wantAll
Objects the client wants to obtain. |
| private Set | wantIds
Raw ObjectIds the client has asked for, before validating them. |
| Access | Constructor and Description |
|---|---|
| public | UploadPack(Repository
the source repository. copyFrom)Create a new pack upload for an open repository. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private static void | checkNotAdvertisedWants(UploadPack up, List<ObjectId> notAdvertisedWants, Collection<Ref> visibleRefs)
|
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| private void | computeShallowsAndUnshallows(FetchRequest req, UploadPack.
|
| private Map | |
| private void | |
| private Ref | |
| private static void | |
| private Map | |
| public final Map | Returns: all refs which were advertised to the client. Only valid during the negotiation phase. Will returnnull if
setAdvertisedRefs(Map) has not been called yet or if
#sendPack() has been called.Get refs which were advertised to the client. |
| public AdvertiseRefsHook | Returns: the hook used while advertising the refs to the client.Get the hook used while advertising the refs to the client. |
| private Map | |
| public String | Returns: The session ID if it has been received from the client.Get the session ID if received from the client. |
| public int | Returns: the depth requested by the client, or 0 if unbounded.Returns the clone/fetch depth. |
| private Map | |
| public final FilterSpec | Returns: filter requested by the clientReturns the filter spec for the current request. |
| public OutputStream | Returns: an underlying stream for sending messages to the client, or null.Get an underlying stream for sending messages to the client |
| public String | Returns: user agent supplied by the client. Available only if the client is new enough to advertise its user agent.Get the user agent of the client. |
| public PostUploadHook | |
| public PreUploadHook | |
| public ProtocolV2Hook | Returns: the hook or a default implementation if none installed.Get the currently installed protocol v2 hook. |
| public RefFilter | Returns: the filter used while advertising the refs to the client.Get the filter used while advertising the refs to the client. |
| public final Repository | Returns: the repository this upload is reading from.Get the repository this upload is reading from. |
| public UploadPack. | Returns: policy used by the service to validate client requests, or null for a custom request validator.Get policy used by the service to validate client requests |
| public final RevWalk | Returns: the RevWalk instance used by this connection.Get the RevWalk instance used by this connection. |
| public PackStatistics | Returns: statistics about pack output, if a pack was sent. Null if no pack was sent, such as during the negotiation phase of a smart HTTP connection, or if the client was already up-to-date.Get the PackWriter's statistics if a pack was sent to the client. |
| public int | Returns: timeout (in seconds) before aborting an IO operation.Get timeout (in seconds) before aborting an IO operation. |
| private List | |
| pack-priv static Stream | |
| public boolean | Returns: true if this class expects a bi-directional pipe opened between the client and itself. The default is true.Whether this class expects a bi-directional pipe opened between the client and itself. |
| public boolean | Returns: true if the client has advertised a side-band capability, false otherwise.Check whether the client expects a side-band stream. |
| private void | |
| private static Map | |
| private boolean | |
| private static <T> Predicate | |
| private static List | |
| private static RevCommit | Returns: RevCommit instance or null if the object is missingwalk on the relevant object storae walk, ObjectId Object Id objectId)Translate an object id to a RevCommit. |
| private static RevObject | Returns: RevObject instance or null if the object is missingwalk on the relevant object storage walk, ObjectId Object Id objectId)Translate an object id to a RevObject. |
| private void | |
| private boolean | |
| private boolean | |
| private List | |
| private void | |
| private ObjectId | processHaveLines(List<ObjectId> peerHas, ObjectId last, PacketLineOut out, PackStatistics.
|
| private static Set | |
| private static ObjectId | |
| public void | sendAdvertisedRefs(RefAdvertiser
the advertisement formatter. adv)Generate an advertisement of available refs and capabilities. |
| public void | sendAdvertisedRefs(RefAdvertiser
the advertisement formatter. adv, String if not null, also output "# service=serviceName" followed by a
flush packet before the advertisement. This is required
in v0 of the HTTP protocol, described in Git's
Documentation/technical/http-protocol.txt. serviceName)Generate an advertisement of available refs and capabilities. |
| public void | sendMessage(String
string describing the problem identified by the hook. The
string must not end with an LF, and must not contain an LF. what)Send a message to the client, if it supports receiving them. |
| private void | sendPack(PackStatistics.
where to write statistics about the content of the pack. accumulator,request in process req, Collection<Ref> refs to search for annotated tags to include in the pack if
the allTags, List<ObjectId> GitProtocolConstants#OPTION_INCLUDE_TAG capability
was requested.shallow commits on the client that are now becoming unshallow unshallowCommits, List<ObjectId> objects that the client specified using --shallow-exclude deepenNots, PacketLineOut output writer pckOut)Send the requested objects to the client. |
| private void | sendPack(ProgressMonitor
progress monitor pm, PacketLineOut PacketLineOut that shares the output with packOut pckOut, OutputStream packfile output packOut, FetchRequest request being processed req, PackStatistics.where to write statistics about the content of the pack. accumulator,refs to search for annotated tags to include in the pack if
the allTags, List<ObjectId> GitProtocolConstants#OPTION_INCLUDE_TAG capability
was requested.shallow commits on the client that are now becoming unshallow unshallowCommits, List<ObjectId> objects that the client specified using --shallow-exclude deepenNots)Send the requested objects to the client. |
| private boolean | |
| private void | |
| private void | |
| public void | setAdvertisedRefs(Map<String, Ref>
explicit set of references to claim as advertised by this
UploadPack instance. This overrides any references that may
exist in the source repository. The map is passed to the
configured allRefs)getRefFilter(). If null, assumes all refs
were advertised.Set the refs advertised by this UploadPack. |
| public void | setAdvertiseRefsHook(AdvertiseRefsHook
the hook; may be null to show all refs. advertiseRefsHook)Set the hook used while advertising the refs to the client. |
| public void | setBiDirectionalPipe(boolean
if true, this class will assume the socket is a fully
bidirectional pipe between the two peers and takes advantage
of that by first transmitting the known refs, then waiting to
read commands. If false, this class assumes it must read the
commands before writing output and does not perform the
initial advertising. twoWay)Set whether this class will assume the socket is a fully bidirectional pipe between the two peers |
| public void | setCachedPackUriProvider(CachedPackUriProvider
provider of URIs corresponding to cached packs (to support the
packfile URIs feature) p)Set provider of cached pack URIs |
| public void | setExtraParameters(Collection<String>
parameters supplied by the client, split at colons or NUL
bytes. params)Set the Extra Parameters provided by the client. |
| public void | setPackConfig(PackConfig
configuration controlling packing parameters. If null the
source repository's settings will be used. pc)Set the configuration used by the pack generator. |
| public void | setPostUploadHook(PostUploadHook
the hook; if null no special actions are taken. hook)Set the hook for post upload actions (logging, repacking). |
| public void | setPreUploadHook(PreUploadHook
the hook; if null no special actions are taken. hook)Set the hook that controls how this instance will behave. |
| public void | setProtocolV2Hook(ProtocolV2Hook
the hook; if null no special actions are taken. hook)Set the protocol V2 hook. |
| public void | setRefFilter(RefFilter
the filter; may be null to show all refs. refFilter)Set the filter used while advertising the refs to the client. |
| public void | setRequestPolicy(UploadPack.
the policy used to enforce validation of a client's want list.
By default the policy is
policyorg.,
which is the Git default requiring clients to only ask for an
object that a reference directly points to. This may be
relaxed to
org.
or
org.
when callers have setBiDirectionalPipe(boolean) set
to false. Overrides any policy specified in a
org..Set the policy used to enforce validation of a client's want list. |
| public void | setRequestValidator(UploadPack.
custom validator for client want list. validatorSet custom validator for client want list. |
| public void | setTimeout(int
number of seconds to wait (with no data transfer occurring)
before aborting an IO read or write operation with the
connected client. seconds)Set the timeout before willing to abort an IO call. |
| public void | setTransferConfig(TransferConfig
configuration controlling transfer options. If null the source
repository's settings will be used. tc)Set configuration controlling transfer options. |
| private boolean | |
| public void | upload(InputStream
input stream input, OutputStream output stream output, OutputStream stream for messages messages)Execute the upload task on the socket. |
| public void | uploadWithExceptionPropagation(InputStream
raw input to read client commands from. Caller must ensure the
input is buffered, otherwise read performance may suffer. input, OutputStream response back to the Git network client, to write the pack
data onto. Caller must ensure the output is buffered,
otherwise write performance may suffer. output, OutputStream secondary "notice" channel to send additional messages out
through. When run over SSH this should be tied back to the
standard error channel of the command execution. For most
other network connections this should be null. messages)Execute the upload task on the socket. |
| private boolean | |
| private void | |
| private void | |
| private Map | |
| private boolean |