C# Class NGit.Transport.UploadPack

Implements the server side of a fetch connection, transmitting objects.
Implements the server side of a fetch connection, transmitting objects.
Exibir arquivo Open project: red-gate/ngit Class Usage Examples

Public Methods

Method Description
GetAdvertiseRefsHook ( ) : NGit.Transport.AdvertiseRefsHook
GetAdvertisedRefs ( ) : Ref>.IDictionary

Get refs which were advertised to the client.

Get refs which were advertised to the client.

GetLogger ( ) : NGit.Transport.UploadPackLogger
GetPackStatistics ( ) : PackWriter.Statistics

Get the PackWriter's statistics if a pack was sent to the client.

Get the PackWriter's statistics if a pack was sent to the client.

GetPreUploadHook ( ) : PreUploadHook
GetRefFilter ( ) : NGit.Transport.RefFilter
GetRepository ( ) : Repository
GetRequestPolicy ( ) : UploadPack.RequestPolicy
GetRevWalk ( ) : RevWalk
GetTimeout ( ) : int
IsBiDirectionalPipe ( ) : bool
IsSideBand ( ) : bool

Check whether the client expects a side-band stream.

Check whether the client expects a side-band stream.

SendAdvertisedRefs ( NGit.Transport.RefAdvertiser adv ) : void

Generate an advertisement of available refs and capabilities.

Generate an advertisement of available refs and capabilities.

SetAdvertiseRefsHook ( NGit.Transport.AdvertiseRefsHook advertiseRefsHook ) : void

Set the hook used while advertising the refs to the client.

Set the hook used while advertising the refs to the client.

If the AdvertiseRefsHook chooses to call SetAdvertisedRefs(System.Collections.Generic.IDictionary<K, V>) , only refs set by this hook and selected by the RefFilter will be shown to the client.

SetAdvertisedRefs ( Ref>.IDictionary allRefs ) : void

Set the refs advertised by this UploadPack.

Set the refs advertised by this UploadPack.

Intended to be called from a PreUploadHook .

SetBiDirectionalPipe ( bool twoWay ) : void
SetLogger ( NGit.Transport.UploadPackLogger logger ) : void

Set the logger.

Set the logger.

SetPackConfig ( NGit.Storage.Pack.PackConfig pc ) : void

Set the configuration used by the pack generator.

Set the configuration used by the pack generator.

SetPreUploadHook ( PreUploadHook hook ) : void

Set the hook that controls how this instance will behave.

Set the hook that controls how this instance will behave.

SetRefFilter ( NGit.Transport.RefFilter refFilter ) : void

Set the filter used while advertising the refs to the client.

Set the filter used while advertising the refs to the client.

Only refs allowed by this filter will be sent to the client. The filter is run against the refs specified by the AdvertiseRefsHook (if applicable).

SetRequestPolicy ( UploadPack policy ) : void
SetTimeout ( int seconds ) : void

Set the timeout before willing to abort an IO call.

Set the timeout before willing to abort an IO call.

Upload ( InputStream input, OutputStream output, OutputStream messages ) : void

Execute the upload task on the socket.

Execute the upload task on the socket.

UploadPack ( Repository copyFrom ) : System

Create a new pack upload for an open repository.

Create a new pack upload for an open repository.

Private Methods

Method Description
AddCommonBase ( NGit.Revwalk.RevObject o ) : void
CheckNotAdvertisedWants ( ICollection notAdvertisedWants ) : void
GetAdvertisedOrDefaultRefs ( ) : Ref>.IDictionary
Negotiate ( ) : bool
OkToGiveUp ( ) : bool
OkToGiveUpImp ( ) : bool
ProcessHaveLines ( IList peerHas, NGit.ObjectId last ) : NGit.ObjectId
ProcessShallow ( ) : void
RecvWants ( ) : void
ReportErrorDuringNegotiate ( string msg ) : void
ReportInternalServerErrorOverSideband ( Exception error ) : bool
SendPack ( ) : void
SendPack ( bool sideband ) : void
Service ( ) : void
WantSatisfied ( NGit.Revwalk.RevObject want ) : bool

Method Details

GetAdvertiseRefsHook() public method

public GetAdvertiseRefsHook ( ) : NGit.Transport.AdvertiseRefsHook
return NGit.Transport.AdvertiseRefsHook

GetAdvertisedRefs() public method

Get refs which were advertised to the client.
Get refs which were advertised to the client.
public GetAdvertisedRefs ( ) : Ref>.IDictionary
return Ref>.IDictionary

GetLogger() public method

public GetLogger ( ) : NGit.Transport.UploadPackLogger
return NGit.Transport.UploadPackLogger

GetPackStatistics() public method

Get the PackWriter's statistics if a pack was sent to the client.
Get the PackWriter's statistics if a pack was sent to the client.
public GetPackStatistics ( ) : PackWriter.Statistics
return PackWriter.Statistics

GetPreUploadHook() public method

public GetPreUploadHook ( ) : PreUploadHook
return PreUploadHook

