Changeset 3690 for source/ariba/overlay/modules/OverlayInterface.h
- Timestamp:
- May 26, 2009, 1:40:23 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/OverlayInterface.h
r3067 r3690 1 // [Licen ce]1 // [License] 2 2 // The Ariba-Underlay Copyright 3 3 // … … 35 35 // official policies, either expressed or implied, of the Institute of 36 36 // Telematics. 37 // [Licen ce]37 // [License] 38 38 39 39 #ifndef __OVERLAY_INTERFACE_H … … 57 57 class BaseOverlay; 58 58 59 class OverlayInterface : public CommunicationListener { 59 /** 60 * This class declares an interface for an structured overlay. 61 */ 62 class OverlayInterface: public CommunicationListener { 60 63 friend class BaseOverlay; 64 61 65 public: 66 /** 67 * A node list 68 */ 69 typedef vector<NodeID> NodeList; 70 71 /** 72 * Constructs a new overlay. 73 */ 62 74 OverlayInterface( 63 BaseOverlay& _baseoverlay, 64 const NodeID& _nodeid, 65 OverlayStructureEvents* _eventsReceiver 66 ); 75 BaseOverlay& _baseoverlay, 76 const NodeID& _nodeid, 77 OverlayStructureEvents* _eventsReceiver ); 67 78 79 /** 80 * Destrcuts the overlay. 81 */ 68 82 virtual ~OverlayInterface(); 69 83 70 typedef vector<NodeID> NodeList; 84 /** 85 * Creates the overlay. 86 */ 87 virtual void createOverlay() = 0; 71 88 72 virtual void createOverlay() = 0; 89 /** 90 * Destroys the overlay. 91 */ 73 92 virtual void deleteOverlay() = 0; 74 93 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 */ 76 107 virtual void leaveOverlay() = 0; 77 108 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; 80 116 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 */ 81 135 virtual NodeList getKnownNodes() const = 0; 82 136 83 // functions from CommunicationListener that we _can_ use as overlay 137 //--- functions from CommunicationListener that we _can_ use as overlay --- 138 139 /// @see CommunicationListener 84 140 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 141 /// @see CommunicationListener 85 142 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); 143 /// @see CommunicationListener 86 144 virtual void onLinkChanged(const LinkID& lnk, const NodeID& remote); 145 /// @see CommunicationListener 87 146 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 89 151 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); 91 155 92 156 protected: 157 158 /// Reference to an active base overlay 93 159 BaseOverlay& baseoverlay; 160 161 /// The node identifier to use with this overlay 94 162 const NodeID& nodeid; 163 164 /// The listener used to inform about overlay structure changes 95 165 OverlayStructureEvents* eventsReceiver; 166 167 /// The service identifer of this overlay 96 168 static ServiceID OVERLAY_SERVICE_ID; 97 169 };
Note: See TracChangeset
for help on using the changeset viewer.