ariba::overlay::BaseOverlay Class Reference

#include <source/ariba/overlay/BaseOverlay.h>

Inheritance diagram for ariba::overlay::BaseOverlay:

Inheritance graph
[legend]
Collaboration diagram for ariba::overlay::BaseOverlay:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 BaseOverlay ()
virtual ~BaseOverlay ()
void start (BaseCommunication &_basecomm, const NodeID &_nodeid)
void stop ()
const LinkID establishLink (const NodeID &node, const ServiceID &service, const LinkID &linkid=LinkID::UNSPECIFIED)
 establishes a link between two arbitrary nodes
const LinkID establishLink (const EndpointDescriptor &ep, const ServiceID &service, const LinkID &linkid=LinkID::UNSPECIFIED)
void dropLink (const LinkID &link)
 drops a link
seqnum_t sendMessage (const Message *message, const LinkID &link)
 sends a message over an existing link
seqnum_t sendMessage (const Message *message, const NodeID &node, const ServiceID &service)
 sends a message to a node and a specific service
void broadcastMessage (Message *message, const ServiceID &service)
const EndpointDescriptorgetEndpointDescriptor (const LinkID &link=LinkID::UNSPECIFIED) const
vector< NodeIDgetOverlayNeighbors () const
const EndpointDescriptorgetEndpointDescriptor (const NodeID &node) const
bool bind (CommunicationListener *listener, const ServiceID &sid)
bool unbind (CommunicationListener *listener, const ServiceID &sid)
bool bind (NodeListener *listener)
bool unbind (NodeListener *listener)
bool registerSidePort (SideportListener *_sideport)
bool unregisterSidePort (SideportListener *_sideport)
const NodeIDgetNodeID (const LinkID &lid=LinkID::UNSPECIFIED) const
vector< LinkIDgetLinkIDs (const NodeID &nid=NodeID::UNSPECIFIED) const
void joinSpoVNet (const SpoVNetID &id, const EndpointDescriptor &boot)
void createSpoVNet (const SpoVNetID &id, const OverlayParameterSet &param=OverlayParameterSet::DEFAULT, const SecurityParameterSet &sec=SecurityParameterSet::DEFAULT, const QoSParameterSet &qos=QoSParameterSet::DEFAULT)
void leaveSpoVNet ()

Protected Member Functions

virtual void onLinkUp (const LinkID &id, const NetworkLocator *local, const NetworkLocator *remote)
virtual void onLinkDown (const LinkID &id, const NetworkLocator *local, const NetworkLocator *remote)
virtual void onLinkChanged (const LinkID &id, const NetworkLocator *oldlocal, const NetworkLocator *newlocal, const NetworkLocator *oldremote, const NetworkLocator *newremote)
virtual void onLinkFail (const LinkID &id, const NetworkLocator *local, const NetworkLocator *remote)
virtual void onLinkQoSChanged (const LinkID &id, const NetworkLocator *local, const NetworkLocator *remote, const QoSParameterSet &qos)
virtual bool onLinkRequest (const LinkID &id, const NetworkLocator *local, const NetworkLocator *remote)
virtual bool receiveMessage (const Message *message, const LinkID &link, const NodeID &)
virtual void incomingRouteMessage (Message *msg)
virtual void onNodeJoin (const NodeID &node)
virtual void eventFunction ()

Private Types

enum  _BaseOverlayState { BaseOverlayStateInvalid = 0, BaseOverlayStateInitiator = 1, BaseOverlayStateJoinInitiated = 2, BaseOverlayStateCompleted = 3 }
typedef vector< NodeListener * > NodeListenerVector
typedef enum
ariba::overlay::BaseOverlay::_BaseOverlayState 
BaseOverlayState
typedef map< const LinkID,
LinkItem
LinkMapping
typedef pair< const LinkID,
LinkItem
LinkPair
typedef map< const uint32_t,
LinkID
PendingLinkMap
typedef vector< NodeIDJoiningNodes

Private Member Functions

 use_logging_h (BaseOverlay)
void updateOvlVis (const NodeID &node)

Private Attributes

BaseCommunicationbc
NodeID nodeId
SpoVNetID spovnetId
Demultiplexer
< CommunicationListener
*, ServiceID
communicationListeners
NodeListenerVector nodeListeners
SideportListenersideport
OverlayInterfaceoverlayInterface
LinkID initiatorLink
BaseOverlayState state
NodeID spovnetInitiator
NodeID min
NodeID max
NodeID succ
NodeID pred
LinkMapping linkMapping
PendingLinkMap pendingLinks
JoiningNodes joiningNodes

