#include <source/ariba/AribaModule.h>
Public Member Functions | |
AribaModule () | |
virtual | ~AribaModule () |
string | getBootstrapHints (const Name &spoVNetName=Name::UNSPECIFIED) const |
void | addBootstrapHints (string bootinfo) |
void | registerSideportListener (SideportListener *sideport) |
void | initialize () |
void | start () |
void | stop () |
string | getName () const |
void | setProperty (string key, string value) |
const string | getProperty (string key) const |
const vector< string > | getProperties () const |
Protected Member Functions | |
void | addBootstrapNode (const Name &spovnet, communication::EndpointDescriptor *desc) |
const communication::EndpointDescriptor * | getBootstrapNode (const Name &spovnet) const |
Protected Attributes | |
string | bootstrapFile |
bool | started |
communication::BaseCommunication * | base_comm |
SideportListener * | sideport_sniffer |
communication::NetworkLocator * | ip_addr |
uint16_t | tcp_port |
uint16_t | udp_port |
Private Attributes | |
vector< BootstrapInfo > | bootstrapNodes |
Friends | |
class | Node |
Classes | |
class | BootstrapInfo |
class | BootstrapNode |
+---+ +---+ |N1 | |N2 | +--| |---| |--+ | +---+ +---+ | | | | AribaModule | +-----------------+
N1, N2 are nodes.
Definition at line 87 of file AribaModule.h.
ariba::AribaModule::AribaModule | ( | ) |
Constructor of the ariba underlay module
Definition at line 59 of file AribaModule.cpp.
ariba::AribaModule::~AribaModule | ( | ) | [virtual] |
Destructor of the ariba underlay module
Definition at line 69 of file AribaModule.cpp.
string ariba::AribaModule::getBootstrapHints | ( | const Name & | spoVNetName = Name::UNSPECIFIED |
) | const |
Returns all known bootstrap endpoints to this ariba module in a human-readable string. This information can be used by other nodes for bootstraping. It may also be used to publish this info to other nodes via the web, for example.
The | name of the spovnet |
Definition at line 72 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapInfo::nodes, ariba::AribaModule::BootstrapInfo::spovnetName, ariba::communication::EndpointDescriptor::toString(), and ariba::Name::toString().
Referenced by getProperty().
void ariba::AribaModule::addBootstrapHints | ( | string | bootinfo | ) |
Adds bootstrap hints to the local database. The format of the string must is the same as returned by getBootstrapInfo
.
bootinfo | A string containing bootstrap information. |
Definition at line 87 of file AribaModule.cpp.
References addBootstrapNode(), ariba::utility::string_format::robject_data, ariba::utility::string_format::robject_id, and ariba::utility::string_format::robjects.
Referenced by setProperty().
void ariba::AribaModule::registerSideportListener | ( | SideportListener * | sideport | ) |
Register a sideport for sniffing on communication events and get advanced information. The sniffer is attached to every node that is created on the module. Only one such sniffer can be active system-wide, a new call to this register function will only attach the sniffer to nodes created after the registration call.
sideport | The SideportListener to integrate |
Definition at line 148 of file AribaModule.cpp.
References sideport_sniffer.
void ariba::AribaModule::initialize | ( | ) | [virtual] |
Module Property information:
ip.addr = preferred ip address (otherwise bind to all) tcp.port = preferred tcp port (or use default value) udp.port = preferred udp port (or use default value) bootstrap.hints = used bootstrap hints bootstrap.file = used file for bootstrap information
Reimplemented from ariba::Module.
Definition at line 153 of file AribaModule.cpp.
void ariba::AribaModule::start | ( | ) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 163 of file AribaModule.cpp.
References base_comm, and started.
Referenced by ariba::application::pingpong::PingPong::startup().
void ariba::AribaModule::stop | ( | ) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 175 of file AribaModule.cpp.
References base_comm, and started.
Referenced by ariba::application::pingpong::PingPong::shutdown().
string ariba::AribaModule::getName | ( | ) | const [virtual] |
void ariba::AribaModule::setProperty | ( | string | key, | |
string | value | |||
) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 192 of file AribaModule.cpp.
References addBootstrapHints(), ariba::communication::IPv4Locator::fromString(), ip_addr, ariba::utility::Helper::stoi(), tcp_port, and udp_port.
Referenced by ariba::application::pingpong::PingPong::startup().
const string ariba::AribaModule::getProperty | ( | string | key | ) | const [virtual] |
Reimplemented from ariba::Module.
Definition at line 205 of file AribaModule.cpp.
References getBootstrapHints(), ip_addr, tcp_port, udp_port, and ariba::utility::Helper::ultos().
const vector< string > ariba::AribaModule::getProperties | ( | ) | const [virtual] |
void ariba::AribaModule::addBootstrapNode | ( | const Name & | spovnet, | |
communication::EndpointDescriptor * | desc | |||
) | [protected] |
Definition at line 107 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapInfo::nodes, ariba::AribaModule::BootstrapInfo::spovnetName, and ariba::AribaModule::BootstrapNode::timestamp.
Referenced by addBootstrapHints(), and ariba::Node::initiate().
const communication::EndpointDescriptor * ariba::AribaModule::getBootstrapNode | ( | const Name & | spovnet | ) | const [protected] |
Definition at line 136 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapInfo::nodes, and ariba::AribaModule::BootstrapInfo::spovnetName.
Referenced by ariba::Node::join().
friend class Node [friend] |
Definition at line 88 of file AribaModule.h.
vector<BootstrapInfo> ariba::AribaModule::bootstrapNodes [private] |
Definition at line 184 of file AribaModule.h.
Referenced by addBootstrapNode(), getBootstrapHints(), and getBootstrapNode().
string ariba::AribaModule::bootstrapFile [protected] |
Definition at line 188 of file AribaModule.h.
bool ariba::AribaModule::started [protected] |
Definition at line 197 of file AribaModule.h.
Referenced by initialize(), ariba::Node::initiate(), ariba::Node::join(), ariba::Node::leave(), start(), and stop().
SideportListener* ariba::AribaModule::sideport_sniffer [protected] |
Definition at line 198 of file AribaModule.h.
Referenced by ariba::Node::bind(), and registerSideportListener().
communication::NetworkLocator* ariba::AribaModule::ip_addr [protected] |
Definition at line 201 of file AribaModule.h.
Referenced by getProperty(), ariba::Node::initiate(), ariba::Node::join(), and setProperty().
uint16_t ariba::AribaModule::tcp_port [protected] |
Definition at line 202 of file AribaModule.h.
Referenced by AribaModule(), getProperty(), ariba::Node::initiate(), ariba::Node::join(), and setProperty().
uint16_t ariba::AribaModule::udp_port [protected] |
Definition at line 202 of file AribaModule.h.
Referenced by AribaModule(), getProperty(), and setProperty().