hypercast.NONE
Class NONE_Node

java.lang.Object
  |
  +--hypercast.NONE.NONE_Node
All Implemented Interfaces:
I_Node, I_Stats

public class NONE_Node
extends java.lang.Object
implements I_Node


Field Summary
 
Fields inherited from interface hypercast.I_Node
DEFAULT_CONFIG_FILE, PROTOSUB_BUDDYLIST, PROTOSUB_MULTICAST, PROTOSUB_NOSPEC, PROTOSUB_SERVER
 
Constructor Summary
NONE_Node(hypercast.HyperCastConfig config, hypercast.I_UnicastAdapter adapter)
           
NONE_Node(hypercast.HyperCastConfig config, hypercast.I_UnicastAdapter adapter, java.lang.String prefix)
           
 
Method Summary
 hypercast.I_LogicalAddress createLogicalAddress(byte[] logicalAddressBytes, int offset)
          Creates a logical address object from a byte array.
 hypercast.I_LogicalAddress createLogicalAddress(java.lang.String logicalAddressString)
          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.
 org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Dynamically generates a subtree of the Readable Schema rooted at the path specified by the xpath.
 org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Gets statistics information from an object which implements this interface.
 java.lang.String getStatsName()
          Gets the element name of this I_Stats instance.
 java.lang.String getStatsValue(java.lang.String name)
          Gets the information of a scalar statistics from an object which implements this interface.
 org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Dynamically generates a subtree of the Writable Schema rooted at the path specified by the xpath.
 void joinOverlay()
          This is a no-op for the NONE protocol since there is no overlay to join.
 void leaveOverlay()
          This is a no-op for the NONE protocol since there is no overlay to join.
 boolean previousHopCheck(hypercast.I_LogicalAddress source, hypercast.I_LogicalAddress destination, hypercast.I_LogicalAddress previousHop)
          Everybody is considered a neighbor in the NONE protocol.
 void setLogicalAddress(hypercast.I_LogicalAddress logicalAddress)
          Sets the logical address of this node to the specified one.
 void setNotificationHandler(hypercast.NotificationHandler notificationHandler)
          Set notification handler.
 org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue)
          Sets statistics information for an object which implements this interface.
 void setStatsName(java.lang.String name)
          Assigns a name to this I_Stats instance.
 java.lang.String setStatsValue(java.lang.String name, java.lang.String newValue)
          Sets the information of s writable scalar statistics to an object which implements this interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NONE_Node

public NONE_Node(hypercast.HyperCastConfig config,
                 hypercast.I_UnicastAdapter adapter)

NONE_Node

public NONE_Node(hypercast.HyperCastConfig config,
                 hypercast.I_UnicastAdapter adapter,
                 java.lang.String prefix)
Method Detail

joinOverlay

public void joinOverlay()
This is a no-op for the NONE protocol since there is no overlay to join.

Specified by:
joinOverlay in interface I_Node
See Also:
I_Node.joinOverlay()

leaveOverlay

public void leaveOverlay()
This is a no-op for the NONE protocol since there is no overlay to join.

Specified by:
leaveOverlay in interface I_Node
See Also:
I_Node.leaveOverlay()

getParent

public hypercast.I_AddressPair[] getParent(hypercast.I_LogicalAddress root)
Description copied from interface: I_Node
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.

Specified by:
getParent in interface I_Node
See Also:
I_Node.getParent(hypercast.I_LogicalAddress)

getChildren

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

Specified by:
getChildren in interface I_Node
See Also:
I_Node.getChildren(hypercast.I_LogicalAddress)

getAllNeighbors

public hypercast.I_AddressPair[] getAllNeighbors()
Description copied from interface: I_Node
Returns the node's neighbors' physical/logical address pairs.

Specified by:
getAllNeighbors in interface I_Node
See Also:
I_Node.getAllNeighbors()

getAddressPair

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

Specified by:
getAddressPair in interface I_Node
See Also:
I_Node.getAddressPair()

createLogicalAddress

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

Specified by:
createLogicalAddress in interface I_Node
See Also:
I_Node.createLogicalAddress(byte[], int)

previousHopCheck

public boolean previousHopCheck(hypercast.I_LogicalAddress source,
                                hypercast.I_LogicalAddress destination,
                                hypercast.I_LogicalAddress previousHop)
Everybody is considered a neighbor in the NONE protocol. All previous hops are considered to be valid unless the previous hop is this node.

Specified by:
previousHopCheck in interface I_Node
See Also:
I_Node.previousHopCheck(hypercast.I_LogicalAddress, hypercast.I_LogicalAddress, hypercast.I_LogicalAddress)

setNotificationHandler