Friends

class OneHop
class Chord

Classes

class  LinkItem


Detailed Description

Definition at line 114 of file BaseOverlay.h.


Member Typedef Documentation

TODO

Definition at line 365 of file BaseOverlay.h.

The state of the BaseOverlay

Definition at line 484 of file BaseOverlay.h.

typedef pair<const LinkID, LinkItem> ariba::overlay::BaseOverlay::LinkPair [private]

Definition at line 485 of file BaseOverlay.h.

typedef map<const uint32_t, LinkID> ariba::overlay::BaseOverlay::PendingLinkMap [private]

Definition at line 489 of file BaseOverlay.h.

nodes with pending joines. TODO: should be cleaned every some seconds, add timestamps to each, and check on occasion

Definition at line 496 of file BaseOverlay.h.


Member Enumeration Documentation

The state of the BaseOverlay

Enumerator:
BaseOverlayStateInvalid 
BaseOverlayStateInitiator 
BaseOverlayStateJoinInitiated 
BaseOverlayStateCompleted 

Definition at line 392 of file BaseOverlay.h.


Constructor & Destructor Documentation

ariba::overlay::BaseOverlay::BaseOverlay (  ) 

Constructs an empty non-functional base overlay instance

Definition at line 56 of file BaseOverlay.cpp.

ariba::overlay::BaseOverlay::~BaseOverlay (  )  [virtual]

Destructs a base overlay instance

Definition at line 62 of file BaseOverlay.cpp.


Member Function Documentation

ariba::overlay::BaseOverlay::use_logging_h ( BaseOverlay   )  [private]

void ariba::overlay::BaseOverlay::start ( BaseCommunication _basecomm,
const NodeID _nodeid 
)

Starts the Base Overlay instance

Referenced by ariba::Node::initiate(), and ariba::Node::join().

void ariba::overlay::BaseOverlay::stop (  ) 

Stops the Base Overlay instance

Reimplemented from ariba::utility::Timer.

Definition at line 94 of file BaseOverlay.cpp.

References bc, logging_info, and ariba::utility::Timer::stop().

Referenced by ariba::Node::leave().

const LinkID ariba::overlay::BaseOverlay::establishLink ( const NodeID node,
const ServiceID service,
const LinkID linkid = LinkID::UNSPECIFIED 
)

establishes a link between two arbitrary nodes

Starts a link establishment procedure to the specfied node for the service with id service

Parameters:
node Destination node id
service Service to connect to
linkid Link identifier to be used with this link

Definition at line 208 of file BaseOverlay.cpp.

References bc, communicationListeners, ariba::utility::LinkID::create(), ariba::utility::Identifier::isUnspecified(), linkMapping, logging_debug, logging_error, overlayInterface, ariba::overlay::OverlayMsg::OverlayMessageTypeLinkRequest, pendingLinks, ariba::overlay::OverlayInterface::routeMessage(), ariba::utility::NodeID::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.

Referenced by ariba::Node::establishLink(), ariba::overlay::OneHop::joinOverlay(), ariba::overlay::OneHop::onMessage(), sendMessage(), and ariba::overlay::Chord::setup().

const LinkID ariba::overlay::BaseOverlay::establishLink ( const EndpointDescriptor ep,
const ServiceID service,
const LinkID linkid = LinkID::UNSPECIFIED 
)

Starts a link establishment procedure to the specified

endpoint and to the specified service

Definition at line 248 of file BaseOverlay.cpp.

References bc, communicationListeners, linkMapping, logging_error, ariba::utility::ServiceID::toString(), ariba::utility::NodeID::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.

void ariba::overlay::BaseOverlay::dropLink ( const LinkID link  ) 

seqnum_t ariba::overlay::BaseOverlay::sendMessage ( const Message message,
const LinkID link 
)

seqnum_t ariba::overlay::BaseOverlay::sendMessage ( const Message message,
const NodeID node,
const ServiceID service 
)

void ariba::overlay::BaseOverlay::broadcastMessage ( Message message,
const ServiceID service 
)

Send out a message to all nodes that are known in the overlay structure. Depending on the structure of the overlay, this can be very different.

Definition at line 1014 of file BaseOverlay.cpp.

References ariba::overlay::OverlayInterface::getKnownNodes(), logging_debug, nodeId, overlayInterface, sendMessage(), and ariba::utility::ServiceID::toString().

Referenced by ariba::Node::sendBroadcastMessage().