GetRefFilter() public method

public GetRefFilter ( ) : NGit.Transport.RefFilter
return NGit.Transport.RefFilter

GetRepository() public method

public GetRepository ( ) : Repository
return Repository

GetRequestPolicy() public method

public GetRequestPolicy ( ) : UploadPack.RequestPolicy
return UploadPack.RequestPolicy

GetRevWalk() public method

public GetRevWalk ( ) : RevWalk
return RevWalk

GetTimeout() public method

public GetTimeout ( ) : int
return int

IsBiDirectionalPipe() public method

public IsBiDirectionalPipe ( ) : bool
return bool

IsSideBand() public method

Check whether the client expects a side-band stream.
Check whether the client expects a side-band stream.
/// if the client's request has not yet been read from the wire, so /// we do not know if they expect side-band. Note that the client /// may have already written the request, it just has not been /// read. ///
public IsSideBand ( ) : bool
return bool

SendAdvertisedRefs() public method

Generate an advertisement of available refs and capabilities.
Generate an advertisement of available refs and capabilities.
the formatter failed to write an advertisement. /// the hook denied advertisement.
public SendAdvertisedRefs ( NGit.Transport.RefAdvertiser adv ) : void
adv NGit.Transport.RefAdvertiser the advertisement formatter.
return void

SetAdvertiseRefsHook() public method

Set the hook used while advertising the refs to the client.
Set the hook used while advertising the refs to the client.

If the AdvertiseRefsHook chooses to call SetAdvertisedRefs(System.Collections.Generic.IDictionary<K, V>) , only refs set by this hook and selected by the RefFilter will be shown to the client.

public SetAdvertiseRefsHook ( NGit.Transport.AdvertiseRefsHook advertiseRefsHook ) : void
advertiseRefsHook NGit.Transport.AdvertiseRefsHook the hook; may be null to show all refs.
return void

SetAdvertisedRefs() public method

Set the refs advertised by this UploadPack.
Set the refs advertised by this UploadPack.

Intended to be called from a PreUploadHook .

public SetAdvertisedRefs ( Ref>.IDictionary allRefs ) : void
allRefs Ref>.IDictionary /// 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 /// GetRefFilter() /// . If null, assumes /// all refs were advertised. ///
return void

SetBiDirectionalPipe() public method

public SetBiDirectionalPipe ( bool twoWay ) : void
twoWay bool /// 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. ///
return void

SetLogger() public method

Set the logger.
Set the logger.
public SetLogger ( NGit.Transport.UploadPackLogger logger ) : void
logger NGit.Transport.UploadPackLogger the logger instance. If null, no logging occurs.
return void

SetPackConfig() public method

Set the configuration used by the pack generator.
Set the configuration used by the pack generator.
public SetPackConfig ( NGit.Storage.Pack.PackConfig pc ) : void
pc NGit.Storage.Pack.PackConfig /// configuration controlling packing parameters. If null the /// source repository's settings will be used. ///
return void

SetPreUploadHook() public method

Set the hook that controls how this instance will behave.
Set the hook that controls how this instance will behave.
public SetPreUploadHook ( PreUploadHook hook ) : void
hook PreUploadHook the hook; if null no special actions are taken.
return void

SetRefFilter() public method

Set the filter used while advertising the refs to the client.
Set the filter used while advertising the refs to the client.

Only refs allowed by this filter will be sent to the client. The filter is run against the refs specified by the AdvertiseRefsHook (if applicable).

public SetRefFilter ( NGit.Transport.RefFilter refFilter ) : void
refFilter NGit.Transport.RefFilter the filter; may be null to show all refs.
return void

SetRequestPolicy() public method

public SetRequestPolicy ( UploadPack policy ) : void
policy UploadPack /// the policy used to enforce validation of a client's want list. /// By default the policy is /// RequestPolicy.ADVERTISED /// , /// which is the Git default requiring clients to only ask for an /// object that a reference directly points to. This may be relaxed /// to /// RequestPolicy.REACHABLE_COMMIT /// when callers /// have /// SetBiDirectionalPipe(bool) /// set to false. ///
return void

SetTimeout() public method

Set the timeout before willing to abort an IO call.
Set the timeout before willing to abort an IO call.
public SetTimeout ( int seconds ) : void
seconds int /// number of seconds to wait (with no data transfer occurring) /// before aborting an IO read or write operation with the /// connected client. ///
return void

Upload() public method

Execute the upload task on the socket.
Execute the upload task on the socket.
System.IO.IOException
public Upload ( InputStream input, OutputStream output, OutputStream messages ) : void
input Sharpen.InputStream /// raw input to read client commands from. Caller must ensure the /// input is buffered, otherwise read performance may suffer. ///
output Sharpen.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. ///
messages Sharpen.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. ///
return void

UploadPack() public method

Create a new pack upload for an open repository.
Create a new pack upload for an open repository.
public UploadPack ( Repository copyFrom ) : System
copyFrom Repository the source repository.
return System