From 7e0fa1ce134fc52f4f27ef17ee3396d1099f81cf Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 14 Sep 2012 10:52:57 +0200 Subject: [PATCH] Renamed component: cibsync -> replication --- components/Makefile.am | 4 +- .../{cibsync => replication}/Makefile.am | 16 +++---- .../i2-replication.h} | 12 ++--- .../replication.filters} | 8 ++-- .../replication.vcxproj} | 10 ++--- .../replicationcomponent.cpp} | 44 +++++++++---------- .../replicationcomponent.h} | 4 +- configure.ac | 2 +- icinga-app/Makefile.am | 4 +- icinga.sln | 2 +- 10 files changed, 53 insertions(+), 53 deletions(-) rename components/{cibsync => replication}/Makefile.am (72%) rename components/{cibsync/i2-cibsync.h => replication/i2-replication.h} (87%) rename components/{cibsync/cibsync.vcxproj.filters => replication/replication.filters} (83%) rename components/{cibsync/cibsync.vcxproj => replication/replication.vcxproj} (95%) rename components/{cibsync/cibsynccomponent.cpp => replication/replicationcomponent.cpp} (75%) rename components/{cibsync/cibsynccomponent.h => replication/replicationcomponent.h} (97%) diff --git a/components/Makefile.am b/components/Makefile.am index 7b1c745fb..16f0cc366 100644 --- a/components/Makefile.am +++ b/components/Makefile.am @@ -3,8 +3,8 @@ SUBDIRS = \ checker \ - cibsync \ compat \ convenience \ delegation \ - demo + demo \ + replication diff --git a/components/cibsync/Makefile.am b/components/replication/Makefile.am similarity index 72% rename from components/cibsync/Makefile.am rename to components/replication/Makefile.am index d9bfb2b4c..83c09fbae 100644 --- a/components/cibsync/Makefile.am +++ b/components/replication/Makefile.am @@ -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 \ diff --git a/components/cibsync/i2-cibsync.h b/components/replication/i2-replication.h similarity index 87% rename from components/cibsync/i2-cibsync.h rename to components/replication/i2-replication.h index 937290f0b..cefae32d5 100644 --- a/components/cibsync/i2-cibsync.h +++ b/components/replication/i2-replication.h @@ -17,19 +17,19 @@ * 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 #include #include -#include "cibsynccomponent.h" +#include "replicationcomponent.h" -#endif /* I2CIBSYNC_H */ +#endif /* I2REPLICATION_H */ diff --git a/components/cibsync/cibsync.vcxproj.filters b/components/replication/replication.filters similarity index 83% rename from components/cibsync/cibsync.vcxproj.filters rename to components/replication/replication.filters index d7a2dc912..411118f9e 100644 --- a/components/cibsync/cibsync.vcxproj.filters +++ b/components/replication/replication.filters @@ -11,16 +11,16 @@ - + Headerdateien - + Headerdateien - + Quelldateien - \ No newline at end of file + diff --git a/components/cibsync/cibsync.vcxproj b/components/replication/replication.vcxproj similarity index 95% rename from components/cibsync/cibsync.vcxproj rename to components/replication/replication.vcxproj index 763ad2cbd..7f021b74d 100644 --- a/components/cibsync/cibsync.vcxproj +++ b/components/replication/replication.vcxproj @@ -13,7 +13,7 @@ {704DDD8E-9E6D-4C22-80BD-6DE10F3A5E1C} Win32Proj - cibsync + replication @@ -78,13 +78,13 @@ - - + + - + - \ No newline at end of file + diff --git a/components/cibsync/cibsynccomponent.cpp b/components/replication/replicationcomponent.cpp similarity index 75% rename from components/cibsync/cibsynccomponent.cpp rename to components/replication/replicationcomponent.cpp index ed66ef43e..c17fc1dd8 100644 --- a/components/cibsync/cibsynccomponent.cpp +++ b/components/replication/replicationcomponent.cpp @@ -17,42 +17,42 @@ * 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(¶ms)) @@ -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& modifiedObjects) +void ReplicationComponent::TransactionClosingHandler(const set& 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& } } -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(¶ms)) @@ -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(¶ms)) @@ -230,4 +230,4 @@ void CIBSyncComponent::RemoteObjectRemovedHandler(const RequestMessage& request) } } -EXPORT_COMPONENT(cibsync, CIBSyncComponent); +EXPORT_COMPONENT(replication, ReplicationComponent); diff --git a/components/cibsync/cibsynccomponent.h b/components/replication/replicationcomponent.h similarity index 97% rename from components/cibsync/cibsynccomponent.h rename to components/replication/replicationcomponent.h index 89fae5513..8b8dfc30d 100644 --- a/components/cibsync/cibsynccomponent.h +++ b/components/replication/replicationcomponent.h @@ -24,9 +24,9 @@ namespace icinga { /** - * @ingroup cibsync + * @ingroup replication */ -class CIBSyncComponent : public IComponent +class ReplicationComponent : public IComponent { public: virtual void Start(void); diff --git a/configure.ac b/configure.ac index 4d5f6b242..2cf92a89d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/icinga-app/Makefile.am b/icinga-app/Makefile.am index 2e148587a..1ee49a069 100644 --- a/icinga-app/Makefile.am +++ b/icinga-app/Makefile.am @@ -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 diff --git a/icinga.sln b/icinga.sln index 95c6df517..8f476609e 100644 --- a/icinga.sln +++ b/icinga.sln @@ -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