const EndpointDescriptor & ariba::overlay::BaseOverlay::getEndpointDescriptor ( const LinkID link = LinkID::UNSPECIFIED  )  const

Returns the end-point descriptor of a link.

Parameters:
link the link id of the requested end-point
Returns:
The end-point descriptor of the link's end-point

Definition at line 401 of file BaseOverlay.cpp.

References bc.

Referenced by ariba::overlay::OneHop::eventFunction(), ariba::SideportListener::getEndpointDescription(), ariba::overlay::OneHop::onMessage(), receiveMessage(), ariba::overlay::OneHop::resolveNode(), ariba::overlay::Chord::resolveNode(), and ariba::overlay::Chord::send_discovery_to().

vector< NodeID > ariba::overlay::BaseOverlay::getOverlayNeighbors (  )  const

Get a list of overlay neighbors.

Returns:
A list of overlay neighbors.

Definition at line 1030 of file BaseOverlay.cpp.

References ariba::overlay::OverlayInterface::getKnownNodes(), nodeId, and overlayInterface.

Referenced by ariba::Node::getNeighborNodes().

const EndpointDescriptor & ariba::overlay::BaseOverlay::getEndpointDescriptor ( const NodeID node  )  const

Returns a end-endpoint descriptor of a overlay neighbor. If the node is not known -- an unspecified endpoint descriptor is returned.

Parameters:
node The node identifer of a overlay neighbor.
Returns:
The end-point descriptor of the node or unspecified.

Definition at line 406 of file BaseOverlay.cpp.

References bc, logging_error, nodeId, overlayInterface, ariba::overlay::OverlayInterface::resolveNode(), ariba::communication::EndpointDescriptor::UNSPECIFIED, and ariba::utility::NodeID::UNSPECIFIED.

bool ariba::overlay::BaseOverlay::bind ( CommunicationListener listener,
const ServiceID sid 
)

bool ariba::overlay::BaseOverlay::unbind ( CommunicationListener listener,
const ServiceID sid 
)

bool ariba::overlay::BaseOverlay::bind ( NodeListener listener  ) 

Definition at line 463 of file BaseOverlay.cpp.

References logging_debug, logging_warn, and nodeListeners.

bool ariba::overlay::BaseOverlay::unbind ( NodeListener listener  ) 

Definition at line 476 of file BaseOverlay.cpp.

References logging_debug, logging_warn, and nodeListeners.

bool ariba::overlay::BaseOverlay::registerSidePort ( SideportListener _sideport  ) 

Definition at line 435 of file BaseOverlay.cpp.

References ariba::SideportListener::configure(), and sideport.

Referenced by ariba::Node::bind().

bool ariba::overlay::BaseOverlay::unregisterSidePort ( SideportListener _sideport  ) 

Definition at line 440 of file BaseOverlay.cpp.

References ariba::SideportListener::DEFAULT, and sideport.

const NodeID & ariba::overlay::BaseOverlay::getNodeID ( const LinkID lid = LinkID::UNSPECIFIED  )  const

Returns the own nodeID or the NodeID of the specified link

Parameters:
lid The link identifier
Returns:
The NodeID of the link

Definition at line 1072 of file BaseOverlay.cpp.

References linkMapping, nodeId, ariba::utility::NodeID::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.

Referenced by ariba::SideportListener::getNodeID(), and ariba::Node::getNodeId().

vector< LinkID > ariba::overlay::BaseOverlay::getLinkIDs ( const NodeID nid = NodeID::UNSPECIFIED  )  const

Return all Links for the specified remote nodeid, or all links when the node id given is set to unspecified

Parameters:
nid The node id to request links for, or unspecified for all links
Returns:
a vector that contains all the link ids requested

Definition at line 1081 of file BaseOverlay.cpp.

References linkMapping, and ariba::utility::NodeID::UNSPECIFIED.

Referenced by ariba::SideportListener::getLinkIDs().

void ariba::overlay::BaseOverlay::joinSpoVNet ( const SpoVNetID id,
const EndpointDescriptor boot 
)

Join a existing sponaneous virtual network (spovnet).

Parameters:
id A spovnet identifier
boot A bootstrap node

Definition at line 103 of file BaseOverlay.cpp.

References BaseOverlayStateJoinInitiated, bc, initiatorLink, logging_info, nodeId, ovl, ovlId, spovnetId, state, and ariba::utility::Identifier::toString().

Referenced by ariba::Node::join().

