org.eclipse.jgit.transport
Class ReceiveCommand

java.lang.Object
  extended by org.eclipse.jgit.transport.ReceiveCommand

public class ReceiveCommand
extends Object

A command being processed by ReceivePack.

This command instance roughly translates to the server side representation of the RemoteRefUpdate created by the client.


Nested Class Summary
static class ReceiveCommand.Result
          Result of the update command.
static class ReceiveCommand.Type
          Type of operation requested.
 
Constructor Summary
ReceiveCommand(ObjectId oldId, ObjectId newId, String name)
          Create a new command for ReceivePack.
 
Method Summary
 String getMessage()
           
 ObjectId getNewId()
           
 ObjectId getOldId()
           
 Ref getRef()
           
 String getRefName()
           
 ReceiveCommand.Result getResult()
           
 ReceiveCommand.Type getType()
           
 void setResult(ReceiveCommand.Result s)
          Set the status of this command.
 void setResult(ReceiveCommand.Result s, String m)
          Set the status of this command.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReceiveCommand

public ReceiveCommand(ObjectId oldId,
                      ObjectId newId,
                      String name)
Create a new command for ReceivePack.

Parameters:
oldId - the old object id; must not be null. Use ObjectId.zeroId() to indicate a ref creation.
newId - the new object id; must not be null. Use ObjectId.zeroId() to indicate a ref deletion.
name - name of the ref being affected.
Method Detail

getOldId

public ObjectId getOldId()
Returns:
the old value the client thinks the ref has.

getNewId

public ObjectId getNewId()
Returns:
the requested new value for this ref.

getRefName

public String getRefName()
Returns:
the name of the ref being updated.

getType

public ReceiveCommand.Type getType()
Returns:
the type of this command; see ReceiveCommand.Type.

getRef

public Ref getRef()
Returns:
the ref, if this was advertised by the connection.

getResult

public ReceiveCommand.Result getResult()
Returns:
the current status code of this command.

getMessage

public String getMessage()
Returns:
the message associated with a failure status.

setResult

public void setResult(ReceiveCommand.Result s)
Set the status of this command.

Parameters:
s - the new status code for this command.

setResult

public void setResult(ReceiveCommand.Result s,
                      String m)
Set the status of this command.

Parameters:
s - new status code for this command.
m - optional message explaining the new status.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.