[asterisk-scf-commits] asterisk-scf/integration/logger.git branch "filename" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Mar 14 14:25:44 CDT 2011


branch "filename" has been updated
       via  df11e7299041cb14c0e7e6ae16bacab26684ee4e (commit)
       via  f96891fc9c304d2eb9c9a164a3d6384b711bb268 (commit)
      from  99b842b1a4246af6d9a994dfcd038945af45ba3d (commit)

Summary of changes:
 server/src/Configuration.cpp |   16 ++++++++--------
 server/src/Configuration.h   |    4 ++--
 server/src/LoggingServer.h   |    2 +-
 server/src/main.cpp          |   10 +++++++++-
 4 files changed, 20 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit df11e7299041cb14c0e7e6ae16bacab26684ee4e
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Mar 14 14:24:00 2011 -0500

    Add Configuration service to the object adapter.
    
    I also changed the name of the ConfigurationService to
    LoggerConfigurationService to resolve some ambiguity in
    class names. The compiler could handle it all right, but it
    makes things easier for human eyes.

diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp
index 86f65bd..34685c8 100644
--- a/server/src/Configuration.cpp
+++ b/server/src/Configuration.cpp
@@ -69,10 +69,10 @@ public:
 
 typedef boost::shared_ptr<ConfigurationServiceImpl> ConfigurationServiceImplPtr;
 
-ConfigurationService::ConfigurationService(LoggingServerIPtr server)
+LoggerConfigurationService::LoggerConfigurationService(LoggingServerIPtr server)
     : mImpl(new ConfigurationServiceImpl(server)) { }
 