void ariba::overlay::BaseOverlay::createSpoVNet ( const SpoVNetID id,
const OverlayParameterSet &  param = OverlayParameterSet::DEFAULT,
const SecurityParameterSet sec = SecurityParameterSet::DEFAULT,
const QoSParameterSet qos = QoSParameterSet::DEFAULT 
)

Initiates a new spontaneous virtual network. This makes this BaseOverlay to the SpoVNet-Initiator.

Parameters:
id The spovnet identifier

Referenced by ariba::Node::initiate().

void ariba::overlay::BaseOverlay::leaveSpoVNet (  ) 

void ariba::overlay::BaseOverlay::onLinkUp ( const LinkID id,
const NetworkLocator *  local,
const NetworkLocator *  remote 
) [protected, virtual]

void ariba::overlay::BaseOverlay::onLinkDown ( const LinkID id,
const NetworkLocator *  local,
const NetworkLocator *  remote 
) [protected, virtual]

See also:
ariba::communication::CommunicationEvents.h

Reimplemented from ariba::communication::CommunicationEvents.

Definition at line 559 of file BaseOverlay.cpp.

References linkMapping, logging_debug, logging_warn, nodeId, ariba::SideportListener::onLinkDown(), and sideport.

void ariba::overlay::BaseOverlay::onLinkChanged ( const LinkID id,
const NetworkLocator *  oldlocal,
const NetworkLocator *  newlocal,
const NetworkLocator *  oldremote,
const NetworkLocator *  newremote 
) [protected, virtual]

See also:
ariba::communication::CommunicationEvents.h

Reimplemented from ariba::communication::CommunicationEvents.

Definition at line 593 of file BaseOverlay.cpp.

References linkMapping, logging_debug, nodeId, ariba::SideportListener::onLinkChanged(), and sideport.

void ariba::overlay::BaseOverlay::onLinkFail ( const LinkID id,
const NetworkLocator *  local,
const NetworkLocator *  remote 
) [protected, virtual]

See also:
ariba::communication::CommunicationEvents.h

Reimplemented from ariba::communication::CommunicationEvents.

Definition at line 612 of file BaseOverlay.cpp.

References linkMapping, logging_debug, nodeId, ariba::SideportListener::onLinkFail(), and sideport.

virtual void ariba::overlay::BaseOverlay::onLinkQoSChanged ( const LinkID id,
const NetworkLocator *  local,
const NetworkLocator *  remote,
const QoSParameterSet qos 
) [protected, virtual]

See also:
ariba::communication::CommunicationEvents.h

Reimplemented from ariba::communication::CommunicationEvents.

bool ariba::overlay::BaseOverlay::onLinkRequest ( const LinkID id,
const NetworkLocator *  local,
const NetworkLocator *  remote 
) [protected, virtual]

See also:
ariba::communication::CommunicationEvents.h

Reimplemented from ariba::communication::CommunicationEvents.

Definition at line 646 of file BaseOverlay.cpp.

References logging_debug.

bool ariba::overlay::BaseOverlay::receiveMessage ( const Message message,
const LinkID link,
const NodeID  
) [protected, virtual]

Processes a received message.

