[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "retry_deux" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Mar 27 19:02:57 CDT 2012


branch "retry_deux" has been updated
       via  1843243fcdc029e058cacccd1e50ba1c7d03787a (commit)
      from  2dd1870f965830cf4a7a69bdc0b1d45d611ddb8f (commit)

Summary of changes:
 .../SIPSessionManager/SIPStateReplicationIf.ice    |   20 +++++----
 src/Component.cpp                                  |    4 +-
 src/PJSIPRegistrarModule.cpp                       |    6 +-
 src/PJSIPSessionModule.cpp                         |    4 +-
 src/SIPEndpoint.cpp                                |    8 ++--
 src/SIPStateReplicator.h                           |   12 ++++-
 src/SIPStateReplicatorApp.cpp                      |   44 +++++++++++--------
 src/SIPStateReplicatorListener.cpp                 |   13 ++++-
 src/SIPTransfer.cpp                                |    9 ++--
 9 files changed, 72 insertions(+), 48 deletions(-)


- Log -----------------------------------------------------------------
commit 1843243fcdc029e058cacccd1e50ba1c7d03787a
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Mar 27 19:02:56 2012 -0500

    OperationContext for the replication stuff.

diff --git a/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice b/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice
index d78f5a1..4c29b77 100644
--- a/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/SIPSessionManager/SIPStateReplicationIf.ice
@@ -24,6 +24,7 @@
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
 #include <AsteriskSCF/System/Component/ConfigurationIf.ice>
 #include <AsteriskSCF/SIP/SIPRegistrarIf.ice>
+#include <AsteriskSCF/System/OperationsIf.ice>
 
 module AsteriskSCF
 {
@@ -50,18 +51,21 @@ module V1
 
    interface SIPStateReplicatorListener
    {
-      void stateRemoved(Ice::StringSeq itemKeys);
-      void stateRemovedForItems(SIPStateItemSeq items);
-	  void stateSet(SIPStateItemSeq items);
+      void stateRemoved(AsteriskSCF::System::V1::OperationContext operationContext,
+          Ice::StringSeq itemKeys);
+      void stateRemovedForItems(AsteriskSCF::System::V1::OperationContext operationContext,
+           SIPStateItemSeq items);
+      void stateSet(AsteriskSCF::System::V1::OperationContext operationContext,
+           SIPStateItemSeq items);
    };
 
    interface SIPStateReplicator
    {
-      void addListener(SIPStateReplicatorListener *listener);
-      void removeListener(SIPStateReplicatorListener *listener);
-      void setState (SIPStateItemSeq items);
-      void removeState(Ice::StringSeq items);
-      void removeStateForItems(SIPStateItemSeq items);
+      void addListener(AsteriskSCF::System::V1::OperationContext operationContext, SIPStateReplicatorListener *listener);
+      void removeListener(AsteriskSCF::System::V1::OperationContext operationContext, SIPStateReplicatorListener *listener);
+      void setState (AsteriskSCF::System::V1::OperationContext operationContext, SIPStateItemSeq items);
+      void removeState(AsteriskSCF::System::V1::OperationContext operationContext, Ice::StringSeq items);
+      void removeStateForItems(AsteriskSCF::System::V1::OperationContext operationContext, SIPStateItemSeq items);
       idempotent SIPStateItemSeq getState(Ice::StringSeq iteKeys);
       idempotent SIPStateItemSeq getAllState();
    };
diff --git a/src/Component.cpp b/src/Component.cpp
index e261fcf..0a44fa5 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -318,7 +318,7 @@ void Component::listenToStateReplicators()
         // Are we in standby mode?
         if (sipReplicationContext->getState() == STANDBY_IN_REPLICA_GROUP)
         {
-            sipReplicationContext->getReplicator()->addListener(mReplicatorListenerProxy);
+            sipReplicationContext->getReplicator()->addListener(Operations::createContext(), mReplicatorListenerProxy);
             mListeningToReplicator = true;
         }
     }
@@ -347,7 +347,7 @@ void Component::stopListeningToStateReplicators()
 
     try
     {
-        sipReplicationContext->getReplicator()->removeListener(mReplicatorListenerProxy);
+        sipReplicationContext->getReplicator()->removeListener(Operations::createContext(), mReplicatorListenerProxy);
         mListeningToReplicator = false;
     }
     catch (const Ice::Exception& e)
diff --git a/src/PJSIPRegistrarModule.cpp b/src/PJSIPRegistrarModule.cpp
index a4506f7..dc8c175 100644
--- a/src/PJSIPRegistrarModule.cpp
+++ b/src/PJSIPRegistrarModule.cpp
@@ -420,7 +420,7 @@ public:
                 SIPRegistrarStateItemPtr newItem(new SIPRegistrarStateItem(mAOR, mAOR, newDict, true));
                 SIPStateItemSeq items;
                 items.push_back(newItem);
-                mReplicationContext->getReplicator().tryOneWay()->setState(items);
+                mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), items);
             }
 
             if (!mExistingBindings.empty())
