[hydra-commits] hydra/servicediscovery.git branch "master" updated.

Commits to the Hydra project code repositories hydra-commits at lists.digium.com
Mon Aug 2 08:44:27 CDT 2010


branch "master" has been updated
       via  9c79125b7fccf4db64b4c49b20a9cdaa3b8e6f09 (commit)
       via  f169fbae00e877f99dc23016bd4f8f6e2b604cd5 (commit)
      from  470dff22c9e44b382ab57a2bcd9657da11b53246 (commit)

Summary of changes:
 slice/service_locator.ice        |   59 ++++++++++++++++++++-----------------
 src/ServiceLocator.cpp           |    1 +
 src/ServiceLocatorManagement.cpp |    1 +
 src/ServiceLocatorManagement.h   |   18 ++++++------
 src/ServiceManagement.cpp        |    1 +
 src/ServiceManagement.h          |   16 +++++-----
 test/TestServiceLocator.cpp      |    2 +-
 7 files changed, 53 insertions(+), 45 deletions(-)


- Log -----------------------------------------------------------------
commit 9c79125b7fccf4db64b4c49b20a9cdaa3b8e6f09
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Aug 2 10:45:19 2010 -0300

    Add versioning to the service locator interface.

diff --git a/slice/service_locator.ice b/slice/service_locator.ice
index c6af87b..132403f 100644
--- a/slice/service_locator.ice
+++ b/slice/service_locator.ice
@@ -6,6 +6,9 @@ module Hydra
 module Location
 {
 
+module V1
+{
+
 	/**
 	 * Exception used for service locator requests to indicate that no service could be found.
 	 */
@@ -148,6 +151,8 @@ module Location
 		void removeCompare(string compareguid) throws CompareNotFound;
 	};
 
+}; // end module V1
+
 }; // end module Location
 
 }; // end module Hydra
diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 6b6951c..a3cc274 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -30,6 +30,7 @@
 
 using namespace std;
 using namespace Hydra::Location;
+using namespace Hydra::Location::V1;
 
 /**
  * Implementation of the Ice::Application class
diff --git a/src/ServiceLocatorManagement.cpp b/src/ServiceLocatorManagement.cpp
index 3c31c67..72eb845 100644
--- a/src/ServiceLocatorManagement.cpp
+++ b/src/ServiceLocatorManagement.cpp
@@ -29,6 +29,7 @@
 
 using namespace std;
 using namespace Hydra::Location;
+using namespace Hydra::Location::V1;
 
 /**
  * Implementation of the locate method as defined in service_locator.ice
diff --git a/src/ServiceLocatorManagement.h b/src/ServiceLocatorManagement.h
index e9cc2f6..e66e761 100644
--- a/src/ServiceLocatorManagement.h
+++ b/src/ServiceLocatorManagement.h
@@ -36,7 +36,7 @@ public:
 	 *
 	 * @param compare A proxy to the comparator service we are wrapping.
 	 */
-        ServiceLocatorComparator(const Hydra::Location::ServiceLocatorParamsComparePrx& compare) : mCompare(compare) { };
+        ServiceLocatorComparator(const Hydra::Location::V1::ServiceLocatorParamsComparePrx& compare) : mCompare(compare) { };
 
 	/**
 	 * API call which forwards an isSupported over ICE to a remote comparator.
@@ -45,12 +45,12 @@ public:
 	 *
 	 * @return A boolean value with true indicating the parameters are supported while false indicates otherwise.
 	 */
-	bool isSupported(const Hydra::Location::ServiceLocatorParamsPtr& params) { return mCompare->isSupported(params); };
+	bool isSupported(const Hydra::Location::V1::ServiceLocatorParamsPtr& params) { return mCompare->isSupported(params); };
 private:
 	/**
 	 * A proxy to the comparator service that we are wrapping.
 	 */
-	Hydra::Location::ServiceLocatorParamsComparePrx mCompare;
+	Hydra::Location::V1::ServiceLocatorParamsComparePrx mCompare;
 };
 
 /**
@@ -61,17 +61,17 @@ typedef IceUtil::Handle<ServiceManagementImpl> ServiceManagementImplPtr;
 /**
  * Implementation of the ServiceLocatorManagement interface as defined in service_locator.ice
  */
