Rice Pastry API

rice.pastry.join
Class JoinRequest

java.lang.Object
  extended byrice.pastry.messaging.Message
      extended byrice.pastry.messaging.PRawMessage
          extended byrice.pastry.join.JoinRequest
All Implemented Interfaces:
Message, RawMessage, java.io.Serializable

public class JoinRequest
extends PRawMessage

Request to join this network.

Version:
$Id: JoinRequest.java 3274 2006-05-15 16:17:47Z jeffh $
Author:
Jeff Hoye, Andrew Ladd
See Also:
Serialized Form

Field Summary
static byte HAS_HANDLE
          DESCRIBE THE FIELD
static byte HAS_JOIN_HANDLE
          DESCRIBE THE FIELD
static byte HAS_LEAFSET
          DESCRIBE THE FIELD
static short TYPE
          DESCRIBE THE FIELD
 
Fields inherited from class rice.pastry.messaging.Message
DEFAULT_PRIORITY_LEVEL
 
Fields inherited from interface rice.p2p.commonapi.Message
HIGH_PRIORITY, LOW_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY
 
Constructor Summary
JoinRequest(InputBuffer buf, NodeHandleFactory nhf, NodeHandle sender)
          Constructor for JoinRequest.
JoinRequest(NodeHandle nh, byte rtBaseBitLength)
          Constructor.
JoinRequest(NodeHandle nh, java.util.Date stamp, byte rtBaseBitLength)
          Constructor.
 
Method Summary
 boolean accepted()
          Returns true if the request was accepted, false if it hasn't yet.
 void acceptJoin(NodeHandle nh, LeafSet ls)
          Accept join request.
 NodeHandle getHandle()
          Gets the handle of the node trying to join.
 NodeHandle getJoinHandle()
          Gets the handle of the node that accepted the join request;
 LeafSet getLeafSet()
          Gets the leafset of the node that accepted the join request;
 RouteSet[] getRow(int i)
          Get row.
 short getType()
          Raw Serialization **************************************
 int lastRow()
          Returns the number of rows left to determine (in order).
 int numRows()
          Get the number of rows.
 void pushRow(RouteSet[] row)
          Push row.
 void serialize(OutputBuffer buf)
          DESCRIBE THE METHOD
 java.lang.String toString()
          DESCRIBE THE METHOD
 
Methods inherited from class rice.pastry.messaging.Message
getDate, getDestination, getPriority, getSender, getSenderId, setPriority, setSender, stamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface rice.p2p.commonapi.Message
getPriority
 

Field Detail

HAS_HANDLE

public static final byte HAS_HANDLE
DESCRIBE THE FIELD

See Also:
Constant Field Values

HAS_JOIN_HANDLE

public static final byte HAS_JOIN_HANDLE
DESCRIBE THE FIELD

See Also:
Constant Field Values

HAS_LEAFSET

public static final byte HAS_LEAFSET
DESCRIBE THE FIELD

See Also:
Constant Field Values

TYPE

public static final short TYPE
DESCRIBE THE FIELD

See Also:
Constant Field Values
Constructor Detail

JoinRequest

public JoinRequest(NodeHandle nh,
                   byte rtBaseBitLength)
Constructor.

Parameters:
nh - a handle of the node trying to join the network.
rtBaseBitLength - DESCRIBE THE PARAMETER

JoinRequest

public JoinRequest(NodeHandle nh,
                   java.util.Date stamp,
                   byte rtBaseBitLength)
Constructor.

Parameters:
nh - a handle of the node trying to join the network.
stamp - the timestamp
rtBaseBitLength - DESCRIBE THE PARAMETER

JoinRequest

public JoinRequest(InputBuffer buf,
                   NodeHandleFactory nhf,
                   NodeHandle sender)
            throws java.io.IOException
Constructor for JoinRequest.

Parameters:
buf - DESCRIBE THE PARAMETER
nhf - DESCRIBE THE PARAMETER
sender - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION
Method Detail

getHandle

public NodeHandle getHandle()
Gets the handle of the node trying to join.

Returns:
the handle.

getJoinHandle

public NodeHandle getJoinHandle()
Gets the handle of the node that accepted the join request;

Returns:
the handle.

getLeafSet

public LeafSet getLeafSet()
Gets the leafset of the node that accepted the join request;

Returns:
the leafset.

getRow

public RouteSet[] getRow(int i)
Get row.

Parameters:
i - the row to get.
Returns:
the row.

getType

public short getType()
Raw Serialization **************************************

Returns:
The Type value

accepted

public boolean accepted()
Returns true if the request was accepted, false if it hasn't yet.

Returns:
DESCRIBE THE RETURN VALUE

acceptJoin

public void acceptJoin(NodeHandle nh,
                       LeafSet ls)
Accept join request.

Parameters:
nh - the node handle that accepts the join request.
ls - DESCRIBE THE PARAMETER

lastRow

public int lastRow()
Returns the number of rows left to determine (in order).

Returns:
the number of rows left.

pushRow

public void pushRow(RouteSet[] row)
Push row.

Parameters:
row - the row to push.

numRows

public int numRows()
Get the number of rows.

Returns:
the number of rows.

toString

public java.lang.String toString()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
DESCRIBE THE METHOD

Parameters:
buf - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection