|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.DT.DT_Node_BuddyList
This class implements the basic Delaunay triangulation node and also provides a mechanism for joining a overlay through a buddy list.
Joins are initiated by the node sending a IamHere message to one of its buddy.
The IamHere message will be routed on the topology to the node in the overlay that is close in the sense of compass routing to the joining node. That node will then send attempt to add the new node as a neighbor.
Field Summary | |
hypercast.I_UnicastAdapter |
adapter
Network adapter (used for timers and Physical Address). |
static int |
IAMHERE_TIMER_INDEX
The Adapter timer index used for IAmHere Message |
int |
iAmHereReceived
The total number of IamHere Msgs received |
int |
iAmHereSent
The total number of IamHere Msgs sent |
static int |
INCOMPLETE
Node state |
static int |
LEADER_INCOMPLETE
Node state |
static int |
LEADER_STABLE
Node state |
static int |
SINGLE
Node state |
static int |
STABLE
Node state |
static int |
STOPPED
Node state |
Fields inherited from interface hypercast.I_Node |
DEFAULT_CONFIG_FILE, PROTOSUB_BUDDYLIST, PROTOSUB_MULTICAST, PROTOSUB_NOSPEC, PROTOSUB_SERVER |
Constructor Summary | |
DT_Node_BuddyList(hypercast.HyperCastConfig c,
hypercast.I_UnicastAdapter a)
Constructor. |
|
DT_Node_BuddyList(hypercast.HyperCastConfig c,
hypercast.I_UnicastAdapter a,
hypercast.DT.DT_LogicalAddress startingCoords)
Constructor. |
|
DT_Node_BuddyList(hypercast.HyperCastConfig c,
hypercast.I_UnicastAdapter a,
hypercast.DT.DT_LogicalAddress startingCoords,
java.lang.String prefix)
Constructor with specified property prefix. |
|
DT_Node_BuddyList(hypercast.HyperCastConfig c,
hypercast.I_UnicastAdapter a,
java.lang.String prefix)
Constructor with specified property prefix. |
Method Summary | |
hypercast.I_Message |
createDTMessage(byte type,
hypercast.DT.DT_AddressPair dst,
hypercast.DT.DT_AddressPair cw,
hypercast.DT.DT_AddressPair ccw)
This method creates a new DT_Message based on parameters. |
hypercast.I_LogicalAddress |
createLogicalAddress(byte[] array,
int offset)
Constructs a DT_LogicalAddress from a byte array. |
hypercast.I_LogicalAddress |
createLogicalAddress(java.lang.String laStr)
Creates a logical address object from a String. |
void |
deleteNeighbor(hypercast.DT.DT_AddressPair dtap)
Deletes a neighbor from the neighborhood table and updates timers. |
hypercast.I_AddressPair |
getAddressPair()
Returns the physical address/logical address pair of this node. |
hypercast.I_AddressPair[] |
getAllNeighbors()
Returns the AddressPairs of all the neighbors |
hypercast.I_AddressPair[] |
getChildren(hypercast.I_LogicalAddress root)
Return the AddressPairs of neighbor that are children of this node in a spanning tree rooted at rootCoords . |
hypercast.I_AddressPair[] |
getParent(hypercast.I_LogicalAddress root)
Returns AddressPair of neighbor that is parent of this node in a spanning tree rooted at rootCoords . |
org.w3c.dom.Element[] |
getReadSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Return the schema element which represents the root of the sub-tree, specified by the given xpath, in read schema tree. |
int |
getState()
Returns the current state of the node. |
org.w3c.dom.Element[] |
getStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Return the result of query for the statistics specified by the given xpath. |
java.lang.String |
getStatsName()
Gets the element name of this I_Stats instance. |
org.w3c.dom.Element[] |
getWriteSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Return the schema element which represents the root of the sub-tree, specified by the given xpath, in write schema tree. |
void |
Initialization(hypercast.HyperCastConfig c,
hypercast.I_UnicastAdapter a,
hypercast.DT.DT_LogicalAddress startingCoords)
This method finishes initialization task. |
void |
joinOverlay()
Joins the overlay multicast group. |
void |
leaveOverlay()
Leaves the overlay multicast group. |
void |
messageArrivedFromAdapter(hypercast.I_Message a)
This function, a member of I_AdapterCallback, is called whenever a protocol message arrives. |
boolean |
previousHopCheck(hypercast.I_LogicalAddress src,
hypercast.I_LogicalAddress dst,
hypercast.I_LogicalAddress prehop)
Verify the previous hop of the message. |
hypercast.I_Message |
restoreMessage(byte[] buffer,
int[] startValidBytes,
int endValidBytes)
Creates a protocol message from a byte[]. |
void |
setLogicalAddress(hypercast.I_LogicalAddress la)
Sets the logical address of this node to the specified one. |
void |
setNotificationHandler(hypercast.NotificationHandler nh)
Set notification handler. |
org.w3c.dom.Element[] |
setStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath,
org.w3c.dom.Element newValue)
Set the statistics specified by the given xpath. |
void |
setStatsName(java.lang.String name)
Assigns a name to this I_Stats instance. |
void |
timerExpired(java.lang.Object Timer_Index)
This function, a member of I_AdapterCallback, is called for the heartbeat timer. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public hypercast.I_UnicastAdapter adapter
public int iAmHereSent
public int iAmHereReceived
public static final int IAMHERE_TIMER_INDEX
public static final int SINGLE
public static final int LEADER_STABLE
public static final int STABLE
public static final int LEADER_INCOMPLETE
public static final int INCOMPLETE
public static final int STOPPED
Constructor Detail |
public DT_Node_BuddyList(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a)
c
- an HyperCastConfig objecta
- node adapterpublic DT_Node_BuddyList(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords)
c
- an HyperCastConfig objecta
- node adapterstartingCoords
- initial logical addresspublic DT_Node_BuddyList(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, java.lang.String prefix)
c
- an HyperCastConfig objecta
- node adapterprefix
- property prefixpublic DT_Node_BuddyList(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords, java.lang.String prefix)
c
- an HyperCastConfig objecta
- node adapterstartingCoords
- initial logical addressprefix
- property prefixMethod Detail |
public void Initialization(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords)
c
- an HyperCastConfig objecta
- node adapter
java.lang.IllegalArgumentException
- if properties are incorrectly formatted.public void joinOverlay()
joinOverlay
in interface I_Node
public void leaveOverlay()
leaveOverlay
in interface I_Node
public hypercast.I_Message restoreMessage(byte[] buffer, int[] startValidBytes, int endValidBytes)
restoreMessage
in interface I_AdapterCallback
buffer
- the byte array buffer of a incoming streamstartValidBytes
- the start index to create a message fromendValidBytes
- the total length of bytes in this buffer
I_AdapterCallback.restoreMessage(byte[], int[], int)
public hypercast.I_AddressPair getAddressPair()
getAddressPair
in interface I_Node
public hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root)
rootCoords
.
This is calculated by finding the neighbor that forms the smallest angle with rootCoords
.
getParent
in interface I_Node
public hypercast.I_AddressPair[] getChildren(hypercast.I_LogicalAddress root)
rootCoords
.
This based on if DT_Node.getParent() of the neighbor would return this node.
getChildren
in interface I_Node
public hypercast.I_AddressPair[] getAllNeighbors()
getAllNeighbors
in interface I_Node
public hypercast.I_LogicalAddress createLogicalAddress(byte[] array, int offset)
createLogicalAddress
in interface I_Node
public hypercast.I_LogicalAddress createLogicalAddress(java.lang.String laStr)
createLogicalAddress
in interface I_Node
public void setLogicalAddress(hypercast.I_LogicalAddress la)
setLogicalAddress
in interface I_Node
public boolean previousHopCheck(hypercast.I_LogicalAddress src, hypercast.I_LogicalAddress dst, hypercast.I_LogicalAddress prehop)
previousHopCheck
in interface I_Node
public void setNotificationHandler(hypercast.NotificationHandler nh)
setNotificationHandler
in interface I_Node
public void timerExpired(java.lang.Object Timer_Index)
timerExpired
in interface I_AdapterCallback
public void messageArrivedFromAdapter(hypercast.I_Message a)
messageArrivedFromAdapter
in interface I_AdapterCallback
public void deleteNeighbor(hypercast.DT.DT_AddressPair dtap)
public hypercast.I_Message createDTMessage(byte type, hypercast.DT.DT_AddressPair dst, hypercast.DT.DT_AddressPair cw, hypercast.DT.DT_AddressPair ccw)
public int getState()
public java.lang.String getStatsName()
I_Stats
getStatsName
in interface I_Stats
I_Stats.getStatsName()
public void setStatsName(java.lang.String name)
I_Stats
setStatsName
in interface I_Stats
name
- the name assigned to the I_Stats instance.I_Stats.setStatsName(String)
public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
getStats
in interface I_Stats
doc
- Document used for create new elements or nodes.xpath
- XPath instance represents the statistics to be queried.
HyperCastStatsException
- If the xpath does not specify a valid subtree.I_Stats.getStats(org.w3c.dom.Document, org.apache.xpath.XPath)
public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue) throws HyperCastStatsException
setStats
in interface I_Stats
doc
- Document used for create new elements or nodes.xpath
- XPath instance represents the statistics to be queried.newValue
- Element representing the value or sub-tree to be set.
HyperCastStatsException
- If the xpath does not specify a
valid subtree or if any part of the the subtree is read-only,
or if the newValue
does not conform with the
expected format.I_Stats.setStats(org.w3c.dom.Document, org.apache.xpath.XPath, org.w3c.dom.Element)
public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
getReadSchema
in interface I_Stats
doc
- Document used for create new elements or nodes.xpath
- XPath instance representing the statistics which is the root
of the sub-tree to be queried.
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getReadSchema(Document, XPath)
public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
getWriteSchema
in interface I_Stats
doc
- Document used for create new elements or nodes.xpath
- XPath instance representing the statistics which is the root
of the sub-tree to be queried.
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getWriteSchema(Document, XPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |