#include <source/ariba/CommunicationListener.h>
Inherited by ariba::application::dhttest::DHTTest, ariba::application::pingpong::PingPong, and ariba::overlay::OverlayInterface.
Static Public Attributes | |
static CommunicationListener | DEFAULT |
Protected Member Functions | |
CommunicationListener () | |
virtual | ~CommunicationListener () |
virtual void | onLinkUp (const LinkID &lnk, const NodeID &remote) |
virtual void | onLinkDown (const LinkID &lnk, const NodeID &remote) |
virtual void | onLinkChanged (const LinkID &lnk, const NodeID &remote) |
virtual void | onLinkFail (const LinkID &lnk, const NodeID &remote) |
virtual bool | onLinkRequest (const NodeID &remote) |
virtual void | onMessage (const DataMessage &msg, const NodeID &remote, const LinkID &lnk=LinkID::UNSPECIFIED) |
virtual void | onKeyValue (const Data &key, const vector< Data > &value) |
Friends | |
class | ariba::overlay::BaseOverlay |
class | Node |
Listener for communication events on links.
Definition at line 57 of file CommunicationListener.h.
ariba::CommunicationListener::CommunicationListener | ( | ) | [protected] |
Construct a communication listener
Definition at line 45 of file CommunicationListener.cpp.
ariba::CommunicationListener::~CommunicationListener | ( | ) | [protected, virtual] |
Destruct a communication listener
Definition at line 48 of file CommunicationListener.cpp.
void ariba::CommunicationListener::onKeyValue | ( | const Data & | key, | |
const vector< Data > & | value | |||
) | [protected, virtual] |
Called when a key has been resolved in the DHT
key | The key that was requested | |
value | the data items the key was resolved to |
Reimplemented in ariba::application::dhttest::DHTTest.
Definition at line 71 of file CommunicationListener.cpp.
void ariba::CommunicationListener::onLinkChanged | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Event called when a link has changed, e.g. through mobility
lnk | The id of the link | |
remote | The remote node where the link ends |
Reimplemented in ariba::overlay::OverlayInterface, ariba::application::pingpong::PingPong, and ariba::application::dhttest::DHTTest.
Definition at line 57 of file CommunicationListener.cpp.
Referenced by ariba::overlay::BaseOverlay::onLinkChanged().
void ariba::CommunicationListener::onLinkDown | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Event called when a link goes down
lnk | The id of the link | |
remote | The remote node where the link ends |
Reimplemented in ariba::overlay::Chord, ariba::overlay::OneHop, ariba::overlay::OverlayInterface, ariba::application::pingpong::PingPong, and ariba::application::dhttest::DHTTest.
Definition at line 54 of file CommunicationListener.cpp.
Referenced by ariba::overlay::BaseOverlay::onLinkDown().
void ariba::CommunicationListener::onLinkFail | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Event called when a link has failed
lnk | The id of the link | |
remote | The remote node where the link ends |
Reimplemented in ariba::overlay::OverlayInterface, ariba::application::pingpong::PingPong, and ariba::application::dhttest::DHTTest.
Definition at line 60 of file CommunicationListener.cpp.
Referenced by ariba::overlay::BaseOverlay::onLinkFail().
bool ariba::CommunicationListener::onLinkRequest | ( | const NodeID & | remote | ) | [protected, virtual] |
Request from remote node to open up a link
remote | The remote node that requests the new link |
Reimplemented in ariba::application::pingpong::PingPong, and ariba::application::dhttest::DHTTest.
Definition at line 63 of file CommunicationListener.cpp.
Referenced by ariba::overlay::BaseOverlay::handleLinkUpdate().
void ariba::CommunicationListener::onLinkUp | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Event called when a link goes up
lnk | The id of the link | |
remote | The remote node where the link ends |
Reimplemented in ariba::overlay::Chord, ariba::overlay::OneHop, ariba::overlay::OverlayInterface, ariba::application::pingpong::PingPong, and ariba::application::dhttest::DHTTest.
Definition at line 51 of file CommunicationListener.cpp.
Referenced by ariba::overlay::BaseOverlay::handleLinkReply(), and ariba::overlay::BaseOverlay::handleLinkUpdate().
void ariba::CommunicationListener::onMessage | ( | const DataMessage & | msg, | |
const NodeID & | remote, | |||
const LinkID & | lnk = LinkID::UNSPECIFIED | |||
) | [protected, virtual] |
Called when a message is incoming
msg | The data message that is received | |
remote | The remote node that sent the message | |
lnk | The link id of the link where the message is received |
Reimplemented in ariba::overlay::Chord, ariba::overlay::OneHop, ariba::overlay::OverlayInterface, and ariba::application::pingpong::PingPong.
Definition at line 67 of file CommunicationListener.cpp.
friend class ariba::overlay::BaseOverlay [friend] |
Definition at line 59 of file CommunicationListener.h.
friend class Node [friend] |
Definition at line 60 of file CommunicationListener.h.
Referenced by ariba::application::dhttest::DHTTest::startup(), and ariba::application::pingpong::PingPong::startup().
Definition at line 63 of file CommunicationListener.h.
Referenced by ariba::overlay::BaseOverlay::handleLinkUpdate(), and ariba::overlay::LinkDescriptor::LinkDescriptor().