#include <FountainNode.h>
Inheritance diagram for FountainNode:

Public Member Functions | |
| virtual void | checkConnections () |
| Checks the listening sockets for incoming connection requests and checks existing connections for incoming message requests. | |
Protected Types | |
| typedef TreeTopology::ChildNodeContainer::iterator | childIterator |
| Makes it easy to use an iterator for our children vector. | |
| typedef TreeTopology::ChildNodeContainer::const_iterator | constChildIterator |
| Makes it easy to use a const_iterator for our children vector. | |
Protected Member Functions | |
| virtual NodeResponsePtr | processRequest (FountainMessage::MessageAction action, ConstParseMsgPtr request, time_t timeout=0) |
| Process and respond to a request message from our parent. | |
| virtual NodeResponsePtr | processPingPong (ConstParseMsgPtr request, time_t timeout=0) |
| Handles an incoming pingPong message request. | |
| void | handleParentMessage () |
| Handles a request message from our parent Fountain node. | |
| void | checkChildren () |
| Check the status the FountainNode's children and report them as lost if their connection dies. | |
| void | handleJoin (ConstParseMsgPtr request, FountainWireProtPtr requestConnection) |
| Handles join requests from an incoming connection. | |
| FountainNode (const NodeID &myID, const NodeID &masterNodeID) | |
| Protected Constructor since we're using a singleton design pattern. | |
| virtual | ~FountainNode () |
| Protected destructor since we're using a singleton design pattern. | |
Protected Attributes | |
| FountainSocketHandlers | socketHandlers_ |
| An object that creates sockets to listen for incoming connection requests. | |
| TreeTopology::ChildNodeContainer | children_ |
| NodeID | myID_ |
| NodeID | parentID_ |
| FountainWireProtPtr | parentConnectionPtr_ |
Private Member Functions | |
| int | handleChildMessage (FountainWireProtPtr childCon, const NodeID &childID) |
| Handles a request message from a child node. | |
| virtual int | handleLostChild (const NodeID &childID) |
| Handles a lost child Fountain node. | |
| virtual void | handleLostParent (const char *message) |
| Handles a lost parent Fountain node. | |
| void | pokeParent () |
| Send our parent connection a pulse request message if we haven't heard from them in a while. | |
| void | pokeChildren () |
| Send our child nodes a pulse message if it's time to do so. | |
| void | handleSync (ConstParseMsgPtr request, FountainWireProtPtr requestCon) |
| Handles syncMsg requests. | |
| void | handleWakeup () |
| Handles an FountainMessage::wakeup request from the master Fountain node. | |
| virtual void | joinMasterNode () |
| Joins the master Fountain Node using the hostname and port specified in the FountainNode constructor. | |
| int | joinParentNode (const NodeID &newParentID) |
| Joins a new parent Fountain node. | |
| void | checkParent () |
| Check the status of our parent node. | |
| FountainNode & | operator= (const FountainNode &rhs) |
| Private assignment operator singe we're using a singleton design pattern. | |
| FountainNode (const FountainNode &rhs) | |
| Private copy constructor singe we're using a singleton design pattern. | |
Private Attributes | |
| NodeID | masterNodeID_ |
| NodeMonitorBase::NodeMonitorPtr | myNodeInfoPtr_ |
| time_t | parentPulseLastSeen_ |
Friends | |
| class | FountainNodeCreator |
Classes | |
| class | forwardMessageToChildren |
| Functor class to forward a ConstParseMsgPtr message to all child nodes. More... | |
This is a singleton class since it really does not make sense for any application to maintain multiple Fountain node objects. A FountainNode object maintains connections with a parent Fountain node and multiple child Fountain nodes. Each FountainNode object is responsible for responding to requests from its parent node and forwarding them to their children in a timely fashion. Each node also maintains detailed usage information that is aggregated together by the Fountain Server by parsing the node query response messages.
|
||||||||||||
|
Protected Constructor since we're using a singleton design pattern.
|
|
|
Check the status of our parent node.
|
|
||||||||||||
|
Handles a request message from a child node.
|
|
||||||||||||
|
Handles join requests from an incoming connection.
Reimplemented in FountainMasterNode. |
|
|
Handles a lost child Fountain node.
Reimplemented in FountainMasterNode. |
|
|
Handles a lost parent Fountain node.
Reimplemented in FountainMasterNode. |
|
|
Handles a request message from our parent Fountain node.
|
|
||||||||||||
|
Handles syncMsg requests.
|
|
|
Handles an FountainMessage::wakeup request from the master Fountain node. When our node is reported as a lost node to the master Fountain node, sometimes we might not actually be "lost" but we were asleep for an extended period of time for whatever reason and one of our children did not receive a pulseMsg request during the specified threshold of time. The purpose of this function is to ensure our parent connection and all child node connections are active and healthy, then return a success or failure response to the master Fountain node.
|
|
|
Joins the master Fountain Node using the hostname and port specified in the FountainNode constructor.
Reimplemented in FountainMasterNode. |
|
|
Joins a new parent Fountain node.
|
|
|
Send our parent connection a pulse request message if we haven't heard from them in a while.
|
|
||||||||||||
|
Handles an incoming pingPong message request.
|
|
||||||||||||||||
|
Process and respond to a request message from our parent.
Reimplemented in FountainMasterNode. |
|
|
Container for our child nodes |
|
|
The ID of the master Fountain node |
|
|
A unique identifier for this Fountain node |
|
|
Each Fountain node maintains a NodeMonitor derived object responsible for parsing various system files to obtain the requested data |
|
|
The primary link to other Fountain nodes is through the parentConnection handler |
|
|
The ID of this node's parent Fountain node |
|
|
Time in seconds since epoch representing the last time any message was received on the parentConnection. |
|
|
An object that creates sockets to listen for incoming connection requests. Responsible for creating our listener port and accepting incoming connections. This is protected so the FountainMasterNode class can open a listening port for the Fountain server. |
1.4.6