]> granicus.if.org Git - icinga2/commitdiff
Renamed component: cibsync -> replication
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Sep 2012 08:52:57 +0000 (10:52 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Sep 2012 08:52:57 +0000 (10:52 +0200)
components/Makefile.am
components/replication/Makefile.am [moved from components/cibsync/Makefile.am with 72% similarity]
components/replication/i2-replication.h [moved from components/cibsync/i2-cibsync.h with 87% similarity]
components/replication/replication.filters [moved from components/cibsync/cibsync.vcxproj.filters with 83% similarity]
components/replication/replication.vcxproj [moved from components/cibsync/cibsync.vcxproj with 95% similarity]
components/replication/replicationcomponent.cpp [moved from components/cibsync/cibsynccomponent.cpp with 75% similarity]
components/replication/replicationcomponent.h [moved from components/cibsync/cibsynccomponent.h with 97% similarity]
configure.ac
icinga-app/Makefile.am
icinga.sln

index 7b1c745fb21ab986bea2b35a50a44e3b47ba77d6..16f0cc366897e16422cfb7d6537edf9d02d71dbb 100644 (file)
@@ -3,8 +3,8 @@
 
 SUBDIRS = \
        checker \
-       cibsync \
        compat \
        convenience \
        delegation \
-       demo
+       demo \
+       replication
similarity index 72%
rename from components/cibsync/Makefile.am
rename to components/replication/Makefile.am
index d9bfb2b4c933b1346199880f4e94aed65ee79bf8..83c09fbaeb924a496b6df93e00c3af1e12ab58e8 100644 (file)
@@ -1,28 +1,28 @@
 ## Process this file with automake to produce Makefile.in
 
 pkglib_LTLIBRARIES = \
-       cibsync.la
+       replication.la
 
-cibsync_la_SOURCES = \
-       cibsynccomponent.cpp \
-       cibsynccomponent.h \
-       i2-cibsync.h
+replication_la_SOURCES = \
+       replicationcomponent.cpp \
+       replicationcomponent.h \
+       i2-replication.h
 
-cibsync_la_CPPFLAGS = \
+replication_la_CPPFLAGS = \
        $(BOOST_CPPFLAGS) \
        -I${top_srcdir}/lib/base \
        -I${top_srcdir}/lib/config \
        -I${top_srcdir}/lib/remoting \
        -I${top_srcdir}/lib/icinga
 
-cibsync_la_LDFLAGS = \
+replication_la_LDFLAGS = \
        $(BOOST_LDFLAGS) \
        -module \
        -no-undefined \
        @RELEASE_INFO@ \
        @VERSION_INFO@
 
-cibsync_la_LIBADD = \
+replication_la_LIBADD = \
        $(BOOST_SIGNALS_LIB) \
        $(BOOST_THREAD_LIB) \
        ${top_builddir}/lib/base/libbase.la \
similarity index 87%
rename from components/cibsync/i2-cibsync.h
rename to components/replication/i2-replication.h
index 937290f0b69893d3b7261d9d34b111277334dace..cefae32d50468f4ba6e76fa606e8453fd9b6e926 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#ifndef I2CIBSYNC_H
-#define I2CIBSYNC_H
+#ifndef I2REPLICATION_H
+#define I2REPLICATION_H
 
 /**
- * @defgroup cibsync CIB synchronisation component
+ * @defgroup replication Replication component
  *
- * Collects update messages to synchronize the local CIB.
+ * Replicates Icinga 2 objects to remote instances.
  */
 
 #include <i2-base.h>
 #include <i2-remoting.h>
 #include <i2-icinga.h>
 
-#include "cibsynccomponent.h"
+#include "replicationcomponent.h"
 
-#endif /* I2CIBSYNC_H */
+#endif /* I2REPLICATION_H */
similarity index 83%
rename from components/cibsync/cibsync.vcxproj.filters
rename to components/replication/replication.filters
index d7a2dc912333eb5bf5bd4aa3385b96ef8e4f5bb1..411118f9ea8d760dc2900ce06d546c95ed7c2d63 100644 (file)
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="cibsynccomponent.h">
+    <ClInclude Include="replicationcomponent.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
-    <ClInclude Include="i2-cibsync.h">
+    <ClInclude Include="i2-replication.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="cibsynccomponent.cpp">
+    <ClCompile Include="replicationcomponent.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
similarity index 95%
rename from components/cibsync/cibsync.vcxproj
rename to components/replication/replication.vcxproj
index 763ad2cbd1faaa9960e5bac72886870a49acdcd4..7f021b74daf75f4fed006cdca6247a3236564388 100644 (file)
@@ -13,7 +13,7 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{704DDD8E-9E6D-4C22-80BD-6DE10F3A5E1C}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
-    <RootNamespace>cibsync</RootNamespace>
+    <RootNamespace>replication</RootNamespace>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClInclude Include="cibsynccomponent.h" />
-    <ClInclude Include="i2-cibsync.h" />
+    <ClInclude Include="replicationcomponent.h" />
+    <ClInclude Include="i2-replication.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="cibsynccomponent.cpp" />
+    <ClCompile Include="replicationcomponent.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
similarity index 75%
rename from components/cibsync/cibsynccomponent.cpp
rename to components/replication/replicationcomponent.cpp
index ed66ef43e5f333a4afe68370351ab76dbedb6ea4..c17fc1dd8fc0697121335a5e5656f8a12f910408 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "i2-cibsync.h"
+#include "i2-replication.h"
 
 using namespace icinga;
 
 /**
  * Starts the component.
  */
-void CIBSyncComponent::Start(void)
+void ReplicationComponent::Start(void)
 {
-       m_Endpoint = Endpoint::MakeEndpoint("cibsync", true);
+       m_Endpoint = Endpoint::MakeEndpoint("replication", true);
 
-       DynamicObject::OnRegistered.connect(boost::bind(&CIBSyncComponent::LocalObjectRegisteredHandler, this, _1));
-       DynamicObject::OnUnregistered.connect(boost::bind(&CIBSyncComponent::LocalObjectUnregisteredHandler, this, _1));
-       DynamicObject::OnTransactionClosing.connect(boost::bind(&CIBSyncComponent::TransactionClosingHandler, this, _1));
+       DynamicObject::OnRegistered.connect(boost::bind(&ReplicationComponent::LocalObjectRegisteredHandler, this, _1));
+       DynamicObject::OnUnregistered.connect(boost::bind(&ReplicationComponent::LocalObjectUnregisteredHandler, this, _1));
+       DynamicObject::OnTransactionClosing.connect(boost::bind(&ReplicationComponent::TransactionClosingHandler, this, _1));
 
-       Endpoint::OnConnected.connect(boost::bind(&CIBSyncComponent::EndpointConnectedHandler, this, _1));
+       Endpoint::OnConnected.connect(boost::bind(&ReplicationComponent::EndpointConnectedHandler, this, _1));
        
        m_Endpoint->RegisterTopicHandler("config::ObjectUpdate",
-           boost::bind(&CIBSyncComponent::RemoteObjectUpdateHandler, this, _2, _3));
+           boost::bind(&ReplicationComponent::RemoteObjectUpdateHandler, this, _2, _3));
        m_Endpoint->RegisterTopicHandler("config::ObjectRemoved",
-           boost::bind(&CIBSyncComponent::RemoteObjectRemovedHandler, this, _3));
+           boost::bind(&ReplicationComponent::RemoteObjectRemovedHandler, this, _3));
 
        /* service status */
        m_Endpoint->RegisterTopicHandler("checker::ServiceStateChange",
-           boost::bind(&CIBSyncComponent::ServiceStateChangeRequestHandler, _2, _3));
+           boost::bind(&ReplicationComponent::ServiceStateChangeRequestHandler, _2, _3));
 }
 
 /**
  * Stops the component.
  */