@@ -429,7 +429,7 @@ public:
                 SIPRegistrarStateItemPtr existingItem(new SIPRegistrarStateItem(mAOR, mAOR, existingDict, false));
                 SIPStateItemSeq items;
                 items.push_back(existingItem);
-                mReplicationContext->getReplicator().tryOneWay()->setState(items);
+                mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), items);
             }
 
             if (!mRemovedBindings.empty())
@@ -438,7 +438,7 @@ public:
                 SIPRegistrarStateItemPtr removedItem(new SIPRegistrarStateItem(mAOR, mAOR, removedDict, false));
                 SIPStateItemSeq items;
                 items.push_back(removedItem);
-                mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(items);
+                mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(Operations::createContext(), items);
             }
         }
         catch (const Ice::TwowayOnlyException&)
diff --git a/src/PJSIPSessionModule.cpp b/src/PJSIPSessionModule.cpp
index e80a970..088e9ea 100644
--- a/src/PJSIPSessionModule.cpp
+++ b/src/PJSIPSessionModule.cpp
@@ -318,12 +318,12 @@ void PJSIPSessionModule::replicateState(PJSIPDialogModInfo *dlgInfo, PJSIPTransa
     {
         if (setItems.size() != 0)
         {
-            mReplicationContext->getReplicator().tryOneWay()->setState(setItems);
+            mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), setItems);
         }
 
         if (removeItems.size() != 0)
         {
-            mReplicationContext->getReplicator().tryOneWay()->removeState(removeItems);
+            mReplicationContext->getReplicator().tryOneWay()->removeState(Operations::createContext(), removeItems);
         }
     }
 }
diff --git a/src/SIPEndpoint.cpp b/src/SIPEndpoint.cpp
index 0fd6798..cb8143c 100644
--- a/src/SIPEndpoint.cpp
+++ b/src/SIPEndpoint.cpp
@@ -716,7 +716,7 @@ void SIPEndpoint::addDefaultSessionListener(
              mImplPriv->mName, 
             listener));
 
-    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->setState(items);
+    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), items);
 }
 
 void SIPEndpoint::removeDefaultSessionListener(
@@ -745,7 +745,7 @@ void SIPEndpoint::removeDefaultSessionListener(
                 mImplPriv->mName, 
             listener));
 
