An Overlay-based
Virtual Network Substrate
SpoVNet

Ignore:
Timestamp:
May 26, 2009, 1:40:23 AM (14 years ago)
Author:
mies
Message:

Merged 20090512-mies-connectors changes r3472:r3689 into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/OverlayInterface.h

    r3067 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __OVERLAY_INTERFACE_H
     
    5757class BaseOverlay;
    5858
    59 class OverlayInterface : public CommunicationListener {
     59/**
     60 * This class declares an interface for an structured overlay.
     61 */
     62class OverlayInterface: public CommunicationListener {
    6063        friend class BaseOverlay;
     64
    6165public:
     66        /**
     67         * A node list
     68         */
     69        typedef vector<NodeID> NodeList;
     70
     71        /**
     72         * Constructs a new overlay.
     73         */
    6274        OverlayInterface(
    63                 BaseOverlay& _baseoverlay,
    64                 const NodeID& _nodeid,
    65                 OverlayStructureEvents* _eventsReceiver
    66         );
     75                        BaseOverlay& _baseoverlay,
     76                        const NodeID& _nodeid,
     77                        OverlayStructureEvents* _eventsReceiver );
    6778
     79        /**
     80         * Destrcuts the overlay.
     81         */
    6882        virtual ~OverlayInterface();
    6983
    70         typedef vector<NodeID> NodeList;
     84        /**
     85         * Creates the overlay.
     86         */
     87        virtual void createOverlay() = 0;
    7188
    72         virtual void createOverlay() = 0;
     89        /**
     90         * Destroys the overlay.
     91         */
    7392        virtual void deleteOverlay() = 0;
    7493
    75         virtual void joinOverlay( const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED) = 0;
     94        /**
     95         * Joins the overlay. Starts integration and stabilization of the overlay
     96         * Node.
     97         *
     98         * @param bootstrap The bootstrap end-point descriptor or the default
     99         *    end-point, if this node is the initiator
     100         */
     101        virtual void joinOverlay(const EndpointDescriptor& bootstrap =
     102                EndpointDescriptor::UNSPECIFIED ) = 0;
     103
     104        /**
     105         * Leaves the overlay gracefully.
     106         */
    76107        virtual void leaveOverlay() = 0;
    77108
    78         virtual const EndpointDescriptor& resolveNode( const NodeID& node ) = 0;
    79         virtual void routeMessage( const NodeID& destnode, Message* msg ) = 0;
     109        /**
     110         * Resolves a overlay neighbor.
     111         *
     112         * @param node The node to resolve
     113         * @return Endpoint descriptor of local neighbor or UNSPECIFIED
     114         */
     115        virtual const EndpointDescriptor& resolveNode(const NodeID& node) = 0;
    80116
     117        /**
     118         * Routes a message to a given node by using overlay routing.
     119         *
     120         * @param destnode The destination node.
     121         * @param msg The message to be routed.
     122         */
     123        virtual void routeMessage(const NodeID& destnode, Message* msg) = 0;
     124
     125        /**
     126         * Returns the nodes known to this overlay.
     127         *
     128         * Usually this are the direct neighbors in the overlay structure.
     129         * For instance, Chord would return his predecessor, successor and finger
     130         * nodes. On the other hand OneHop would likely return all participating
     131         * nodes in the overlay.
     132         *
     133         * @return The list of all known nodes
     134         */
    81135        virtual NodeList getKnownNodes() const = 0;
    82136
    83         // functions from CommunicationListener that we _can_ use as overlay
     137        //--- functions from CommunicationListener that we _can_ use as overlay ---
     138
     139        /// @see CommunicationListener
    84140        virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
     141        /// @see CommunicationListener
    85142        virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
     143        /// @see CommunicationListener
    86144        virtual void onLinkChanged(const LinkID& lnk, const NodeID& remote);
     145        /// @see CommunicationListener
    87146        virtual void onLinkFail(const LinkID& lnk, const NodeID& remote);
    88         virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop);
     147        /// @see CommunicationListener
     148        virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote,
     149                        const LinkProperties& prop);
     150        /// @see CommunicationListener
    89151        virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg);
    90         virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED);
     152        /// @see CommunicationListener
     153        virtual void onMessage(const DataMessage& msg, const NodeID& remote,
     154                        const LinkID& lnk = LinkID::UNSPECIFIED);
    91155
    92156protected:
     157
     158        /// Reference to an active base overlay
    93159        BaseOverlay& baseoverlay;
     160
     161        /// The node identifier to use with this overlay
    94162        const NodeID& nodeid;
     163
     164        /// The listener used to inform about overlay structure changes
    95165        OverlayStructureEvents* eventsReceiver;
     166
     167        /// The service identifer of this overlay
    96168        static ServiceID OVERLAY_SERVICE_ID;
    97169};
Note: See TracChangeset for help on using the changeset viewer.