gps.protocol.BT.param
Class BTGetRequest

java.lang.Object
  extended by gps.protocol.BT.param.BTGetRequest

public class BTGetRequest
extends java.lang.Object

includes informations in the get command from peer to server. Tracker GET request includes the following keys: info_hash: hash key of the intened document peer_id ip port uploaded downloaded left event: started, completed, or stopped, or empty In our simulation, only relavent information is included the get request is identified by docHashKey

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Field Summary
static int COMPLETED
          download finished
 BTPeer mBTPeer
          reference back to BTPeer
 BTSession mBTSession
          reference back to BTSession object that send out the request
 java.lang.String mDocHashKey
          document hash key
 int mEvent
          request type
 double mLeft
          left amount
static int STARTED
          download first begins
static int STOPPED
          download cancelled
 
Constructor Summary
BTGetRequest(java.lang.String hashKey, int event, double left, BTSession session)
          constructs new request object
 
Method Summary
 java.lang.String eventToString()
          gets string description of request
 java.lang.String toString()
          gets string description of request
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STARTED

public static final int STARTED
download first begins

See Also:
Constant Field Values

COMPLETED

public static final int COMPLETED
download finished

See Also:
Constant Field Values

STOPPED

public static final int STOPPED
download cancelled

See Also:
Constant Field Values

mDocHashKey

public java.lang.String mDocHashKey
document hash key


mEvent

public int mEvent
request type


mLeft

public double mLeft
left amount


mBTSession

public BTSession mBTSession
reference back to BTSession object that send out the request


mBTPeer

public BTPeer mBTPeer
reference back to BTPeer

Constructor Detail

BTGetRequest

public BTGetRequest(java.lang.String hashKey,
                    int event,
                    double left,
                    BTSession session)
constructs new request object

Parameters:
hashKey - document hash key
event - request type
left - left size
session - requesting session
Method Detail

eventToString

public java.lang.String eventToString()
gets string description of request

Returns:
string description of request

toString

public java.lang.String toString()
gets string description of request

Overrides:
toString in class java.lang.Object
Returns:
string description