#include <source/ariba/AribaModule.h>
Inherits ariba::Module.
Classes | |
class | BootstrapInfo |
class | BootstrapNode |
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 |
const string | getLocalEndpoints () |
Protected Member Functions | |
void | addBootstrapNode (const Name &spovnet, communication::EndpointDescriptor *desc, const string &info, const BootstrapMechanism &mechanism) |
void | addBootstrapNode (const Name &spovnet, const BootstrapNode &node) |
vector < AribaModule::BootstrapMechanism > | getBootstrapMechanisms (const Name &spovnet) const |
const communication::EndpointDescriptor * | getBootstrapNode (const Name &spovnet, const BootstrapMechanism mechanism) const |
string | getBootstrapInfo (const Name &spovnet, const BootstrapMechanism mechanism) const |
Protected Attributes | |
string | endpoints |
bool | started |
communication::BaseCommunication * | base_comm |
SideportListener * | sideport_sniffer |
Private Types | |
enum | BootstrapMechanism { BootstrapMechanismInvalid = 0, BootstrapMechanismStatic = 1, BootstrapMechanismBroadcast = 2, BootstrapMechanismMulticastDNS = 3, BootstrapMechanismSDP = 4 } |
Private Member Functions | |
use_logging_h (AribaModule) | |
Private Attributes | |
vector< BootstrapInfo > | bootstrapNodes |
Static Private Attributes | |
static const string | BootstrapMechanismNames [5] = {"invalid", "static", "broadcast", "mdns", "sdp"} |
Friends | |
class | Node |
This class implements a container class for ariba base services. Each node is a running using this base-module. It also manages Bootstrap information in a abstract simple way.
+---+ +---+ |N1 | |N2 | +--| |---| |--+ | +---+ +---+ | | | | AribaModule | +-----------------+
N1, N2 are nodes.
Definition at line 87 of file AribaModule.h.
enum ariba::AribaModule::BootstrapMechanism [private] |
Available bootstrap mechanisms
BootstrapMechanismInvalid | |
BootstrapMechanismStatic | |
BootstrapMechanismBroadcast | |
BootstrapMechanismMulticastDNS | |
BootstrapMechanismSDP |
Definition at line 162 of file AribaModule.h.
ariba::AribaModule::AribaModule | ( | ) |
Constructor of the ariba underlay module
Definition at line 64 of file AribaModule.cpp.
References endpoints.
ariba::AribaModule::~AribaModule | ( | ) | [virtual] |
Destructor of the ariba underlay module
Definition at line 69 of file AribaModule.cpp.
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 96 of file AribaModule.cpp.
References addBootstrapNode(), BootstrapMechanismBroadcast, BootstrapMechanismMulticastDNS, BootstrapMechanismNames, BootstrapMechanismSDP, BootstrapMechanismStatic, getBootstrapHints(), ariba::AribaModule::BootstrapNode::info, logging_info, ariba::AribaModule::BootstrapNode::mechanism, ariba::utility::string_format::robject_data, ariba::utility::string_format::robject_id, ariba::utility::string_format::robjects, and ariba::utility::Helper::split().
Referenced by setProperty().
void ariba::AribaModule::addBootstrapNode | ( | const Name & | spovnet, | |
const BootstrapNode & | node | |||
) | [protected] |
bootstrap node management add a bootstrap node
Definition at line 160 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapInfo::nodes, and ariba::AribaModule::BootstrapInfo::spovnetName.
void ariba::AribaModule::addBootstrapNode | ( | const Name & | spovnet, | |
communication::EndpointDescriptor * | desc, | |||
const string & | info, | |||
const BootstrapMechanism & | mechanism | |||
) | [protected] |
bootstrap node management add a bootstrap node
Definition at line 153 of file AribaModule.cpp.
Referenced by addBootstrapHints().
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 BootstrapMechanismBroadcast, BootstrapMechanismMulticastDNS, BootstrapMechanismNames, BootstrapMechanismSDP, bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapNode::info, ariba::AribaModule::BootstrapNode::mechanism, ariba::AribaModule::BootstrapInfo::nodes, ariba::AribaModule::BootstrapInfo::spovnetName, ariba::communication::EndpointDescriptor::toString(), and ariba::Name::toString().
Referenced by addBootstrapHints(), and getProperty().
string ariba::AribaModule::getBootstrapInfo | ( | const Name & | spovnet, | |
const BootstrapMechanism | mechanism | |||
) | const [protected] |
get the info field associated for a given spovnet through a given mechanism
Definition at line 194 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapNode::info, ariba::AribaModule::BootstrapNode::mechanism, ariba::AribaModule::BootstrapInfo::nodes, and ariba::AribaModule::BootstrapInfo::spovnetName.
Referenced by ariba::Node::join().
vector< AribaModule::BootstrapMechanism > ariba::AribaModule::getBootstrapMechanisms | ( | const Name & | spovnet | ) | const [protected] |
bootstrap node management get all available bootstrap mechanisms where bootstrap nodes are available for
Definition at line 208 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::mechanism, ariba::AribaModule::BootstrapInfo::nodes, and ariba::AribaModule::BootstrapInfo::spovnetName.
Referenced by ariba::Node::join().
const communication::EndpointDescriptor * ariba::AribaModule::getBootstrapNode | ( | const Name & | spovnet, | |
const BootstrapMechanism | mechanism | |||
) | const [protected] |
get a endpoint descriptor for a spovnet using a specific bootstrap mechanisms. will currently only work with static
Definition at line 181 of file AribaModule.cpp.
References bootstrapNodes, ariba::AribaModule::BootstrapNode::desc, ariba::AribaModule::BootstrapNode::mechanism, ariba::AribaModule::BootstrapInfo::nodes, and ariba::AribaModule::BootstrapInfo::spovnetName.
Referenced by ariba::Node::join().
const string ariba::AribaModule::getLocalEndpoints | ( | ) |
Get the local endpoint information
Definition at line 287 of file AribaModule.cpp.
References base_comm, ariba::communication::BaseCommunication::getEndpointDescriptor(), and ariba::communication::EndpointDescriptor::toString().
string ariba::AribaModule::getName | ( | ) | const [virtual] |
const vector< string > ariba::AribaModule::getProperties | ( | ) | const [virtual] |
const string ariba::AribaModule::getProperty | ( | string | key | ) | const [virtual] |
Reimplemented from ariba::Module.
Definition at line 273 of file AribaModule.cpp.
References endpoints, and getBootstrapHints().
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 227 of file AribaModule.cpp.
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 222 of file AribaModule.cpp.
References sideport_sniffer.
void ariba::AribaModule::setProperty | ( | string | key, | |
string | value | |||
) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 267 of file AribaModule.cpp.
References addBootstrapHints(), and endpoints.
Referenced by ariba::application::dhttest::DHTTest::startup(), and ariba::application::pingpong::PingPong::startup().
void ariba::AribaModule::start | ( | ) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 237 of file AribaModule.cpp.
References base_comm, endpoints, ariba::communication::BaseCommunication::setEndpoints(), and started.
Referenced by ariba::application::dhttest::DHTTest::startup(), and ariba::application::pingpong::PingPong::startup().
void ariba::AribaModule::stop | ( | ) | [virtual] |
Reimplemented from ariba::Module.
Definition at line 250 of file AribaModule.cpp.
References base_comm, and started.
Referenced by ariba::application::dhttest::DHTTest::shutdown(), and ariba::application::pingpong::PingPong::shutdown().
ariba::AribaModule::use_logging_h | ( | AribaModule | ) | [private] |
friend class Node [friend] |
Definition at line 88 of file AribaModule.h.
Definition at line 268 of file AribaModule.h.
Referenced by getLocalEndpoints(), initialize(), ariba::Node::initiate(), ariba::Node::join(), ariba::Node::leave(), start(), and stop().
const string ariba::AribaModule::BootstrapMechanismNames = {"invalid", "static", "broadcast", "mdns", "sdp"} [static, private] |
Definition at line 169 of file AribaModule.h.
Referenced by addBootstrapHints(), and getBootstrapHints().
vector<BootstrapInfo> ariba::AribaModule::bootstrapNodes [private] |
Definition at line 213 of file AribaModule.h.
Referenced by addBootstrapNode(), getBootstrapHints(), getBootstrapInfo(), getBootstrapMechanisms(), and getBootstrapNode().
string ariba::AribaModule::endpoints [protected] |
Definition at line 217 of file AribaModule.h.
Referenced by AribaModule(), getProperty(), setProperty(), and start().
SideportListener* ariba::AribaModule::sideport_sniffer [protected] |
Definition at line 269 of file AribaModule.h.
Referenced by ariba::Node::bind(), and registerSideportListener().
bool ariba::AribaModule::started [protected] |
Definition at line 218 of file AribaModule.h.
Referenced by initialize(), start(), and stop().