|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.DT.DT_Node_Multicast
This class implements the basic Delaunay triangulation node and also provides a bootstrap mechanism of overlay by multicasting.
Joins are initiated by the node multicasting a Beacon message to the overlay.
Field Summary | |
static int |
BEACON_TIMER_INDEX
The Adapter timer index used for Beacon Message |
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_Multicast(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter a)
|
|
DT_Node_Multicast(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter a,
hypercast.DT.DT_LogicalAddress startingCoords)
|
|
DT_Node_Multicast(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter a,
hypercast.DT.DT_LogicalAddress startingCoords,
java.lang.String prefix)
|
|
DT_Node_Multicast(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter a,
java.lang.String 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 |
joinOverlay()
Joins the overlay 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 by two timers: hello heartbeat and Beacon message. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int BEACON_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_Multicast(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter a)
public DT_Node_Multicast(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords)
public DT_Node_Multicast(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter a, java.lang.String prefix)
public DT_Node_Multicast(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords, java.lang.String prefix)
Method Detail |
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 |