Index: source/ariba/communication/EndpointDescriptor.h
===================================================================
--- source/ariba/communication/EndpointDescriptor.h	(revision 12775)
+++ source/ariba/communication/EndpointDescriptor.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,19 +35,26 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef ENDPOINTDESCRIPTOR_H_
 #define ENDPOINTDESCRIPTOR_H_
 
+#include "ariba/utility/types.h"
+#include "ariba/utility/serialization.h"
+#include "ariba/communication/modules/network/ip/IPv4Locator.h"
 #include <string>
 #include <set>
-//#include "ariba/utility/serialization.h"
-#include "ariba/utility/types/PeerID.h"
 
-#include "ariba/utility/addressing2/endpoint_set.hpp"
+using std::string;
+using std::set;
+using ariba::utility::Locator;
+using ariba::communication::IPv4Locator;
 
-// reboost messages
-#include "ariba/utility/transport/messages/message.hpp"
-
+// needed for friend decleration
+// in different namespace
+namespace ariba {
+namespace interface {
+	class UnderlayAbstraction;
+}}
 
 namespace ariba {
@@ -55,127 +62,52 @@
 
 using_serialization;
-using namespace std;
-using ariba::utility::PeerID;
 
+class EndpointDescriptor : VSerializeable {
+	VSERIALIZEABLE;
 
-/**
- * This class is used a transitions helper between the old addressing and
- * serialization to the new addressing2 and the new message classes
- * 
- * Maybe it will be replaced, or at least modified in the future.
- */
-//class EndpointDescriptor: public VSerializeable { VSERIALIZEABLE
-//    friend class BaseCommunication;
-class EndpointDescriptor
-{
-    friend class BaseCommunication;
+	friend class BaseCommunication;
+	friend class ariba::interface::UnderlayAbstraction;
 
 public:
-	/// creates an empty endpoint descriptor with zero endpoints
+	/**
+	 * The default constructor.
+	 */
 	EndpointDescriptor();
 
-	/// destructor.
+	EndpointDescriptor(const EndpointDescriptor& rh);
+	EndpointDescriptor(const Locator* _locator);
+
+	/**
+	 * The destructor.
+	 */
 	virtual ~EndpointDescriptor();
 
-	/// copy constructor
-	EndpointDescriptor(const EndpointDescriptor& rh);
+	/**
+	 * An unspecified end-point
+	 */
+	static const EndpointDescriptor UNSPECIFIED;
 
-	/// construct end-points from an endpoint set
-	EndpointDescriptor(const PeerID& peer_id, addressing2::EndpointSetPtr endpoints );
+	/**
+	 * Returns true, if the descriptor is unspecified.
+	 *
+	 * @return True, if the descriptor is unspecified.
+	 */
+	bool isUnspecified() const;
 
-	// FIXME NOT WORKING !!
-	/// construct end-points from a string
-	EndpointDescriptor(const string& str);
+	virtual string toString() const;
+	static EndpointDescriptor* fromString( string str );
 
-	/// convert end-points to string
-	string toString() const {
-		return endpoints->to_string();
-	}
+	bool operator==( const EndpointDescriptor& rh ) const;
 
-	static EndpointDescriptor& UNSPECIFIED() {
-		static EndpointDescriptor* unspec = NULL;
-		if(unspec == NULL) unspec = new EndpointDescriptor();
-
-		return *unspec;
-	}
-
-	/// returns true, if this object is the unspecified object
-	bool isUnspecified() const {
-		return (this == &UNSPECIFIED());
-	}
-
-//	/// create endpoint
-//	static EndpointDescriptor* fromString(string str) {
-//		return new EndpointDescriptor(str);
-//	}
-
-	bool operator==(const EndpointDescriptor& rh) const {
-		if (rh.isUnspecified() && isUnspecified()) return true;
-		if (rh.isUnspecified() ^  isUnspecified()) return false;
-
-		assert( (!rh.isUnspecified()) && (!isUnspecified()) );
-		return endpoints == rh.endpoints;
-	}
-
-	bool operator!=(const EndpointDescriptor& rh) const {
-		return ( !operator==(rh) );
-	}
-
-	EndpointDescriptor& operator=( const EndpointDescriptor& rhs) {
-		endpoints = rhs.endpoints;
-		return *this;
-	}
-
-	/// returns the end-points of this descriptor
-	addressing2::const_EndpointSetPtr getEndpoints() const {
-		return endpoints;
-	}
-	
-	void replace_endpoint_set(addressing2::EndpointSetPtr new_endpoints)
-	{
-	    endpoints = new_endpoints;
-	}
-	
-	/// returns a reference to the peer id
-	PeerID& getPeerId() {
-		return peerId;
-	}
-
-
-	/// returns a reference to the constant peer id
-	const PeerID& getPeerId() const {
-		return peerId;
-	}
-	
-	/// returns a message with peerId and endpoints in it
-	reboost::message_t serialize() const;
-	
-	/// deserialite peerId and endpoints
-	reboost::shared_buffer_t deserialize(reboost::shared_buffer_t buff);
-	
 private:
-	addressing2::EndpointSetPtr endpoints;
-	PeerID peerId;
+	bool isUnspec;
+	IPv4Locator* locator;
 };
 
 }} // namespace ariba, communication
 
-//sznBeginDefault( ariba::communication::EndpointDescriptor, X ){
-//
-//    // TODO
-//    assert(false);
-//    
-//	// serialize peer id
-//	X && &peerId;
-//
-//	// serialize end-points
-//	uint16_t len = endpoints.to_bytes_size();
-//	X && len;
-//	uint8_t* buffer = X.bytes( len );
-//	if (buffer!=NULL) {
-//		if (X.isDeserializer()) endpoints.assign(buffer,len);
-//		else endpoints.to_bytes(buffer);
-//	}
-//}sznEnd();
+sznBeginDefault( ariba::communication::EndpointDescriptor, X ) {
+	X && VO(locator);
+} sznEnd();
 
 #endif /*ENDPOINTDESCRIPTOR_H_*/