-    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(items);
+    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(Operations::createContext(), items);
 }
 
 /** 
@@ -806,7 +806,7 @@ void SIPEndpoint::addDefaultSessionCookies(const AsteriskSCF::SessionCommunicati
                 (*i)));
     }
 
-    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->setState(items);
+    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), items);
 }
 
 void SIPEndpoint::addDefaultSessionCookies(
@@ -859,7 +859,7 @@ void SIPEndpoint::removeDefaultSessionCookies(const AsteriskSCF::SessionCommunic
                 (*i)));
     }
 
-    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(items);
+    mImplPriv->mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(Operations::createContext(), items);
 }
 
 void SIPEndpoint::removeDefaultSessionCookies(
diff --git a/src/SIPStateReplicator.h b/src/SIPStateReplicator.h
index 833dd82..b86a5bb 100644
--- a/src/SIPStateReplicator.h
+++ b/src/SIPStateReplicator.h
@@ -49,9 +49,15 @@ public:
             const PJSIPManagerPtr& manager,
             const Ice::ObjectAdapterPtr& globalAdapter,
             const SIPReplicationContextPtr& replicationContext);
-    void stateRemoved(const Ice::StringSeq&, const Ice::Current&);
-    void stateRemovedForItems(const AsteriskSCF::Replication::SIPSessionManager::V1::SIPStateItemSeq&, const Ice::Current&);
-    void stateSet(const AsteriskSCF::Replication::SIPSessionManager::V1::SIPStateItemSeq&, const Ice::Current&);
+    void stateRemoved(
+        const AsteriskSCF::System::V1::OperationContextPtr&,
+        const Ice::StringSeq&, const Ice::Current&);
+    void stateRemovedForItems(
+        const AsteriskSCF::System::V1::OperationContextPtr&,
+        const AsteriskSCF::Replication::SIPSessionManager::V1::SIPStateItemSeq&, const Ice::Current&);
+    void stateSet(
+        const AsteriskSCF::System::V1::OperationContextPtr&,
+        const AsteriskSCF::Replication::SIPSessionManager::V1::SIPStateItemSeq&, const Ice::Current&);
     bool operator==(const SIPStateReplicatorListenerI &rhs);
 private:
     boost::shared_ptr<SIPStateReplicatorListenerImpl> mImpl;
diff --git a/src/SIPStateReplicatorApp.cpp b/src/SIPStateReplicatorApp.cpp
index 7cef615..a05c256 100644
--- a/src/SIPStateReplicatorApp.cpp
+++ b/src/SIPStateReplicatorApp.cpp
@@ -27,13 +27,13 @@
 #include <AsteriskSCF/Logger/IceLogger.h>
 #include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
 #include <AsteriskSCF/System/Component/ConfigurationIf.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 #include <SIPIf.h>
 
 #include "SIPConfigurationIf.h"
 
 using namespace std;
-using namespace AsteriskSCF::Core;
 using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::Replication::SIPSessionManager::V1;
 using namespace AsteriskSCF::Configuration::SIPSessionManager::V1;
@@ -42,6 +42,8 @@ using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::SIPSessionManager;
 using namespace AsteriskSCF::CollocatedIceStorm;
 using namespace AsteriskSCF::System::Configuration::V1;
+using namespace AsteriskSCF::System::V1;
+using namespace AsteriskSCF;
 
 namespace
 {
@@ -69,15 +71,15 @@ private:
     //vector<SIPStateReplicatorListenerPrx> mListeners;
     Ice::ObjectAdapterPtr mAdapter;
     ServiceLocatorManagementPrx mServiceLocatorManagement;
-    Discovery::V1::ServiceManagementPrx mComponentServiceManagement;
-    Discovery::V1::ServiceManagementPrx mStateReplicationManagement;
+    ServiceManagementPrx mComponentServiceManagement;
+    ServiceManagementPrx mStateReplicationManagement;
     ConfiguredIceLoggerPtr mIceLogger;
     ComponentServicePtr mComponentService;
     SIPStateReplicatorIPtr mStateReplicator;
     ConfigurationReplicatorPtr mConfigurationReplicator;
     CollocatedIceStormPtr mIceStorm;
     Ice::ObjectPrx mConfigurationPublisher;
-    Discovery::V1::ServiceManagementPrx mConfigurationManagement;
+    ServiceManagementPrx mConfigurationManagement;
     std::string mConfigCompareGuid;
 };
 
@@ -94,17 +96,17 @@ public:
     ComponentServiceImpl(SIPStateReplicatorService &service) : mService(service) {}
 
 public: // Overrides of the ComponentService interface.
-    virtual void suspend(const ::Ice::Current& = ::Ice::Current())
+    virtual void suspend(const OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
 
-    virtual void resume(const ::Ice::Current& = ::Ice::Current())
+    virtual void resume(const OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
 
-    virtual void shutdown(const ::Ice::Current& = ::Ice::Current())
+    virtual void shutdown(const OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
@@ -117,12 +119,16 @@ class ConfigurationReplicatorI : public ConfigurationReplicator
 {
 public:
     ConfigurationReplicatorI(const IceStorm::TopicPrx& topic) : mConfigurationReplicationTopic(topic) { };
-    void registerConfigurationService(const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx&, const Ice::Current&);
+    void registerConfigurationService(
+        const OperationContextPtr&, 
+        const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx&, const Ice::Current&);
 private:
     IceStorm::TopicPrx mConfigurationReplicationTopic;
 };
 
-void ConfigurationReplicatorI::registerConfigurationService(const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx& service, const Ice::Current&)
+void ConfigurationReplicatorI::registerConfigurationService(
+    const OperationContextPtr&, 
+    const AsteriskSCF::System::Configuration::V1::ConfigurationServicePrx& service, const Ice::Current&)
 {
     if (mConfigurationReplicationTopic)
     {
@@ -169,31 +175,31 @@ void SIPStateReplicatorService::registerWithServiceLocator(const Ice::Communicat
         // The GUID passed in to add service needs to be unique for reporting.
         string componentServiceGuid(StateReplicatorComponentCategory);
         mComponentServiceManagement = ServiceManagementPrx::uncheckedCast(
-            mServiceLocatorManagement->addService(componentServicePrx, componentServiceGuid));
+            mServiceLocatorManagement->addService(Operations::createContext(), componentServicePrx, componentServiceGuid));
 
         // Add category as a parameter to enable other components look this component up.
         ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
         genericparams->category = StateReplicatorComponentCategory;
 
-        mComponentServiceManagement->addLocatorParams(genericparams, "");
+        mComponentServiceManagement->addLocatorParams(Operations::createContext(), genericparams, "");
 
         Ice::ObjectPrx stateReplicatorObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ServiceDiscoveryId));
         SIPStateReplicatorPrx stateReplicatorPrx = SIPStateReplicatorPrx::checkedCast(stateReplicatorObjectPrx);
 
         string stateReplicationGuid(StateReplicatorDiscoveryCategory);
         mStateReplicationManagement = ServiceManagementPrx::uncheckedCast(
-            mServiceLocatorManagement->addService(stateReplicatorPrx, stateReplicationGuid));
+            mServiceLocatorManagement->addService(Operations::createContext(), stateReplicatorPrx, stateReplicationGuid));
 
         ServiceLocatorParamsPtr discoveryParams = new ServiceLocatorParams();
         discoveryParams->category = StateReplicatorDiscoveryCategory;
         discoveryParams->service = ic->getProperties()->getPropertyWithDefault(mAppName + ".ServiceName", 
             "default");
         discoveryParams->id = ic->getProperties()->getPropertyWithDefault(mAppName + ".Name", "default");
-        mStateReplicationManagement->addLocatorParams(discoveryParams, "");
+        mStateReplicationManagement->addLocatorParams(Operations::createContext(), discoveryParams, "");
 
         // Publish the configuration service IceStorm topic so everybody gets configuration
         mConfigurationManagement = ServiceManagementPrx::uncheckedCast(
-            mServiceLocatorManagement->addService(mConfigurationPublisher, ""));
+            mServiceLocatorManagement->addService(Operations::createContext(), mConfigurationPublisher, ""));
 
         // Populate the configuration parameters with details so we can be found
         ServiceLocatorParamsPtr configurationParams = new ServiceLocatorParams();
@@ -201,7 +207,7 @@ void SIPStateReplicatorService::registerWithServiceLocator(const Ice::Communicat
         configurationParams->service = ic->getProperties()->getPropertyWithDefault(mAppName + ".ServiceName", 
             "default");
         configurationParams->id = ic->getProperties()->getPropertyWithDefault(mAppName + ".Name", "");
-        mConfigurationManagement->addLocatorParams(configurationParams, "");
+        mConfigurationManagement->addLocatorParams(Operations::createContext(), configurationParams, "");
 
         // TBD... We may have other interfaces to publish to the Service Locator.
     }
@@ -220,9 +226,9 @@ void SIPStateReplicatorService::deregisterFromServiceLocator()
 {
     try
     {
-        mComponentServiceManagement->unregister();
-	mConfigurationManagement->unregister();
-	mServiceLocatorManagement->removeCompare(mConfigCompareGuid);
+        mComponentServiceManagement->unregister(Operations::createContext());
+	mConfigurationManagement->unregister(Operations::createContext());
+	mServiceLocatorManagement->removeCompare(Operations::createContext(), mConfigCompareGuid);
     }
     catch(...)
     {
@@ -232,7 +238,7 @@ void SIPStateReplicatorService::deregisterFromServiceLocator()
 
 void SIPStateReplicatorService::initialize(const std::string& appName, const Ice::CommunicatorPtr& ic)
 {
-    mIceStorm = new CollocatedIceStorm(appName, ic->getProperties());
+    mIceStorm = new AsteriskSCF::CollocatedIceStorm::CollocatedIceStorm(appName, ic->getProperties());
     IceStorm::TopicManagerPrx topicManager = mIceStorm->createTopicManagerProxy(ic);
 
     IceStorm::TopicPrx topic;
diff --git a/src/SIPStateReplicatorListener.cpp b/src/SIPStateReplicatorListener.cpp
index 97a1f48..519587e 100644
--- a/src/SIPStateReplicatorListener.cpp
+++ b/src/SIPStateReplicatorListener.cpp
@@ -36,6 +36,7 @@ namespace SIPSessionManager
 
 using namespace AsteriskSCF::SIP::Registration::V1;
 using namespace AsteriskSCF::Replication::SIPSessionManager::V1;
+using namespace AsteriskSCF::System::V1;
 
 class SIPStateReplicatorItem
 {
@@ -590,17 +591,23 @@ SIPStateReplicatorListenerI::SIPStateReplicatorListenerI(
 {
 }
 
-void SIPStateReplicatorListenerI::stateRemovedForItems(const SIPStateItemSeq& items, const Ice::Current&)
+void SIPStateReplicatorListenerI::stateRemovedForItems(
+    const OperationContextPtr&, 
+    const SIPStateItemSeq& items, const Ice::Current&)
 {
     mImpl->removeStateForItemsNoticeImpl(items);
 }
 
-void SIPStateReplicatorListenerI::stateRemoved(const Ice::StringSeq& itemKeys, const Ice::Current&)
+void SIPStateReplicatorListenerI::stateRemoved(
+    const OperationContextPtr&, 
+    const Ice::StringSeq& itemKeys, const Ice::Current&)
 {
     mImpl->removeStateNoticeImpl(itemKeys);
 }
 
-void SIPStateReplicatorListenerI::stateSet(const SIPStateItemSeq& items, const Ice::Current&)
+void SIPStateReplicatorListenerI::stateSet(
+    const OperationContextPtr&, 
+    const SIPStateItemSeq& items, const Ice::Current&)
 {
     mImpl->setStateNoticeImpl(items);
 }
diff --git a/src/SIPTransfer.cpp b/src/SIPTransfer.cpp
index c23020f..d5cd149 100644
--- a/src/SIPTransfer.cpp
+++ b/src/SIPTransfer.cpp
@@ -27,6 +27,7 @@
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::System::V1;
 using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
+using namespace AsteriskSCF::Operations;
 
 namespace
 {
@@ -238,7 +239,7 @@ void TransferListener::setState()
 
     try
     {
-        mReplicationContext->getReplicator().tryOneWay()->setState(seq);
+        mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), seq);
     }
     catch (const Ice::Exception& ex)
     {
@@ -258,7 +259,7 @@ void TransferListener::removeState()
 
     try
     {
-        mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(seq);
+        mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(Operations::createContext(), seq);
     }
     catch (const Ice::Exception& ex)
     {
@@ -369,7 +370,7 @@ void TransferSessionCreationHook::setState()
 
     try
     {
-        mReplicationContext->getReplicator().tryOneWay()->setState(seq);
+        mReplicationContext->getReplicator().tryOneWay()->setState(Operations::createContext(), seq);
     }
     catch (const Ice::Exception& ex)
     {
@@ -388,7 +389,7 @@ void TransferSessionCreationHook::removeState()
 
     try
     {
-        mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(seq);
+        mReplicationContext->getReplicator().tryOneWay()->removeStateForItems(Operations::createContext(), seq);
     }
     catch (const Ice::Exception& ex)
     {

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list