ariba::communication::BaseCommunication Class Reference

#include <source/ariba/communication/BaseCommunication.h>

Inheritance diagram for ariba::communication::BaseCommunication:

Inheritance graph
[legend]
Collaboration diagram for ariba::communication::BaseCommunication:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 BaseCommunication ()
virtual ~BaseCommunication ()
void start (const NetworkLocator *_locallocator, const uint16_t _listenport)
void stop ()
const LinkID establishLink (const EndpointDescriptor &descriptor, const LinkID &linkid=LinkID::UNSPECIFIED, const QoSParameterSet &qos=QoSParameterSet::DEFAULT, const SecurityParameterSet &sec=SecurityParameterSet::DEFAULT)
void dropLink (const LinkID link)
seqnum_t sendMessage (const LinkID lid, const Message *message)
const EndpointDescriptorgetEndpointDescriptor (const LinkID link=LinkID::UNSPECIFIED) const
LinkIDs getLocalLinks (const EndpointDescriptor &ep=EndpointDescriptor::UNSPECIFIED) const
void registerMessageReceiver (MessageReceiver *_receiver)
void unregisterMessageReceiver (MessageReceiver *_receiver)
void registerEventListener (CommunicationEvents *_events)
void unregisterEventListener (CommunicationEvents *_events)

Protected Member Functions

virtual bool receiveMessage (const Message *message, const LinkID &link, const NodeID &node)
virtual void onNetworkChange (const NetworkChangeInterface::NetworkChangeInfo &info)

Private Types

typedef vector< LinkDescriptorLinkSet
typedef set
< CommunicationEvents * > 
EventListenerSet

Private Member Functions

 use_logging_h (BaseCommunication)
void addLink (const LinkDescriptor &link)
void removeLink (const LinkID &localLink)
LinkDescriptorqueryLocalLink (const LinkID &localLink) const
LinkDescriptorqueryRemoteLink (const LinkID &remoteLink) const

Private Attributes

LinkSet linkSet
MessageReceiver * messageReceiver
EndpointDescriptor localDescriptor
NetworkProtocol * network
TransportProtocol * transport
NetworkChangeDetection networkMonitor
uint16_t listenport
EventListenerSet eventListener
seqnum_t currentSeqnum

Classes

class  LinkDescriptor


Detailed Description

This class implements the Ariba Base Communication

Its primary task is to provide an abstraction to existing protocols and addressing schemes.

Author:
Sebastian Mies, Christoph Mayer

Definition at line 121 of file BaseCommunication.h.


Member Typedef Documentation

Link management: list of links

Definition at line 294 of file BaseCommunication.h.

Definition at line 334 of file BaseCommunication.h.


Constructor & Destructor Documentation

ariba::communication::BaseCommunication::BaseCommunication (  ) 

Default ctor that just creates an empty non functional base communication

Definition at line 57 of file BaseCommunication.cpp.

ariba::communication::BaseCommunication::~BaseCommunication (  )  [virtual]

Default dtor that does nothing

Definition at line 61 of file BaseCommunication.cpp.


Member Function Documentation

ariba::communication::BaseCommunication::use_logging_h ( BaseCommunication   )  [private]

void ariba::communication::BaseCommunication::start ( const NetworkLocator *  _locallocator,
const uint16_t  _listenport 
)

void ariba::communication::BaseCommunication::stop (  ) 

stop the base communication, stop modules etc.

Definition at line 150 of file BaseCommunication.cpp.

References logging_info, network, and transport.

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

const LinkID ariba::communication::BaseCommunication::establishLink ( const EndpointDescriptor descriptor,
const LinkID linkid = LinkID::UNSPECIFIED,
const QoSParameterSet qos = QoSParameterSet::DEFAULT,
const SecurityParameterSet sec = SecurityParameterSet::DEFAULT 
)

Establishes a link to another end-point.

void ariba::communication::BaseCommunication::dropLink ( const LinkID  link  ) 

seqnum_t ariba::communication::BaseCommunication::sendMessage ( const LinkID  lid,
const Message message 
)

Sends a message though an existing link to an end-point.

Parameters:
lid The link identifier
message The message to be sent
Returns:
A sequence number for this message

Definition at line 240 of file BaseCommunication.cpp.

References currentSeqnum, Message::encapsulate(), ariba::communication::AribaBaseMsg::LINK_STATE_DATA, logging_debug, logging_error, queryLocalLink(), ariba::utility::Identifier::toString(), and transport.

const EndpointDescriptor & ariba::communication::BaseCommunication::getEndpointDescriptor ( const LinkID  link = LinkID::UNSPECIFIED  )  const

Returns the end-point descriptor

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

Definition at line 272 of file BaseCommunication.cpp.

References ariba::communication::BaseCommunication::LinkDescriptor::isUnspecified(), localDescriptor, queryLocalLink(), ariba::communication::BaseCommunication::LinkDescriptor::remoteEndpoint, ariba::communication::EndpointDescriptor::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.

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

LinkIDs ariba::communication::BaseCommunication::getLocalLinks ( const EndpointDescriptor ep = EndpointDescriptor::UNSPECIFIED  )  const

Get local links to the given endpoint of all local link using the default parameter EndpointDescriptor::UNSPECIFIED

Parameters:
ep The remote endpoint to get all links to.
Returns:
List of LinkID

Definition at line 564 of file BaseCommunication.cpp.

References linkSet, ariba::communication::EndpointDescriptor::locator, and ariba::communication::EndpointDescriptor::UNSPECIFIED.

