hypercast
Interface I_Stats

All Known Subinterfaces:
I_IPv4_UnicastAdapter, I_Monitor, I_MulticastAdapter, I_Node, I_OverlaySocket, I_Portal, I_UnicastAdapter
All Known Implementing Classes:
DT_Node, DT_Node_BuddyList, DT_Node_Multicast, DT_Server, GNP_Landmark, HC_Node, HyperCastAppl, HyperCastConfig, MessageBuffer, MessageStore, MessageStoreFSM_Naming, Monitor, NeighborhoodStats, NONE_Node, OL_Socket, Portal, SecurityProcessor, SimpleStats, SPT_Node, SSL_UnicastAdapter, TCP_UDP_Adapter, TCP_UnicastAdapter, UDP_MulticastAdapter, UDP_UnicastAdapter

public interface I_Stats

This is the interface implemented by objects that have statistics that are available to applications. In particular, this is designed to be an external interface. Hypercast uses the I_StatsInternal interface internally.


Method Summary
 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.
 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.
 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.
 

Method Detail

getStats

public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath)
                               throws HyperCastStatsException
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.

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.

setStats

public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath,
                                      org.w3c.dom.Element newValue)
                               throws HyperCastStatsException
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.

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.

getReadSchema

public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc,
                                           org.apache.xpath.XPath xpath)
                                    throws HyperCastStatsException
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.

Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.

getWriteSchema

public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc,
                                            org.apache.xpath.XPath xpath)
                                     throws HyperCastStatsException
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.

Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.

getStatsName

public java.lang.String getStatsName()
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.


setStatsName

public void setStatsName(java.lang.String name)
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.

Parameters:
name - the name assigned to the I_Stats instance.