-ConfigurationGroupSeq ConfigurationService::getConfiguration(const ConfigurationGroupSeq& groups, const Ice::Current&)
+ConfigurationGroupSeq LoggerConfigurationService::getConfiguration(const ConfigurationGroupSeq& groups, const Ice::Current&)
 {
     class visitor : public LoggerConfigurationGroupVisitor
     {
@@ -130,7 +130,7 @@ ConfigurationGroupSeq ConfigurationService::getConfiguration(const Configuration
     return newGroups;
 }
 
-ConfigurationGroupSeq ConfigurationService::getConfigurationAll(const ConfigurationGroupSeq& groups, const Ice::Current&)
+ConfigurationGroupSeq LoggerConfigurationService::getConfigurationAll(const ConfigurationGroupSeq& groups, const Ice::Current&)
 {
     class visitor : public LoggerConfigurationGroupVisitor
     {
@@ -163,7 +163,7 @@ ConfigurationGroupSeq ConfigurationService::getConfigurationAll(const Configurat
     return newGroups;
 }
 
-ConfigurationGroupSeq ConfigurationService::getConfigurationGroups(const Ice::Current&)
+ConfigurationGroupSeq LoggerConfigurationService::getConfigurationGroups(const Ice::Current&)
 {
     ConfigurationGroupSeq groups;
 
@@ -176,7 +176,7 @@ ConfigurationGroupSeq ConfigurationService::getConfigurationGroups(const Ice::Cu
     return groups;
 }
 
-void ConfigurationService::setConfiguration(const ConfigurationGroupSeq& groups, const Ice::Current&)
+void LoggerConfigurationService::setConfiguration(const ConfigurationGroupSeq& groups, const Ice::Current&)
 {
     class GroupsVisitor : public LoggerConfigurationGroupVisitor
     {
@@ -266,7 +266,7 @@ void ConfigurationService::setConfiguration(const ConfigurationGroupSeq& groups,
     }
 }
 
-void ConfigurationService::removeConfigurationItems(const ConfigurationGroupSeq& groups, const Ice::Current&)
+void LoggerConfigurationService::removeConfigurationItems(const ConfigurationGroupSeq& groups, const Ice::Current&)
 {
     class GroupsVisitor : public LoggerConfigurationGroupVisitor
     {
@@ -331,7 +331,7 @@ void ConfigurationService::removeConfigurationItems(const ConfigurationGroupSeq&
     }
 }
 
-void ConfigurationService::removeConfigurationGroups(const ConfigurationGroupSeq& groups, const Ice::Current&)
+void LoggerConfigurationService::removeConfigurationGroups(const ConfigurationGroupSeq& groups, const Ice::Current&)
 {
     class visitor : public LoggerConfigurationGroupVisitor
     {
diff --git a/server/src/Configuration.h b/server/src/Configuration.h
index 3b5b8b6..64125a9 100644
--- a/server/src/Configuration.h
+++ b/server/src/Configuration.h
@@ -42,10 +42,10 @@ class ConfigurationServiceImpl;
 /**
  * Implementation of the configuration service.
  */
-class ConfigurationService : public AsteriskSCF::System::Configuration::V1::ConfigurationService
+class LoggerConfigurationService : public AsteriskSCF::System::Configuration::V1::ConfigurationService
 {
 public:
-    ConfigurationService(LoggingServerIPtr server);
+    LoggerConfigurationService(LoggingServerIPtr server);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfiguration(const AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq&, const Ice::Current&);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfigurationAll(const AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq&, const Ice::Current&);
     AsteriskSCF::System::Configuration::V1::ConfigurationGroupSeq getConfigurationGroups(const Ice::Current&);
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index 9c672b0..5d6f3b0 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -106,7 +106,7 @@ private:
     std::vector<boost::shared_ptr<ChainedLogOut> > mLogsOut;
 };
 
-typedef boost::shared_ptr<LoggingServerI> LoggingServerIPtr;
+typedef IceUtil::Handle<LoggingServerI> LoggingServerIPtr;
 
 } // Logging
 } // System
diff --git a/server/src/main.cpp b/server/src/main.cpp
index 16b29f4..2e5c97a 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -20,17 +20,20 @@
 #include <IceStorm/IceStorm.h>
 
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/System/Component/ConfigurationIf.h>
 
 #include "LoggingServer.h"
-#include "FileChainedLogOut.h"
 #include "OstreamChainedLogOut.h"
+#include "Configuration.h"
 
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::Core::Discovery::V1;
+using namespace AsteriskSCF::System::Configuration::V1;
 
 namespace
 {
 const std::string AdapterName = "AsteriskSCF.LoggingService";
+const std::string ConfigurationServiceId = "LoggerConfigurationService";
 
 class LoggingService : public IceBox::Service
 {
@@ -42,6 +45,7 @@ protected:
 private:
     Ice::ObjectAdapterPtr mAdapter;
     ServiceManagementPrx mServiceManagement;
+    ConfigurationServicePtr mConfigurationService;
 
     void registerWithServiceLocator(const Ice::CommunicatorPtr& communicator,
         const LoggingServerPrx& serverProxy);
@@ -159,6 +163,10 @@ void LoggingService::start(const std::string& name,
 
     LoggingServerPrx serverProxy = LoggingServerPrx::uncheckedCast(
         mAdapter->addWithUUID(server));
+
+    mConfigurationService = new LoggerConfigurationService(server);
+    mAdapter->add(mConfigurationService, communicator->stringToIdentity(ConfigurationServiceId));
+
     mAdapter->activate();
 
     std::cout << serverProxy->ice_toString() << '\n';

commit f96891fc9c304d2eb9c9a164a3d6384b711bb268
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Mar 14 10:51:20 2011 -0500

    Add another reference that was missing.

diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp
index c29a140..86f65bd 100644
--- a/server/src/Configuration.cpp
+++ b/server/src/Configuration.cpp
@@ -187,7 +187,7 @@ void ConfigurationService::setConfiguration(const ConfigurationGroupSeq& groups,
         /**
          * Helper function which performs serial number checking of items
          */
-        void performSerialCheck(const ConfigurationItemDict& changedItems, const ConfigurationGroupPtr localGroup)
+        void performSerialCheck(const ConfigurationItemDict& changedItems, const ConfigurationGroupPtr &localGroup)
         {
             for (ConfigurationItemDict::const_iterator item = changedItems.begin();
                     item != changedItems.end();

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


-- 
asterisk-scf/integration/logger.git



More information about the asterisk-scf-commits mailing list