Beware: nodeid is not valid in this case! (since this class implements nodeid's in the first place *g*)

Definition at line 656 of file BaseOverlay.cpp.

References BaseOverlayStateCompleted, BaseOverlayStateInitiator, BaseOverlayStateInvalid, BaseOverlayStateJoinInitiated, bc, communicationListeners, ariba::overlay::OverlayFactory::create(), ariba::CommunicationListener::DEFAULT, dropLink(), ariba::overlay::JoinReply::getBootstrapEndpoint(), ariba::overlay::LinkRequest::getEndpoint(), getEndpointDescriptor(), ariba::overlay::JoinReply::getJoinAllowed(), ariba::overlay::LinkRequest::getNonce(), ariba::overlay::JoinReply::getParam(), ariba::overlay::OverlayInterface::getParameters(), ariba::overlay::JoinReply::getSpoVNetID(), ariba::overlay::JoinRequest::getSpoVNetID(), initiatorLink, ariba::overlay::LinkRequest::isReply(), joiningNodes, linkMapping, logging_debug, logging_error, logging_fatal, logging_info, logging_warn, nodeId, nodeListeners, ariba::NodeListener::onJoinCompleted(), ariba::NodeListener::onJoinFailed(), ariba::NodeListener::onLeaveFailed(), ariba::CommunicationListener::onLinkRequest(), ariba::SideportListener::onLinkUp(), ariba::CommunicationListener::onLinkUp(), ariba::CommunicationListener::onMessage(), overlayInterface, ariba::overlay::OverlayMsg::OverlayMessageTypeBye, ariba::overlay::OverlayMsg::OverlayMessageTypeData, ariba::overlay::OverlayMsg::OverlayMessageTypeJoinReply, ariba::overlay::OverlayMsg::OverlayMessageTypeJoinRequest, ariba::overlay::OverlayMsg::OverlayMessageTypeLinkRequest, ariba::overlay::OverlayMsg::OverlayMessageTypeUpdate, ovl, ovlId, pendingLinks, ariba::overlay::OverlayInterface::routeMessage(), sendMessage(), sideport, spovnetInitiator, state, ariba::communication::EndpointDescriptor::toString(), ariba::utility::Identifier::toString(), ariba::utility::ServiceID::toString(), and ariba::utility::LinkID::UNSPECIFIED.

Referenced by incomingRouteMessage().

void ariba::overlay::BaseOverlay::incomingRouteMessage ( Message msg  )  [protected, virtual]

void ariba::overlay::BaseOverlay::onNodeJoin ( const NodeID node  )  [protected, virtual]

This method is called, when a new node joined the network

See also:
OverlayStructureEvents.h

Reimplemented from ariba::overlay::OverlayStructureEvents.

Definition at line 1099 of file BaseOverlay.cpp.

References joiningNodes, logging_info, and ariba::utility::Identifier::toString().

void ariba::overlay::BaseOverlay::eventFunction (  )  [protected, virtual]

Timer Event method

Reimplemented from ariba::utility::Timer.

Definition at line 1110 of file BaseOverlay.cpp.

References dropLink(), linkMapping, logging_debug, and ariba::utility::Identifier::toString().

void ariba::overlay::BaseOverlay::updateOvlVis ( const NodeID node  )  [private]

Definition at line 1041 of file BaseOverlay.cpp.

References ariba::utility::Identifier::isUnspecified(), max, min, nodeId, ovl, ovlId, and succ.


Friends And Related Function Documentation

friend class OneHop [friend]

Definition at line 118 of file BaseOverlay.h.

friend class Chord [friend]

Definition at line 119 of file BaseOverlay.h.


Member Data Documentation

The BaseCommunication the BaseOverlay communicates over

Definition at line 344 of file BaseOverlay.h.

Referenced by dropLink(), establishLink(), getEndpointDescriptor(), joinSpoVNet(), leaveSpoVNet(), onLinkUp(), receiveMessage(), sendMessage(), and stop().

The SpoVNetID that we are joined to or that we have created.

Definition at line 355 of file BaseOverlay.h.

Referenced by joinSpoVNet(), and leaveSpoVNet().

TODO

Definition at line 360 of file BaseOverlay.h.

Referenced by bind(), establishLink(), receiveMessage(), and unbind().

TODO

Definition at line 370 of file BaseOverlay.h.

Referenced by bind(), leaveSpoVNet(), receiveMessage(), and unbind().

The abstract overlay interface that implements the overlay specific functionality.

Definition at line 381 of file BaseOverlay.h.

Referenced by broadcastMessage(), establishLink(), getEndpointDescriptor(), getOverlayNeighbors(), leaveSpoVNet(), and receiveMessage().

The special link to the Initiator of the SpoVNet or LinkID::UNDEFINED if we are the Initiator

Definition at line 387 of file BaseOverlay.h.

Referenced by joinSpoVNet(), leaveSpoVNet(), onLinkUp(), and receiveMessage().

TODO

Definition at line 402 of file BaseOverlay.h.

Referenced by joinSpoVNet(), leaveSpoVNet(), onLinkUp(), and receiveMessage().

The initiator node

Definition at line 407 of file BaseOverlay.h.

Referenced by receiveMessage().

OvlVis

Definition at line 412 of file BaseOverlay.h.

Referenced by updateOvlVis().

Definition at line 412 of file BaseOverlay.h.

Referenced by updateOvlVis().

Definition at line 413 of file BaseOverlay.h.

Referenced by updateOvlVis().

Definition at line 413 of file BaseOverlay.h.

Definition at line 490 of file BaseOverlay.h.

Referenced by establishLink(), and receiveMessage().

Definition at line 497 of file BaseOverlay.h.

Referenced by onNodeJoin(), and receiveMessage().


The documentation for this class was generated from the following files:

Generated on Wed May 27 18:24:02 2009 for Ariba by  doxygen 1.5.6