|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.SPT.SPT_Node
This class is a Spanning Tree node.
Field Summary | |
hypercast.I_MulticastAdapter |
m_adapter
Multicast adapter (used to transfer protocol message to neighbors) |
Fields inherited from interface hypercast.I_Node |
DEFAULT_CONFIG_FILE, PROTOSUB_BUDDYLIST, PROTOSUB_MULTICAST, PROTOSUB_NOSPEC, PROTOSUB_SERVER |
Constructor Summary | |
SPT_Node(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter m,
hypercast.SPT.SPT_LogicalAddress la,
java.lang.String prefix)
Constructor |
|
SPT_Node(hypercast.HyperCastConfig c,
hypercast.I_MulticastAdapter m,
java.lang.String prefix)
Constructor. |
Method Summary | |
hypercast.I_LogicalAddress |
createLogicalAddress(byte[] array,
int offset)
Constructs a SPT_LogicalAddress from a byte array. |
hypercast.I_LogicalAddress |
createLogicalAddress(byte[] laddr,
int offset,
int index)
|
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[] |
getAllNeighbors(hypercast.I_LogicalAddress root)
|
hypercast.I_AddressPair[] |
getAllNeighbors(int index)
|
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[] |
getChildren(hypercast.I_LogicalAddress root,
int index)
|
hypercast.I_LogicalAddress |
getLogicalAddress()
|
hypercast.I_LogicalAddress |
getLogicalAddress(int index)
|
hypercast.I_AddressPair |
getMyAddressPair(hypercast.I_LogicalAddress root)
|
hypercast.I_AddressPair |
getMyAddressPair(int index)
|
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. |
hypercast.I_AddressPair[] |
getParent(hypercast.I_LogicalAddress root,
int index)
|
hypercast.I_PhysicalAddress |
getPhysicalAddress()
all these API are added by jianping 3/20/04 |
hypercast.I_PhysicalAddress |
getPhysicalAddress(int index)
|
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. |
hypercast.SPT.SPT_LogicalAddress |
getSPTLogicalAddress()
|
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. |
boolean |
isRoot()
|
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(int timerIndex)
This function, a member of I_AdapterCallback, is called for the heartbeat timer. |
void |
timerExpired(java.lang.Object timerID)
Handles the arrival of a timer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public hypercast.I_MulticastAdapter m_adapter
Constructor Detail |
public SPT_Node(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter m, java.lang.String prefix)
c
- overlay socket config objectm
- node adapterprefix
- the property name prefix
java.lang.IllegalArgumentException
- if properties are incorrectly formatted.public SPT_Node(hypercast.HyperCastConfig c, hypercast.I_MulticastAdapter m, hypercast.SPT.SPT_LogicalAddress la, java.lang.String prefix)
c
- overlay socket config objectm
- node adapterla
- logical addressprefix
- property name prefix
java.lang.IllegalArgumentException
- if properties are incorrectly formatted.Method Detail |
public void joinOverlay()
joinOverlay
in interface I_Node
I_Node.joinOverlay()
public void leaveOverlay()
leaveOverlay
in interface I_Node
I_Node.leaveOverlay()
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()
I_Node
getAddressPair
in interface I_Node
public hypercast.I_LogicalAddress getLogicalAddress()
public hypercast.SPT.SPT_LogicalAddress getSPTLogicalAddress()
public hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root)
I_Node
root
.
getParent
in interface I_Node
I_Node.getParent(I_LogicalAddress)
public hypercast.I_AddressPair[] getChildren(hypercast.I_LogicalAddress root)
I_Node
root
.
getChildren
in interface I_Node
I_Node.getChildren(I_LogicalAddress)
public hypercast.I_AddressPair[] getAllNeighbors()
I_Node
getAllNeighbors
in interface I_Node
I_Node.getAllNeighbors()
public hypercast.I_LogicalAddress createLogicalAddress(byte[] array, int offset)
createLogicalAddress
in interface I_Node
I_Node.createLogicalAddress(byte[], int)
public void timerExpired(int timerIndex)
I_AdapterCallback.timerExpired(java.lang.Object)
public void messageArrivedFromAdapter(hypercast.I_Message a)
messageArrivedFromAdapter
in interface I_AdapterCallback
I_AdapterCallback.messageArrivedFromAdapter(hypercast.I_Message)
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)
public void timerExpired(java.lang.Object timerID)
I_AdapterCallback
timerExpired
in interface I_AdapterCallback
public hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root, int index)
public hypercast.I_AddressPair[] getChildren(hypercast.I_LogicalAddress root, int index)
public hypercast.I_AddressPair[] getAllNeighbors(int index)
public hypercast.I_AddressPair getMyAddressPair(int index)
public hypercast.I_LogicalAddress createLogicalAddress(byte[] laddr, int offset, int index)
public hypercast.I_PhysicalAddress getPhysicalAddress()
public hypercast.I_AddressPair[] getAllNeighbors(hypercast.I_LogicalAddress root)
public hypercast.I_AddressPair getMyAddressPair(hypercast.I_LogicalAddress root)
public hypercast.I_PhysicalAddress getPhysicalAddress(int index)
public hypercast.I_LogicalAddress getLogicalAddress(int index)
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 hypercast.I_LogicalAddress createLogicalAddress(java.lang.String laStr)
I_Node
createLogicalAddress
in interface I_Node
public void setLogicalAddress(hypercast.I_LogicalAddress la)
setLogicalAddress
in interface I_Node
public boolean isRoot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |