#include <source/ariba/overlay/modules/onehop/OneHop.h>
Inherits ariba::overlay::OverlayInterface, and ariba::utility::Timer.
Public Member Functions | |
OneHop (BaseOverlay &_overlay, const NodeID &_nodeid, OverlayStructureEvents *_eventsReceiver, const OverlayParameterSet ¶m) | |
virtual | ~OneHop () |
Protected Member Functions | |
virtual void | eventFunction () |
virtual void | createOverlay () |
virtual void | deleteOverlay () |
virtual void | joinOverlay (const EndpointDescriptor &boot=EndpointDescriptor::UNSPECIFIED()) |
virtual void | leaveOverlay () |
virtual const EndpointDescriptor & | resolveNode (const NodeID &node) |
virtual const LinkID & | getNextLinkId (const NodeID &id) const |
virtual void | routeMessage (const NodeID &destnode, Message *msg) |
virtual void | routeMessage (const NodeID &node, const LinkID &link, Message *msg) |
virtual NodeList | getKnownNodes (bool deep=true) const |
virtual void | onLinkUp (const LinkID &lnk, const NodeID &remote) |
virtual void | onLinkDown (const LinkID &lnk, const NodeID &remote) |
virtual void | onMessage (const DataMessage &msg, const NodeID &remote, const LinkID &lnk=LinkID::UNSPECIFIED) |
Private Types | |
enum | _OneHopState { OneHopStateInvalid = 0, OneHopStateCompleted = 1 } |
The current state of the overlay. More... | |
typedef map< const NodeID, const LinkID > | OverlayNodeMapping |
The other nodes in the overlay. | |
typedef enum ariba::overlay::OneHop::_OneHopState | OneHopState |
The current state of the overlay. | |
Private Member Functions | |
use_logging_h (OneHop) | |
Private Attributes | |
OverlayNodeMapping | overlayNodes |
OneHopState | state |
vector< LinkID > | bootstrapLinks |
Definition at line 53 of file OneHop.h.
typedef enum ariba::overlay::OneHop::_OneHopState ariba::overlay::OneHop::OneHopState [private] |
The current state of the overlay.
typedef map<const NodeID, const LinkID> ariba::overlay::OneHop::OverlayNodeMapping [private] |
enum ariba::overlay::OneHop::_OneHopState [private] |
ariba::overlay::OneHop::OneHop | ( | BaseOverlay & | _overlay, | |
const NodeID & | _nodeid, | |||
OverlayStructureEvents * | _eventsReceiver, | |||
const OverlayParameterSet & | param | |||
) |
Definition at line 51 of file OneHop.cpp.
References overlayNodes, ariba::utility::Timer::setInterval(), ariba::utility::Timer::start(), and ariba::utility::LinkID::UNSPECIFIED.
ariba::overlay::OneHop::~OneHop | ( | ) | [virtual] |
Definition at line 65 of file OneHop.cpp.
References deleteOverlay(), and ariba::utility::Timer::stop().
void ariba::overlay::OneHop::createOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 117 of file OneHop.cpp.
References logging_info.
void ariba::overlay::OneHop::deleteOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 123 of file OneHop.cpp.
References logging_info, OneHopStateInvalid, and state.
Referenced by ~OneHop().
void ariba::overlay::OneHop::eventFunction | ( | ) | [protected, virtual] |
Reimplemented from ariba::utility::Timer.
Definition at line 350 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::getEndpointDescriptor(), logging_debug, overlayNodes, ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
OverlayInterface::NodeList ariba::overlay::OneHop::getKnownNodes | ( | bool | deep = true |
) | const [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 129 of file OneHop.cpp.
References overlayNodes.
const LinkID & ariba::overlay::OneHop::getNextLinkId | ( | const NodeID & | id | ) | const [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 111 of file OneHop.cpp.
References overlayNodes, and ariba::utility::LinkID::UNSPECIFIED.
void ariba::overlay::OneHop::joinOverlay | ( | const EndpointDescriptor & | boot = EndpointDescriptor::UNSPECIFIED() |
) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 142 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, bootstrapLinks, ariba::overlay::BaseOverlay::establishDirectLink(), ariba::communication::EndpointDescriptor::isUnspecified(), logging_info, OneHopStateCompleted, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, state, and ariba::communication::EndpointDescriptor::toString().
void ariba::overlay::OneHop::leaveOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 162 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, logging_info, ariba::overlay::OverlayInterface::nodeid, ariba::overlay::OneHopMessage::OneHopMessageTypeLeave, OneHopStateInvalid, overlayNodes, ariba::overlay::BaseOverlay::sendMessage(), state, and ariba::utility::LinkID::UNSPECIFIED.
void ariba::overlay::OneHop::onLinkDown | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 191 of file OneHop.cpp.
References bootstrapLinks, logging_debug, OneHopStateInvalid, overlayNodes, state, and ariba::utility::Identifier::toString().
void ariba::overlay::OneHop::onLinkUp | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 214 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, logging_debug, ariba::overlay::OneHopMessage::OneHopMessageTypeListingRequest, and ariba::overlay::BaseOverlay::sendMessage().
void ariba::overlay::OneHop::onMessage | ( | const DataMessage & | msg, | |
const NodeID & | remote, | |||
const LinkID & | lnk = LinkID::UNSPECIFIED | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 225 of file OneHop.cpp.
References ariba::overlay::NodeListingReply::add(), ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::dropLink(), ariba::overlay::BaseOverlay::establishDirectLink(), ariba::overlay::OverlayInterface::eventsReceiver, ariba::overlay::BaseOverlay::getEndpointDescriptor(), ariba::overlay::NodeListingReply::getList(), ariba::DataMessage::getMessage(), ariba::overlay::OverlayStructureEvents::incomingRouteMessage(), ariba::overlay::OneHopMessage::isType(), logging_debug, logging_info, ariba::overlay::OverlayInterface::nodeid, ariba::overlay::OneHopMessage::OneHopMessageTypeLeave, ariba::overlay::OneHopMessage::OneHopMessageTypeListingReply, ariba::overlay::OneHopMessage::OneHopMessageTypeListingRequest, ariba::overlay::OneHopMessage::OneHopMessageTypeRoute, ariba::overlay::OverlayStructureEvents::onNodeJoin(), ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, overlayNodes, ariba::overlay::BaseOverlay::sendMessage(), ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
const EndpointDescriptor & ariba::overlay::OneHop::resolveNode | ( | const NodeID & | node | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 70 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::getEndpointDescriptor(), logging_debug, overlayNodes, ariba::communication::EndpointDescriptor::toString(), ariba::utility::Identifier::toString(), and ariba::communication::EndpointDescriptor::UNSPECIFIED().
void ariba::overlay::OneHop::routeMessage | ( | const NodeID & | node, | |
const LinkID & | link, | |||
Message * | msg | |||
) | [protected, virtual] |
Definition at line 104 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::OneHopMessage::OneHopMessageTypeRoute, and ariba::overlay::BaseOverlay::sendMessage().
void ariba::overlay::OneHop::routeMessage | ( | const NodeID & | destnode, | |
Message * | msg | |||
) | [protected, virtual] |
Definition at line 81 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::OverlayStructureEvents::incomingRouteMessage(), logging_debug, logging_error, ariba::overlay::OverlayInterface::nodeid, ariba::overlay::OneHopMessage::OneHopMessageTypeRoute, overlayNodes, ariba::overlay::BaseOverlay::sendMessage(), ariba::utility::Identifier::toString(), and ariba::utility::LinkID::UNSPECIFIED.
ariba::overlay::OneHop::use_logging_h | ( | OneHop | ) | [private] |
vector<LinkID> ariba::overlay::OneHop::bootstrapLinks [private] |
Definition at line 107 of file OneHop.h.
Referenced by eventFunction(), getKnownNodes(), getNextLinkId(), leaveOverlay(), OneHop(), onLinkDown(), onMessage(), resolveNode(), and routeMessage().
OneHopState ariba::overlay::OneHop::state [private] |
Definition at line 115 of file OneHop.h.
Referenced by deleteOverlay(), joinOverlay(), leaveOverlay(), and onLinkDown().