Index: source/ariba/overlay/modules/chord/Chord.h
===================================================================
--- source/ariba/overlay/modules/chord/Chord.h	(revision 12775)
+++ source/ariba/overlay/modules/chord/Chord.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,127 +35,42 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef CHORD_H_
 #define CHORD_H_
 
-#include "ariba/utility/system/Timer.h"
 #include "ariba/utility/logging/Logging.h"
 #include "ariba/communication/EndpointDescriptor.h"
-#include "../OverlayInterface.h"
-#include <vector>
-#include <stdexcept>
-
-class chord_routing_table;
 
 namespace ariba {
 namespace overlay {
 
-class OverlayMsg;
+using ariba::overlay::OverlayInterface;
+using ariba::communication::EndpointDescriptor;
 
-using ariba::communication::EndpointDescriptor;
-using ariba::utility::Timer;
-
-using namespace std;
-
-/**
- * This class implements a structured overlay inspired by chord.
- * It differs to the original form of chord in the following manner:
- *
- * (1) The graph is bidirectional
- * (2) Stabilization is done in a reactive manner
- *
- * It therefore can be considered as a kind of Chorded-Kademlia :)
- *
- * The resulting overlay graph has a diameter of O(log N).
- *
- * @author Sebastian Mies <mies@tm.uka.de>
- */
-class Chord : public OverlayInterface, protected Timer {
+class Chord : public OverlayInterface {
 	use_logging_h( Chord );
 private:
-	chord_routing_table* table;
-	int orphan_removal_counter;
-	int stabilize_counter;
-	int stabilize_finger;
-	vector<LinkID> bootstrapLinks;
-	vector<NodeID> pending;
-	vector<NodeID> discovery;
-	int discovery_count;
-
-	// helper: sets up a link using the "base overlay"
-	LinkID setup( const EndpointDescriptor& endp,
-		const NodeID& node = NodeID::UNSPECIFIED );
-
-	// helper: sends a message over a link using the "base overlay"
-	void send( OverlayMsg* msg, const LinkID& link );
-
-	// helper: sends a message to a node using the "base overlay"
-	void send_node( OverlayMsg* message, const NodeID& remote );
-	        
-	// stabilization: sends a discovery message to the specified neighborhood
-	void send_discovery_to( const NodeID& destination, int ttl = 3 );
-
-	void discover_neighbors( const LinkID& lnk );
-
-	void showLinks();
 
 public:
 	Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
-			OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
-	virtual ~Chord();
+			OverlayStructureEvents* _eventsReceiver);
+	~Chord();
 
-	/// @see OverlayInterface.h
-	virtual const LinkID& getNextLinkId( const NodeID& id ) const;
-	
-    /// @see OverlayInterface.h
-    /// NOTE: This implementation excepts num == 2
-    virtual std::vector<const LinkID*> getSortedLinkIdsTowardsNode(
-        const NodeID& id, int num = 0 ) const;
+	void createOverlay();
 
-	/// @see OverlayInterface.h
-	virtual const NodeID& getNextNodeId( const NodeID& id ) const;
+	void deleteOverlay();
 
-	/// @see OverlayInterface.h
-	virtual void createOverlay();
-
-	/// @see OverlayInterface.h
-	virtual void deleteOverlay();
-
-	/// @see OverlayInterface.h
-	virtual void joinOverlay(
-		const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED()
+	void joinOverlay(
+		const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED
 	);
 
-	/// @see OverlayInterface.h
-	virtual void leaveOverlay();
+	void leaveOverlay();
 
-	/// @see OverlayInterface.h
-	virtual const EndpointDescriptor& resolveNode( const NodeID& node );
+	const EndpointDescriptor& resolveNode( const NodeID& node );
 
-	/// @see OverlayInterface.h
-	virtual bool isClosestNodeTo( const NodeID& node );
+	void routeMessage( const NodeID& destnode, Message* msg );
 
-	/// @see OverlayInterface.h
-	virtual NodeList getKnownNodes(bool deep = true) const;
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onMessage(OverlayMsg* msg,
-	        reboost::shared_buffer_t sub_msg,
-	        const NodeID& remote,
-			const LinkID& lnk = LinkID::UNSPECIFIED);
-
-	/// @see OverlayInterface.h
-	virtual std::string debugInformation() const;
-
-	/// @see Timer.h
-	virtual void eventFunction();
-
+	NodeList getKnownNodes() const;
 };
 
