|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.transport.ReceivePack
public class ReceivePack
Implements the server side of a push connection, receiving objects.
| Constructor Summary | |
|---|---|
ReceivePack(Repository into)
Create a new pack receive for an open repository. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,Ref> |
getAdvertisedRefs()
|
java.util.List<ReceiveCommand> |
getAllCommands()
|
PostReceiveHook |
getPostReceiveHook()
|
PreReceiveHook |
getPreReceiveHook()
|
PersonIdent |
getRefLogIdent()
|
Repository |
getRepository()
|
RevWalk |
getRevWalk()
|
int |
getTimeout()
|
boolean |
isAllowCreates()
|
boolean |
isAllowDeletes()
|
boolean |
isAllowNonFastForwards()
|
boolean |
isCheckReceivedObjects()
|
void |
receive(java.io.InputStream input,
java.io.OutputStream output,
java.io.OutputStream messages)
Execute the receive task on the socket. |
void |
sendError(java.lang.String what)
Send an error message to the client, if it supports receiving them. |
void |
sendMessage(java.lang.String what)
Send a message to the client, if it supports receiving them. |
void |
setAllowCreates(boolean canCreate)
|
void |
setAllowDeletes(boolean canDelete)
|
void |
setAllowNonFastForwards(boolean canRewind)
|
void |
setCheckReceivedObjects(boolean check)
|
void |
setPostReceiveHook(PostReceiveHook h)
Set the hook which is invoked after commands are executed. |
void |
setPreReceiveHook(PreReceiveHook h)
Set the hook which is invoked prior to commands being executed. |
void |
setRefLogIdent(PersonIdent pi)
Set the identity of the user appearing in the affected reflogs. |
void |
setTimeout(int seconds)
Set the timeout before willing to abort an IO call. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReceivePack(Repository into)
into - the destination repository.| Method Detail |
|---|
public final Repository getRepository()
public final RevWalk getRevWalk()
public final java.util.Map<java.lang.String,Ref> getAdvertisedRefs()
public boolean isCheckReceivedObjects()
public void setCheckReceivedObjects(boolean check)
check - true to enable checking received objects; false to assume all
received objects are valid.public boolean isAllowCreates()
public void setAllowCreates(boolean canCreate)
canCreate - true to permit create ref commands to be processed.public boolean isAllowDeletes()
public void setAllowDeletes(boolean canDelete)
canDelete - true to permit delete ref commands to be processed.public boolean isAllowNonFastForwards()
public void setAllowNonFastForwards(boolean canRewind)
canRewind - true to permit the client to ask for non-fast-forward updates
of an existing ref.public PersonIdent getRefLogIdent()
public void setRefLogIdent(PersonIdent pi)
The timestamp portion of the identity is ignored. A new identity with the current timestamp will be created automatically when the updates occur and the log records are written.
pi - identity of the user. If null the identity will be
automatically determined based on the repository
configuration.public PreReceiveHook getPreReceiveHook()
public void setPreReceiveHook(PreReceiveHook h)
Only valid commands (those which have no obvious errors according to the
received input and this instance's configuration) are passed into the
hook. The hook may mark a command with a result of any value other than
ReceiveCommand.Result.NOT_ATTEMPTED to block its execution.
The hook may be called with an empty command collection if the current set is completely invalid.
h - the hook instance; may be null to disable the hook.public PostReceiveHook getPostReceiveHook()
public void setPostReceiveHook(PostReceiveHook h)
Only successful commands (type is ReceiveCommand.Result.OK) are passed into the
hook. The hook may be called with an empty command collection if the
current set all resulted in an error.
h - the hook instance; may be null to disable the hook.public int getTimeout()
public void setTimeout(int seconds)
seconds - number of seconds to wait (with no data transfer occurring)
before aborting an IO read or write operation with the
connected client.public java.util.List<ReceiveCommand> getAllCommands()
public void sendError(java.lang.String what)
If the client doesn't support receiving messages, the message will be discarded, with no other indication to the caller or to the client.
PreReceiveHooks should always try to use
ReceiveCommand.setResult(Result, String) with a result status of
ReceiveCommand.Result.REJECTED_OTHER_REASON to indicate any reasons for
rejecting an update. Messages attached to a command are much more likely
to be returned to the client.
what - string describing the problem identified by the hook. The
string must not end with an LF, and must not contain an LF.public void sendMessage(java.lang.String what)
If the client doesn't support receiving messages, the message will be discarded, with no other indication to the caller or to the client.
what - string describing the problem identified by the hook. The
string must not end with an LF, and must not contain an LF.
public void receive(java.io.InputStream input,
java.io.OutputStream output,
java.io.OutputStream messages)
throws java.io.IOException
input - raw input to read client commands and pack data from. Caller
must ensure the input is buffered, otherwise read performance
may suffer.output - response back to the Git network client. Caller must ensure
the output is buffered, otherwise write performance may
suffer.messages - 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.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||