hypercast
Interface I_Node

All Superinterfaces:
I_Stats
All Known Implementing Classes:
DT_Node, DT_Node_BuddyList, DT_Node_Multicast, DT_Server, GNP_Landmark, HC_Node, NONE_Node, SPT_Node

public interface I_Node
extends I_Stats

This is the interface for an overlay node. The node is responsible for organizing the overlay and providing information on how to route a message on the overlay.


Field Summary
static java.lang.String DEFAULT_CONFIG_FILE
          Default cofiguration file name used by DT_server.
static byte PROTOSUB_BUDDYLIST
           
static byte PROTOSUB_MULTICAST
           
static byte PROTOSUB_NOSPEC
          Protocol_Subfield values in Protocol field for DT3.0 protocol message
static byte PROTOSUB_SERVER
           
 
Method Summary
 hypercast.I_LogicalAddress createLogicalAddress(byte[] laddr, int offset)
          Creates a logical address object from a byte array.
 hypercast.I_LogicalAddress createLogicalAddress(java.lang.String laStr)
          Creates a logical address object from a String.
 hypercast.I_AddressPair getAddressPair()
          Returns this logical and physical addresses of this node.
 hypercast.I_AddressPair[] getAllNeighbors()
          Returns the node's neighbors' physical/logical address pairs.
 hypercast.I_AddressPair[] getChildren(hypercast.I_LogicalAddress root)
          Returns the node's children's physical/logical address pairs, with respect to the spanning tree rooted at root.
 hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root)
          Returns the addresspair of the next hop for a message routed by this node towards the root.
 void joinOverlay()
          Joins the overlay.
 void leaveOverlay()
          Leaves the overlay.
 boolean previousHopCheck(hypercast.I_LogicalAddress src, hypercast.I_LogicalAddress dst, hypercast.I_LogicalAddress prehop)
          Check if previous hop is a valided sender.
 void setLogicalAddress(hypercast.I_LogicalAddress la)
          Sets the logical address to specified one.
 void setNotificationHandler(hypercast.NotificationHandler nh)
          Set notification handler.
 
Methods inherited from interface hypercast.I_Stats
getReadSchema, getStats, getStatsName, getWriteSchema, setStats, setStatsName
 

Field Detail

DEFAULT_CONFIG_FILE

public static final java.lang.String DEFAULT_CONFIG_FILE
Default cofiguration file name used by DT_server.

See Also:
Constant Field Values

PROTOSUB_NOSPEC

public static final byte PROTOSUB_NOSPEC
Protocol_Subfield values in Protocol field for DT3.0 protocol message

See Also:
Constant Field Values

PROTOSUB_SERVER

public static final byte PROTOSUB_SERVER
See Also:
Constant Field Values

PROTOSUB_BUDDYLIST

public static final byte PROTOSUB_BUDDYLIST
See Also:
Constant Field Values

PROTOSUB_MULTICAST

public static final byte PROTOSUB_MULTICAST
See Also:
Constant Field Values
Method Detail

joinOverlay

public void joinOverlay()
Joins the overlay. (Includes starting any adapter underneath the node.)

Throws:
java.lang.IllegalStateException - if already joined.

leaveOverlay

public void leaveOverlay()
Leaves the overlay. (Includes stopping any adapter underneath the node.)

Throws:
java.lang.IllegalStateException - if already left.

getParent

public hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root)
Returns the addresspair of the next hop for a message routed by this node towards the root. The next hop would be the node's parent in the spanning tree rooted at root.

Throws:
java.lang.IllegalStateException - if node has not joined group.

getChildren

public hypercast.I_AddressPair[] getChildren(hypercast.I_LogicalAddress root)
Returns the node's children's physical/logical address pairs, with respect to the spanning tree rooted at root.

Throws:
java.lang.IllegalStateException - if node has not joined group.

getAllNeighbors

public hypercast.I_AddressPair[] getAllNeighbors()
Returns the node's neighbors' physical/logical address pairs.

Throws:
java.lang.IllegalStateException - if node has not joined group.

getAddressPair

public hypercast.I_AddressPair getAddressPair()
Returns this logical and physical addresses of this node. This can never be null. (Neither can either the LA or PA part of it.)

Throws:
java.lang.IllegalStateException - if node has not joined group.

createLogicalAddress

public hypercast.I_LogicalAddress createLogicalAddress(byte[] laddr,
                                                       int offset)
Creates a logical address object from a byte array. The number of bytes read is equal to I_Node.getMyAddressPair().getLogicalAddress().getSize().

Throws:
java.lang.IllegalArgumentException - if byte[] is corrupted
java.lang.ArrayIndexOutOfBoundsException - if byte[] is too small.

createLogicalAddress

public hypercast.I_LogicalAddress createLogicalAddress(java.lang.String laStr)
Creates a logical address object from a String.


setLogicalAddress

public void setLogicalAddress(hypercast.I_LogicalAddress la)
Sets the logical address to specified one.


previousHopCheck

public boolean previousHopCheck(hypercast.I_LogicalAddress src,
                                hypercast.I_LogicalAddress dst,
                                hypercast.I_LogicalAddress prehop)
Check if previous hop is a valided sender.


setNotificationHandler

public void setNotificationHandler(hypercast.NotificationHandler nh)
Set notification handler.