-class ServiceLocatorManagementImpl : public Hydra::Location::ServiceLocatorManagement
+class ServiceLocatorManagementImpl : public Hydra::Location::V1::ServiceLocatorManagement
 {
 public:
 ServiceLocatorManagementImpl(Ice::ObjectAdapterPtr adapter, const Hydra::Location::EventsPrx& service_discovery_topic)
 	: mAdapter(adapter), mLocatorTopic(service_discovery_topic) { };
-	Ice::ObjectPrx locate(const Hydra::Location::ServiceLocatorParamsPtr&);
-	Ice::ObjectProxySeq locateAll(const Hydra::Location::ServiceLocatorParamsPtr&);
-	Hydra::Location::ServiceManagementPrx addService(const Ice::ObjectPrx&, const std::string&, const Ice::Current&);
-	void addCompare(const std::string&, const Hydra::Location::ServiceLocatorParamsComparePrx&, const Ice::Current&);
+	Ice::ObjectPrx locate(const Hydra::Location::V1::ServiceLocatorParamsPtr&);
+	Ice::ObjectProxySeq locateAll(const Hydra::Location::V1::ServiceLocatorParamsPtr&);
+	Hydra::Location::V1::ServiceManagementPrx addService(const Ice::ObjectPrx&, const std::string&, const Ice::Current&);
+	void addCompare(const std::string&, const Hydra::Location::V1::ServiceLocatorParamsComparePrx&, const Ice::Current&);
 	void removeCompare(const std::string&, const Ice::Current&);
-	bool isSupported(const std::string&, const Hydra::Location::ServiceLocatorParamsPtr&);
+	bool isSupported(const std::string&, const Hydra::Location::V1::ServiceLocatorParamsPtr&);
 	void removeService(ServiceManagementImplPtr);
 private:
 	/**
diff --git a/src/ServiceManagement.cpp b/src/ServiceManagement.cpp
index 4dda3a7..4dfa3dc 100644
--- a/src/ServiceManagement.cpp
+++ b/src/ServiceManagement.cpp
@@ -29,6 +29,7 @@
 
 using namespace std;
 using namespace Hydra::Location;
+using namespace Hydra::Location::V1;
 
 /**
  * Constructor for the ServiceManagementImpl class. This adds itself to the object adapter so the service can perform some management and
diff --git a/src/ServiceManagement.h b/src/ServiceManagement.h
index 76ede8a..49f72c6 100644
--- a/src/ServiceManagement.h
+++ b/src/ServiceManagement.h
@@ -25,14 +25,14 @@
  */
 class ServiceLocatorParamsSpec {
 public:
-ServiceLocatorParamsSpec(const Hydra::Location::ServiceLocatorParamsPtr& params, const std::string& compare_guid, ServiceLocatorManagementImpl* management)
+ServiceLocatorParamsSpec(const Hydra::Location::V1::ServiceLocatorParamsPtr& params, const std::string& compare_guid, ServiceLocatorManagementImpl* management)
 		: mParams(params), mCompareGuid(compare_guid), mManagement(management) { };
-	bool isSupported(const Hydra::Location::ServiceLocatorParamsPtr&);
+	bool isSupported(const Hydra::Location::V1::ServiceLocatorParamsPtr&);
 private:
 	/**
 	 * A pointer to a parameters structure which describes what is supported.
 	 */
-	Hydra::Location::ServiceLocatorParamsPtr mParams;
+	Hydra::Location::V1::ServiceLocatorParamsPtr mParams;
 
 	/**
 	 * A string containing the comparator uuid that should be used when comparing the parameters
@@ -49,11 +49,11 @@ private:
 /**
  * An implementation of the ServiceManagement interface as defined in service_locator.ice
  */
-class ServiceManagementImpl : public Hydra::Location::ServiceManagement
+class ServiceManagementImpl : public Hydra::Location::V1::ServiceManagement
 {
 public:
         ServiceManagementImpl(ServiceLocatorManagementImpl*, const Ice::ObjectPrx&, Ice::ObjectAdapterPtr, const Hydra::Location::EventsPrx&, const std::string&);
-	void addLocatorParams(const Hydra::Location::ServiceLocatorParamsPtr&, const std::string&, const Ice::Current&);
+	void addLocatorParams(const Hydra::Location::V1::ServiceLocatorParamsPtr&, const std::string&, const Ice::Current&);
 	void suspend(const Ice::Current&);
 	void unsuspend(const Ice::Current&);
 	void unregister(const Ice::Current&);
@@ -66,9 +66,9 @@ public:
 	/**
 	 * Function which returns a local proxy to this service's management interface.
 	 */
-	Hydra::Location::ServiceManagementPrx GetServiceManagementPrx() { return mManagementPrx; };
+	Hydra::Location::V1::ServiceManagementPrx GetServiceManagementPrx() { return mManagementPrx; };
 
-	bool isSupported(const Hydra::Location::ServiceLocatorParamsPtr&);
+	bool isSupported(const Hydra::Location::V1::ServiceLocatorParamsPtr&);
 private:
 	/**
 	 * Shared mutex lock which protects the service.
@@ -98,7 +98,7 @@ private:
 	/**
 	 * A local proxy to this management service.
 	 */
-	Hydra::Location::ServiceManagementPrx mManagementPrx;
+	Hydra::Location::V1::ServiceManagementPrx mManagementPrx;
 
 	/**
 	 * A vector of locator parameters that this service supports.
diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index 706b160..db6adec 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -11,7 +11,7 @@
 #include "service_locator_events.h"
 
 using namespace std;
-using namespace Hydra::Location;
+using namespace Hydra::Location::V1;
 
 /* A basic compare service implementation that always returns true, this is registered as both a compare service
  * and a regular service during testing.

commit f169fbae00e877f99dc23016bd4f8f6e2b604cd5
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Aug 2 10:36:30 2010 -0300

    Fix indentation.

diff --git a/slice/service_locator.ice b/slice/service_locator.ice
index 042b9a3..c6af87b 100644
--- a/slice/service_locator.ice
+++ b/slice/service_locator.ice
@@ -120,33 +120,33 @@ module Location
 	 */
 	interface ServiceLocatorManagement
 	{
-			/**
-			 * Method which adds a service to the service locator.
-			 *
-			 * @param service A proxy to the service that is being registered.
-			 *
-			 * @param guid A unique identifier for the service which is used in events.
-			 *
-			 * @return A proxy to the service management interface for this service.
-			 */
-			ServiceManagement *addService(Object *service, string guid);
-
-			/**
-			 * Method which adds a comparator to the service locator.
-			 *
-			 * @param compareguid A unique identifier for this comparator.
-			 *
-			 * @param compare A proxy to the comparator service.
-			 */
-			void addCompare(string compareguid, ServiceLocatorParamsCompare *compare) throws DuplicateCompare;
-
-			/**
-			 * Method which removes a comparator from the service locator.
-			 *
-			 * @param compareguid The unique identifier for the comparator to remove.
-			 */
-			void removeCompare(string compareguid) throws CompareNotFound;
-		};
+		/**
+		 * Method which adds a service to the service locator.
+		 *
+		 * @param service A proxy to the service that is being registered.
+		 *
+		 * @param guid A unique identifier for the service which is used in events.
+		 *
+		 * @return A proxy to the service management interface for this service.
+		 */
+		ServiceManagement *addService(Object *service, string guid);
+
+		/**
+		 * Method which adds a comparator to the service locator.
+		 *
+		 * @param compareguid A unique identifier for this comparator.
+		 *
+		 * @param compare A proxy to the comparator service.
+		 */
+		void addCompare(string compareguid, ServiceLocatorParamsCompare *compare) throws DuplicateCompare;
+
+		/**
+		 * Method which removes a comparator from the service locator.
+		 *
+		 * @param compareguid The unique identifier for the comparator to remove.
+		 */
+		void removeCompare(string compareguid) throws CompareNotFound;
+	};
 
 }; // end module Location
 

-----------------------------------------------------------------------


-- 
hydra/servicediscovery.git




More information about the asterisk-scf-commits mailing list