hypercast
Class MessageStoreFSM_Naming

java.lang.Object
  |
  +--hypercast.I_MessageStoreFSM
        |
        +--hypercast.MessageStoreFSM_Naming
All Implemented Interfaces:
I_Stats

public class MessageStoreFSM_Naming
extends I_MessageStoreFSM
implements I_Stats

This class implements a finite state machine that provides a naming service. In particular, it implements a "getLogicalAddressByName" service in an logical overlay network.

This class contains:


Field Summary
static java.lang.String securityProviderClassName
          The name of the class that provides crypto algorithm implementations.
static java.lang.String securityProviderShortName
          The short name of the provider that has crypto algorithm implementations.
 
Constructor Summary
MessageStoreFSM_Naming(hypercast.OL_Socket socket, hypercast.MessageStore messageStore, hypercast.HyperCastConfig config)
          Creates a naming service finite state machine with the specified parameters.
 
Method Summary
 void changingNeighbor()
          This finite state machine takes no action when the neighborhood changes.
 short getFSMID()
          Return the ID of this FSM.
 hypercast.I_LogicalAddress getLogicalAddress()
          Delegated method call to get local logical address.
 int getLogicalAddressChangeCounter()
           
 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.
 void invalidateOperation()
          Sends an Invalidate Message that contains all local bindings.
 void invalidateOperation(java.lang.String name)
          Sends a Push Message that contains all local bindings.
 void newACMsg(hypercast.OL_Message message)
          set the new control message information
 void newADMsg(hypercast.OL_Message message)
          set the new application message information
 void newApplicationControlMessage(hypercast.OL_Message message)
           
 void newApplicationDataMessage(hypercast.OL_Message message)
           
 void pushOperation()
          Sends a Push Message that contains all local bindings.
 void pushOperation(java.lang.String name)
          Sends a Push Message that contains one binding.
 org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element setValue)
          Sets statistics information for an object which implements this interface.
 void setStatsName(java.lang.String name)
          Assigns a name to this I_Stats instance.
 void setTimer(java.lang.Object obj, long delay)
          Deprecated.  
 void timerExpired(int timerIndex)
          Method that is called when a timer expires - no longer used as timers have been generalized to use objects instead of ints.
 void timerExpired(java.lang.Object object)
          Method that is called when a timer expires
 void updateACMsg(hypercast.OL_Message message)
          update the control message information
 void updateADMsg(hypercast.OL_Message message)
          update the application message information
 void updateApplicationControlMessage(hypercast.OL_Message message)
           
 void updateApplicationDataMessage(hypercast.OL_Message message)
           
 
Methods inherited from class hypercast.I_MessageStoreFSM
receiveControlMessage, receiveDataMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityProviderClassName

public static final java.lang.String securityProviderClassName
The name of the class that provides crypto algorithm implementations.

See Also:
Constant Field Values

securityProviderShortName

public static final java.lang.String securityProviderShortName
The short name of the provider that has crypto algorithm implementations.

See Also:
Constant Field Values
Constructor Detail

MessageStoreFSM_Naming

public MessageStoreFSM_Naming(hypercast.OL_Socket socket,
                              hypercast.MessageStore messageStore,
                              hypercast.HyperCastConfig config)
Creates a naming service finite state machine with the specified parameters.

Parameters:
socket - overlay socket associated with this instance of the naming service
messageStore - message store within which this instance of the naming service runs
config - overlay socket config that contains a reference to the log used by this naming service
Method Detail

changingNeighbor

public void changingNeighbor()
This finite state machine takes no action when the neighborhood changes.

Specified by:
changingNeighbor in class I_MessageStoreFSM

getFSMID

public short getFSMID()
Return the ID of this FSM.

Specified by:
getFSMID in class I_MessageStoreFSM

newADMsg

public void newADMsg(hypercast.OL_Message message)
Description copied from class: I_MessageStoreFSM
set the new application message information

Specified by:
newADMsg in class I_MessageStoreFSM

newApplicationDataMessage

public void newApplicationDataMessage(hypercast.OL_Message message)

updateADMsg

public void updateADMsg(hypercast.OL_Message message)
Description copied from class: I_MessageStoreFSM
update the application message information

Specified by:
updateADMsg in class I_MessageStoreFSM

updateApplicationDataMessage

public void updateApplicationDataMessage(hypercast.OL_Message message)

newACMsg

public void newACMsg(hypercast.OL_Message message)
Description copied from class: I_MessageStoreFSM
set the new control message information

Specified by:
newACMsg in class I_MessageStoreFSM

newApplicationControlMessage

public void newApplicationControlMessage(hypercast.OL_Message message)

updateACMsg

public void updateACMsg(hypercast.OL_Message message)
Description copied from class: I_MessageStoreFSM
update the control message information

Specified by:
updateACMsg in class I_MessageStoreFSM

updateApplicationControlMessage

public void updateApplicationControlMessage(hypercast.OL_Message message)

getLogicalAddressChangeCounter

public int getLogicalAddressChangeCounter()
Returns:
a count of the number of times that the logical address has changed.

getLogicalAddress

public hypercast.I_LogicalAddress getLogicalAddress()
Delegated method call to get local logical address.


pushOperation

public void pushOperation()
Sends a Push Message that contains all local bindings. Does not send anything if there are no local bindings.


pushOperation

public void pushOperation(java.lang.String name)
Sends a Push Message that contains one binding. Does not send anything if there is no local binding that matches the specified name.

Parameters:
name - The name that should be pushed, if it is in the local binding table

invalidateOperation

public void invalidateOperation()
Sends an Invalidate Message that contains all local bindings. Does not send anything if there are no local bindings.


invalidateOperation

public void invalidateOperation(java.lang.String name)
Sends a Push Message that contains all local bindings. Does not send anything if there are no local bindings.


setTimer

public void setTimer(java.lang.Object obj,
                     long delay)
Deprecated.  

Parameters:
obj - The object that is to be associated with this timer event, available when event occurs
delay - milliseconds until timer expires

timerExpired

public void timerExpired(java.lang.Object object)
Method that is called when a timer expires

Overrides:
timerExpired in class I_MessageStoreFSM

timerExpired

public void timerExpired(int timerIndex)
Method that is called when a timer expires - no longer used as timers have been generalized to use objects instead of ints.

Specified by:
timerExpired in class I_MessageStoreFSM

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.

setStats

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

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.

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.

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