#include <sample/testdht/DHTTest.h>
Inherits ariba::NodeListener, ariba::CommunicationListener, ariba::utility::StartupInterface, and ariba::utility::Timer.
Public Member Functions | |
DHTTest () | |
virtual | ~DHTTest () |
Protected Member Functions | |
virtual bool | onLinkRequest (const NodeID &remote) |
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 void | onKeyValue (const Data &key, const vector< Data > &value) |
virtual void | onJoinCompleted (const SpoVNetID &vid) |
virtual void | onJoinFailed (const SpoVNetID &vid) |
virtual void | onLeaveCompleted (const SpoVNetID &vid) |
virtual void | onLeaveFailed (const SpoVNetID &vid) |
virtual void | startup () |
virtual void | shutdown () |
virtual void | eventFunction () |
Data | stod (string s) |
string | dtos (Data d) |
Private Member Functions | |
use_logging_h (DHTTest) | |
Private Attributes | |
AribaModule * | ariba |
Node * | node |
string | name |
string | key |
string | data |
int | counter |
Static Private Attributes | |
static ServiceID | DHTTEST_SERVICEID = ServiceID( 111 ) |
Definition at line 23 of file DHTTest.h.
ariba::application::dhttest::DHTTest::DHTTest | ( | ) |
Definition at line 18 of file DHTTest.cpp.
References ariba::utility::Timer::setInterval().
ariba::application::dhttest::DHTTest::~DHTTest | ( | ) | [virtual] |
Definition at line 23 of file DHTTest.cpp.
string ariba::application::dhttest::DHTTest::dtos | ( | Data | d | ) | [protected] |
Definition at line 206 of file DHTTest.cpp.
References DataTpl< T, DataModel >::getBuffer(), and DataTpl< T, DataModel >::getLength().
Referenced by onKeyValue().
void ariba::application::dhttest::DHTTest::eventFunction | ( | ) | [protected, virtual] |
Reimplemented from ariba::utility::Timer.
Definition at line 121 of file DHTTest.cpp.
References counter, data, DHTTEST_SERVICEID, ariba::Node::get(), key, logging_info, node, ariba::Node::put(), and stod().
void ariba::application::dhttest::DHTTest::onJoinCompleted | ( | const SpoVNetID & | vid | ) | [protected, virtual] |
This event method is called, when a node has completed its join procedure.
vid | The spovnet id | |
nid | The node id |
Reimplemented from ariba::NodeListener.
Definition at line 140 of file DHTTest.cpp.
References counter, key, logging_info, ariba::utility::Timer::start(), and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::onJoinFailed | ( | const SpoVNetID & | vid | ) | [protected, virtual] |
This event method is called, when a node failed to join a spovnet.
vid | The spovnet id | |
nid | The node id |
Reimplemented from ariba::NodeListener.
Definition at line 153 of file DHTTest.cpp.
References logging_error, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 191 of file DHTTest.cpp.
References dtos(), and logging_info.
void ariba::application::dhttest::DHTTest::onLeaveCompleted | ( | const SpoVNetID & | vid | ) | [protected, virtual] |
This event method is called, when a node succeeded to leave a spovnet.
vid | The spovnet id | |
nid | The node id |
Reimplemented from ariba::NodeListener.
Definition at line 157 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::onLeaveFailed | ( | const SpoVNetID & | vid | ) | [protected, virtual] |
This event method is called, when a node failed to leave a spovnet.
vid | The spovnet id | |
nid | The node id |
Reimplemented from ariba::NodeListener.
Definition at line 161 of file DHTTest.cpp.
References logging_error, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 181 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 176 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 186 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
bool ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 166 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::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 from ariba::CommunicationListener.
Definition at line 171 of file DHTTest.cpp.
References logging_info, and ariba::utility::Identifier::toString().
void ariba::application::dhttest::DHTTest::shutdown | ( | ) | [protected, virtual] |
Implements ariba::utility::StartupInterface.
Definition at line 95 of file DHTTest.cpp.
References ariba, ariba::Node::leave(), logging_info, node, ariba::AribaModule::stop(), ariba::utility::Timer::stop(), and ariba::Node::unbind().
void ariba::application::dhttest::DHTTest::startup | ( | ) | [protected, virtual] |
Implements ariba::utility::StartupInterface.
Definition at line 27 of file DHTTest.cpp.
References ariba, ariba::Node::bind(), data, DHTTEST_SERVICEID, ariba::utility::Configuration::exists(), ariba::Node::getNodeId(), ariba::Node::getSpoVNetId(), ariba::Node::initiate(), ariba::Node::join(), key, logging_debug, logging_info, name, ariba::CommunicationListener::Node, node, ariba::utility::Configuration::read(), ariba::AribaModule::setProperty(), ariba::Module::start(), ariba::AribaModule::start(), ariba::utility::Identifier::toString(), and ariba::Name::UNSPECIFIED.
Data ariba::application::dhttest::DHTTest::stod | ( | string | s | ) | [protected] |
Definition at line 202 of file DHTTest.cpp.
Referenced by eventFunction().
ariba::application::dhttest::DHTTest::use_logging_h | ( | DHTTest | ) | [private] |
Reimplemented from ariba::utility::Timer.
Definition at line 64 of file DHTTest.h.
Referenced by shutdown(), and startup().
int ariba::application::dhttest::DHTTest::counter [private] |
Definition at line 71 of file DHTTest.h.
Referenced by eventFunction(), and onJoinCompleted().
string ariba::application::dhttest::DHTTest::data [private] |
Definition at line 70 of file DHTTest.h.
Referenced by eventFunction(), and startup().
ServiceID ariba::application::dhttest::DHTTest::DHTTEST_SERVICEID = ServiceID( 111 ) [static, private] |
Definition at line 74 of file DHTTest.h.
Referenced by eventFunction(), and startup().
string ariba::application::dhttest::DHTTest::key [private] |
Definition at line 69 of file DHTTest.h.
Referenced by eventFunction(), onJoinCompleted(), and startup().
string ariba::application::dhttest::DHTTest::name [private] |
Node* ariba::application::dhttest::DHTTest::node [private] |
Definition at line 65 of file DHTTest.h.
Referenced by eventFunction(), shutdown(), and startup().