void ariba::communication::BaseCommunication::registerMessageReceiver ( MessageReceiver *  _receiver  ) 

Registers a receiver.

Parameters:
_receiver The receiving side

Definition at line 283 of file BaseCommunication.cpp.

References messageReceiver.

void ariba::communication::BaseCommunication::unregisterMessageReceiver ( MessageReceiver *  _receiver  ) 

Unregister a receiver.

Parameters:
_receiver The receiving side

Definition at line 287 of file BaseCommunication.cpp.

References messageReceiver.

void ariba::communication::BaseCommunication::registerEventListener ( CommunicationEvents _events  ) 

Definition at line 291 of file BaseCommunication.cpp.

References eventListener.

void ariba::communication::BaseCommunication::unregisterEventListener ( CommunicationEvents _events  ) 

Definition at line 297 of file BaseCommunication.cpp.

References eventListener.

bool ariba::communication::BaseCommunication::receiveMessage ( const Message message,
const LinkID link,
const NodeID node 
) [protected, virtual]

Called from the Transport when async items from the SystemQueue are delivered

Definition at line 305 of file BaseCommunication.cpp.

References addLink(), ariba::utility::LinkID::create(), eventListener, ariba::communication::AribaBaseMsg::getLocalLink(), ariba::communication::AribaBaseMsg::getRemoteLink(), ariba::communication::AribaBaseMsg::getType(), ariba::communication::AribaBaseMsg::getTypeString(), ariba::communication::BaseCommunication::LinkDescriptor::isUnspecified(), ariba::communication::AribaBaseMsg::LINK_STATE_CLOSE_REQUEST, ariba::communication::AribaBaseMsg::LINK_STATE_DATA, ariba::communication::AribaBaseMsg::LINK_STATE_OPEN_REPLY, ariba::communication::AribaBaseMsg::LINK_STATE_OPEN_REQUEST, ariba::communication::AribaBaseMsg::LINK_STATE_UPDATE, ariba::communication::BaseCommunication::LinkDescriptor::linkup, localDescriptor, ariba::communication::BaseCommunication::LinkDescriptor::localLink, ariba::communication::BaseCommunication::LinkDescriptor::localLocator, ariba::communication::EndpointDescriptor::locator, logging_debug, logging_warn, messageReceiver, ariba::communication::CommunicationEvents::onLinkChanged(), ariba::communication::CommunicationEvents::onLinkDown(), ariba::communication::CommunicationEvents::onLinkRequest(), ariba::communication::CommunicationEvents::onLinkUp(), queryLocalLink(), ariba::communication::BaseCommunication::LinkDescriptor::remoteLink, ariba::communication::BaseCommunication::LinkDescriptor::remoteLocator, removeLink(), ariba::utility::Identifier::toString(), transport, and ariba::utility::NodeID::UNSPECIFIED.

void ariba::communication::BaseCommunication::onNetworkChange ( const NetworkChangeInterface::NetworkChangeInfo info  )  [protected, virtual]

void ariba::communication::BaseCommunication::addLink ( const LinkDescriptor link  )  [private]

Link management: add a link

Definition at line 535 of file BaseCommunication.cpp.

References linkSet.

Referenced by receiveMessage().

void ariba::communication::BaseCommunication::removeLink ( const LinkID localLink  )  [private]

Link management: remove alink

Definition at line 539 of file BaseCommunication.cpp.

References linkSet.

Referenced by dropLink(), and receiveMessage().

BaseCommunication::LinkDescriptor & ariba::communication::BaseCommunication::queryLocalLink ( const LinkID localLink  )  const [private]

Link management: get link information using the local link

Definition at line 552 of file BaseCommunication.cpp.

References linkSet, and ariba::communication::BaseCommunication::LinkDescriptor::UNSPECIFIED.

Referenced by dropLink(), getEndpointDescriptor(), receiveMessage(), and sendMessage().

BaseCommunication::LinkDescriptor & ariba::communication::BaseCommunication::queryRemoteLink ( const LinkID remoteLink  )  const [private]

Link management: get link information using the remote link

Definition at line 558 of file BaseCommunication.cpp.

References linkSet, and ariba::communication::BaseCommunication::LinkDescriptor::UNSPECIFIED.


Member Data Documentation

Link management: the set of currently managed links

Definition at line 299 of file BaseCommunication.h.

Referenced by addLink(), getLocalLinks(), onNetworkChange(), queryLocalLink(), queryRemoteLink(), and removeLink().

The message receiver

Definition at line 304 of file BaseCommunication.h.

Referenced by receiveMessage(), registerMessageReceiver(), and unregisterMessageReceiver().

The local end-point descriptor

Definition at line 309 of file BaseCommunication.h.

Referenced by getEndpointDescriptor(), onNetworkChange(), receiveMessage(), and start().

Network information and protocol

Definition at line 314 of file BaseCommunication.h.

Referenced by onNetworkChange(), start(), and stop().

Transport information and protocol

Definition at line 319 of file BaseCommunication.h.

Referenced by dropLink(), onNetworkChange(), receiveMessage(), sendMessage(), start(), and stop().

Detect changes in the routing/interface, etc. stuff needed for mobility detection

Definition at line 326 of file BaseCommunication.h.

Referenced by start().

The local listen port

Definition at line 332 of file BaseCommunication.h.

Referenced by onNetworkChange(), and start().

Definition at line 337 of file BaseCommunication.h.

Referenced by sendMessage(), and start().


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

Generated on Wed May 27 18:23:59 2009 for Ariba by  doxygen 1.5.6