-void CIBSyncComponent::Stop(void)
+void ReplicationComponent::Stop(void)
 {
        m_Endpoint->Unregister();
 }
 
-void CIBSyncComponent::ServiceStateChangeRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request)
+void ReplicationComponent::ServiceStateChangeRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request)
 {
        ServiceStateChangeMessage params;
        if (!request.GetParams(&params))
@@ -75,7 +75,7 @@ void CIBSyncComponent::ServiceStateChangeRequestHandler(const Endpoint::Ptr& sen
        CIB::UpdateTaskStatistics(now, 1);
 }
 
-void CIBSyncComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint)
+void ReplicationComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint)
 {
        /* no need to sync the config with local endpoints */
        if (endpoint->IsLocalEndpoint())
@@ -99,7 +99,7 @@ void CIBSyncComponent::EndpointConnectedHandler(const Endpoint::Ptr& endpoint)
        }
 }
 
-RequestMessage CIBSyncComponent::MakeObjectMessage(const DynamicObject::Ptr& object, const String& method, double sinceTx, bool includeProperties)
+RequestMessage ReplicationComponent::MakeObjectMessage(const DynamicObject::Ptr& object, const String& method, double sinceTx, bool includeProperties)
 {
        RequestMessage msg;
        msg.SetMethod(method);
@@ -116,12 +116,12 @@ RequestMessage CIBSyncComponent::MakeObjectMessage(const DynamicObject::Ptr& obj
        return msg;
 }
 
-bool CIBSyncComponent::ShouldReplicateObject(const DynamicObject::Ptr& object)
+bool ReplicationComponent::ShouldReplicateObject(const DynamicObject::Ptr& object)
 {
        return (!object->IsLocal());
 }
 
-void CIBSyncComponent::LocalObjectRegisteredHandler(const DynamicObject::Ptr& object)
+void ReplicationComponent::LocalObjectRegisteredHandler(const DynamicObject::Ptr& object)
 {
        if (!ShouldReplicateObject(object))
                return;
@@ -130,7 +130,7 @@ void CIBSyncComponent::LocalObjectRegisteredHandler(const DynamicObject::Ptr& ob
            MakeObjectMessage(object, "config::ObjectUpdate", 0, true));
 }
 
-void CIBSyncComponent::LocalObjectUnregisteredHandler(const DynamicObject::Ptr& object)
+void ReplicationComponent::LocalObjectUnregisteredHandler(const DynamicObject::Ptr& object)
 {
        if (!ShouldReplicateObject(object))
                return;
@@ -139,14 +139,14 @@ void CIBSyncComponent::LocalObjectUnregisteredHandler(const DynamicObject::Ptr&
            MakeObjectMessage(object, "config::ObjectRemoved", 0, false));
 }
 
-void CIBSyncComponent::TransactionClosingHandler(const set<DynamicObject::Ptr>& modifiedObjects)
+void ReplicationComponent::TransactionClosingHandler(const set<DynamicObject::Ptr>& modifiedObjects)
 {
        if (modifiedObjects.empty())
                return;
 
        stringstream msgbuf;
        msgbuf << "Sending " << modifiedObjects.size() << " replication updates.";
-       Logger::Write(LogDebug, "cibsync", msgbuf.str());
+       Logger::Write(LogDebug, "replication", msgbuf.str());
 
        BOOST_FOREACH(const DynamicObject::Ptr& object, modifiedObjects) {
                if (!ShouldReplicateObject(object))
@@ -157,7 +157,7 @@ void CIBSyncComponent::TransactionClosingHandler(const set<DynamicObject::Ptr>&
        }
 }
 
-void CIBSyncComponent::RemoteObjectUpdateHandler(const Endpoint::Ptr& sender, const RequestMessage& request)
+void ReplicationComponent::RemoteObjectUpdateHandler(const Endpoint::Ptr& sender, const RequestMessage& request)
 {
        MessagePart params;
        if (!request.GetParams(&params))
@@ -206,7 +206,7 @@ void CIBSyncComponent::RemoteObjectUpdateHandler(const Endpoint::Ptr& sender, co
        }
 }
 
-void CIBSyncComponent::RemoteObjectRemovedHandler(const RequestMessage& request)
+void ReplicationComponent::RemoteObjectRemovedHandler(const RequestMessage& request)
 {
        MessagePart params;
        if (!request.GetParams(&params))
@@ -230,4 +230,4 @@ void CIBSyncComponent::RemoteObjectRemovedHandler(const RequestMessage& request)
        }
 }
 
-EXPORT_COMPONENT(cibsync, CIBSyncComponent);
+EXPORT_COMPONENT(replication, ReplicationComponent);
similarity index 97%
rename from components/cibsync/cibsynccomponent.h
rename to components/replication/replicationcomponent.h
index 89fae5513ec4c4f87a2f3e82d1e5f92f1a0f3fc2..8b8dfc30dec60486dc5b3f12f361008468efbe47 100644 (file)
@@ -24,9 +24,9 @@ namespace icinga
 {
 
 /**
- * @ingroup cibsync
+ * @ingroup replication
  */
-class CIBSyncComponent : public IComponent
+class ReplicationComponent : public IComponent
 {
 public:
        virtual void Start(void);
index 4d5f6b24250cca046ad9c3a3e72cea8e488b501f..2cf92a89d911116e99125d597179786b87d7d0b1 100644 (file)
@@ -69,11 +69,11 @@ AC_CONFIG_FILES([
 Makefile
 components/Makefile
 components/checker/Makefile
-components/cibsync/Makefile
 components/compat/Makefile
 components/convenience/Makefile
 components/delegation/Makefile
 components/demo/Makefile
+components/replication/Makefile
 docs/Doxyfile
 icinga-app/Makefile
 lib/Makefile
index 2e148587a69a073d55834b2a4719bf24108273a0..1ee49a0692ab4b9efa98f357d521b74e4235aee0 100644 (file)
@@ -30,12 +30,12 @@ icinga_LDADD = \
        ${top_builddir}/lib/remoting/libremoting.la \
        ${top_builddir}/lib/icinga/libicinga.la \
        -dlopen ${top_builddir}/components/checker/checker.la \
-       -dlopen ${top_builddir}/components/cibsync/cibsync.la \
+       -dlopen ${top_builddir}/components/replication/replication.la \
        -dlopen ${top_builddir}/components/compat/compat.la \
        -dlopen ${top_builddir}/components/convenience/convenience.la \
        -dlopen ${top_builddir}/components/delegation/delegation.la \
        -dlopen ${top_builddir}/components/demo/demo.la
 
 icinga_DEPENDENCIES = \
-       ${top_builddir}/components/cibsync/cibsync.la \
+       ${top_builddir}/components/replication/replication.la \
        ${top_builddir}/components/convenience/convenience.la
index 95c6df5173311bf41c2eb1770793279841d4f254..8f476609e48eed2e302fc2e53e67fba58329278c 100644 (file)
@@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "delegation", "components\de
                {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}
        EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cibsync", "components\cibsync\cibsync.vcxproj", "{704DDD8E-9E6D-4C22-80BD-6DE10F3A5E1C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "replication", "components\replication\replication.vcxproj", "{704DDD8E-9E6D-4C22-80BD-6DE10F3A5E1C}"
        ProjectSection(ProjectDependencies) = postProject
                {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}
        EndProjectSection