public void setNotificationHandler(hypercast.NotificationHandler notificationHandler)
Description copied from interface: I_Node
Set notification handler.

Specified by:
setNotificationHandler in interface I_Node
See Also:
I_Node.setNotificationHandler(NotificationHandler)

createLogicalAddress

public hypercast.I_LogicalAddress createLogicalAddress(java.lang.String logicalAddressString)
Description copied from interface: I_Node
Creates a logical address object from a String.

Specified by:
createLogicalAddress in interface I_Node
See Also:
I_Node.createLogicalAddress(java.lang.String)

setLogicalAddress

public void setLogicalAddress(hypercast.I_LogicalAddress logicalAddress)
Sets the logical address of this node to the specified one.

Specified by:
setLogicalAddress in interface I_Node

getStatsName

public java.lang.String getStatsName()
Description copied from interface: I_Stats
Gets the element name of this I_Stats instance. The element name is originally assigned from the attribute StstsName in the configuration file, and can be changed by this method.

Specified by:
getStatsName in interface I_Stats
See Also:
I_Stats.getStatsName()

setStatsName

public void setStatsName(java.lang.String name)
Description copied from interface: I_Stats
Assigns a name to this I_Stats instance. The assigned name becomes the tag of the element associated to this I_Stats instance on the statistics tree.

Specified by:
setStatsName in interface I_Stats
Parameters:
name - the name assigned to the I_Stats instance.
See Also:
I_Stats.setStatsName(String)

getStatsValue

public java.lang.String getStatsValue(java.lang.String name)
                               throws HyperCastStatsException
Gets the information of a scalar statistics from an object which implements this interface.

Throws:
HyperCastStatsException - if the statistics with given name is not supported by the object.

setStatsValue

public java.lang.String setStatsValue(java.lang.String name,
                                      java.lang.String newValue)
                               throws HyperCastStatsException
Sets the information of s writable scalar statistics to an object which implements this interface.

Throws:
HyperCastStatsException - if the statistics with given name is not supported by the object or read-only, or if value does not conform with expected format.

getStats

public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath)
                               throws HyperCastStatsException
Description copied from interface: I_Stats
Gets statistics information from an object which implements this interface. Statistics are arranged in a tree structure. This method has the ability to query an arbitrary subtree.

Specified by:
getStats in interface I_Stats
Parameters:
xpath - Specifies the statistic subtree to query.
doc - The document is used as a factory to create XML objects such as Nodes and Elements as needed. TODO: describe how the XML document in the doc is used.
Throws:
HyperCastStatsException - If the xpath does not specify a valid subtree.
See Also:
I_Stats.getStats(org.w3c.dom.Document, org.apache.xpath.XPath)

setStats

public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath,
                                      org.w3c.dom.Element newValue)
                               throws HyperCastStatsException
Description copied from interface: I_Stats
Sets statistics information for an object which implements this interface. Statistics are arranged in a tree structure. This method has the ability to set an arbitrary subtree of statistics.

Specified by:
setStats in interface I_Stats
Parameters:
xpath - Specifies the statistic subtree to use when updating values.
doc - The document is used as a factory to create XML objects such as Nodes and Elements as needed. TODO: describe how the XML document in the doc is used.
Throws:
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.
See Also:
I_Stats.setStats(org.w3c.dom.Document, org.apache.xpath.XPath, org.w3c.dom.Element)

getReadSchema

public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc,
                                           org.apache.xpath.XPath xpath)
                                    throws HyperCastStatsException
Description copied from interface: I_Stats
Dynamically generates a subtree of the Readable Schema rooted at the path specified by the xpath. The Readable Schema is distrubuted among the componenets of hypercast. Each component knows how to generate its portion of the Readable Schema. If a component has sub-components, it calls getReadSchema recursively. Note that the Readable Schema is disjoint from the Writable Schema. The Readable Schema is not modeled as a subset of the Writable Schema.

Specified by:
getReadSchema in interface I_Stats
Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.
See Also:
I_Stats.getReadSchema(org.w3c.dom.Document, org.apache.xpath.XPath)

getWriteSchema

public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc,
                                            org.apache.xpath.XPath xpath)
                                     throws HyperCastStatsException
Description copied from interface: I_Stats
Dynamically generates a subtree of the Writable Schema rooted at the path specified by the xpath. The Writable Schema is distrubuted among the componenets of hypercast. Each component knows how to generate its portion of the Writable Schema. If a component has sub-components, it calls getWriteSchema recursively. Note that the Readable Schema is disjoint from the Writable Schema. The Readable Schema is not modeled as a subset of the Writable Schema.

Specified by:
getWriteSchema in interface I_Stats
Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.
See Also:
I_Stats.getWriteSchema(org.w3c.dom.Document, org.apache.xpath.XPath)