]> granicus.if.org Git - icinga2/commitdiff
Rename DynamicObject/DynamicType to ConfigObject/ConfigType
authorGunnar Beutner <gunnar@beutner.name>
Sat, 15 Aug 2015 18:28:05 +0000 (20:28 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Sat, 15 Aug 2015 18:40:41 +0000 (20:40 +0200)
fixes #9914

151 files changed:
lib/base/CMakeLists.txt
lib/base/application.cpp
lib/base/application.ti
lib/base/configobject-script.cpp [moved from lib/base/dynamicobject-script.cpp with 81% similarity]
lib/base/configobject.cpp [moved from lib/base/dynamicobject.cpp with 73% similarity]
lib/base/configobject.hpp [moved from lib/base/dynamicobject.hpp with 85% similarity]
lib/base/configobject.ti [moved from lib/base/dynamicobject.ti with 94% similarity]
lib/base/configtype.cpp [moved from lib/base/dynamictype.cpp with 70% similarity]
lib/base/configtype.hpp [moved from lib/base/dynamictype.hpp with 66% similarity]
lib/base/exception.cpp
lib/base/exception.hpp
lib/base/filelogger.cpp
lib/base/logger.cpp
lib/base/logger.ti
lib/base/scriptutils.cpp
lib/base/scriptutils.hpp
lib/base/sysloglogger.cpp
lib/checker/checkercomponent.cpp
lib/checker/checkercomponent.hpp
lib/checker/checkercomponent.ti
lib/cli/objectlistcommand.cpp
lib/cli/repositoryutility.cpp
lib/cli/variablegetcommand.cpp
lib/cli/variablelistcommand.cpp
lib/compat/checkresultreader.cpp
lib/compat/checkresultreader.ti
lib/compat/compatlogger.cpp
lib/compat/compatlogger.ti
lib/compat/externalcommandlistener.cpp
lib/compat/externalcommandlistener.ti
lib/compat/statusdatawriter.cpp
lib/compat/statusdatawriter.ti
lib/config/config_parser.yy
lib/config/configitem.cpp
lib/config/configitem.hpp
lib/config/configitembuilder.cpp
lib/db_ido/commanddbobject.hpp
lib/db_ido/dbconnection.cpp
lib/db_ido/dbconnection.hpp
lib/db_ido/dbconnection.ti
lib/db_ido/dbevents.cpp
lib/db_ido/dbevents.hpp
lib/db_ido/dbobject.cpp
lib/db_ido/dbobject.hpp
lib/db_ido/dbquery.hpp
lib/db_ido/endpointdbobject.cpp
lib/db_ido/endpointdbobject.hpp
lib/db_ido/hostdbobject.hpp
lib/db_ido/hostgroupdbobject.cpp
lib/db_ido/hostgroupdbobject.hpp
lib/db_ido/idochecktask.cpp
lib/db_ido/servicedbobject.cpp
lib/db_ido/servicedbobject.hpp
lib/db_ido/servicegroupdbobject.hpp
lib/db_ido/timeperioddbobject.hpp
lib/db_ido/userdbobject.hpp
lib/db_ido/usergroupdbobject.cpp
lib/db_ido/usergroupdbobject.hpp
lib/db_ido/zonedbobject.hpp
lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp
lib/demo/demo.cpp
lib/demo/demo.ti
lib/icinga/apiactions.cpp
lib/icinga/apiactions.hpp
lib/icinga/apievents.cpp
lib/icinga/checkable-comment.cpp
lib/icinga/checkable-downtime.cpp
lib/icinga/checkable.cpp
lib/icinga/checkcommand.cpp
lib/icinga/cib.cpp
lib/icinga/comment.cpp
lib/icinga/compatutility.cpp
lib/icinga/customvarobject.hpp
lib/icinga/customvarobject.ti
lib/icinga/dependency-apply.cpp
lib/icinga/dependency.cpp
lib/icinga/hostgroup.cpp
lib/icinga/icingaapplication.cpp
lib/icinga/icingastatuswriter.cpp
lib/icinga/icingastatuswriter.ti
lib/icinga/macroprocessor.cpp
lib/icinga/notification-apply.cpp
lib/icinga/notification.cpp
lib/icinga/scheduleddowntime-apply.cpp
lib/icinga/scheduleddowntime.cpp
lib/icinga/service-apply.cpp
lib/icinga/servicegroup.cpp
lib/icinga/timeperiod.cpp
lib/icinga/user.cpp
lib/icinga/usergroup.cpp
lib/livestatus/commandstable.cpp
lib/livestatus/commentstable.cpp
lib/livestatus/contactgroupstable.cpp
lib/livestatus/contactstable.cpp
lib/livestatus/downtimestable.cpp
lib/livestatus/endpointstable.cpp
lib/livestatus/hostgroupstable.cpp
lib/livestatus/hoststable.cpp
lib/livestatus/livestatuslistener.cpp
lib/livestatus/livestatuslistener.ti
lib/livestatus/servicegroupstable.cpp
lib/livestatus/servicestable.cpp
lib/livestatus/statustable.cpp
lib/livestatus/timeperiodstable.cpp
lib/livestatus/zonestable.cpp
lib/methods/clrchecktask.cpp
lib/methods/clusterchecktask.cpp
lib/methods/icingachecktask.cpp
lib/methods/pluginchecktask.cpp
lib/methods/plugineventtask.cpp
lib/notification/notificationcomponent.cpp
lib/notification/notificationcomponent.hpp
lib/notification/notificationcomponent.ti
lib/perfdata/gelfwriter.cpp
lib/perfdata/gelfwriter.hpp
lib/perfdata/gelfwriter.ti
lib/perfdata/graphitewriter.cpp
lib/perfdata/graphitewriter.hpp
lib/perfdata/graphitewriter.ti
lib/perfdata/opentsdbwriter.cpp
lib/perfdata/opentsdbwriter.hpp
lib/perfdata/opentsdbwriter.ti
lib/perfdata/perfdatawriter.cpp
lib/perfdata/perfdatawriter.hpp
lib/perfdata/perfdatawriter.ti
lib/remote/actionshandler.cpp
lib/remote/apiaction.cpp
lib/remote/apiaction.hpp
lib/remote/apilistener-sync.cpp
lib/remote/apilistener.cpp
lib/remote/apilistener.hpp
lib/remote/apilistener.ti
lib/remote/apiuser.cpp
lib/remote/apiuser.ti
lib/remote/authority.cpp
lib/remote/deleteobjecthandler.cpp
lib/remote/endpoint.cpp
lib/remote/endpoint.ti
lib/remote/filterutility.cpp
lib/remote/filterutility.hpp
lib/remote/httpconnection.cpp
lib/remote/jsonrpcconnection-heartbeat.cpp
lib/remote/jsonrpcconnection.cpp
lib/remote/modifyobjecthandler.cpp
lib/remote/statusqueryhandler.cpp
lib/remote/zone.cpp
lib/remote/zone.hpp
lib/remote/zone.ti
test/base-type.cpp
tools/mkclass/classcompiler.cpp

index 6fcd8a99b60fd43298f28a540b7f57be107f3044..853068f47e48c2da98ce0c6c1ecd84dfc2fff4f7 100644 (file)
@@ -16,7 +16,7 @@
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 mkclass_target(application.ti application.tcpp application.thpp)
-mkclass_target(dynamicobject.ti dynamicobject.tcpp dynamicobject.thpp)
+mkclass_target(configobject.ti configobject.tcpp configobject.thpp)
 mkclass_target(filelogger.ti filelogger.tcpp filelogger.thpp)
 mkclass_target(logger.ti logger.tcpp logger.thpp)
 mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp)
@@ -26,7 +26,7 @@ set(base_SOURCES
   application.cpp application.thpp application-version.cpp array.cpp
   array-script.cpp boolean.cpp boolean-script.cpp console.cpp context.cpp
   convert.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp
-  dynamicobject.cpp dynamicobject.thpp dynamicobject-script.cpp dynamictype.cpp
+  configobject.cpp configobject.thpp configobject-script.cpp configtype.cpp
   exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp
   json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp
   netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp
index 9a42f6989e387e03e53dbe48a453bcb1fce07044..a11e722a7c77e3932a10bde8e2aba818d3483077 100644 (file)
@@ -102,7 +102,7 @@ void Application::Stop(void)
        } else
                ClosePidFile(true);
 
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 }
 
 Application::~Application(void)
@@ -318,7 +318,7 @@ mainloop:
 
        Log(LogInformation, "Application", "Shutting down...");
 
-       DynamicObject::StopObjects();
+       ConfigObject::StopObjects();
        Application::GetInstance()->OnShutdown();
 
        UninitializeBase();
index f22ea6694bc90dc123cd0521c12967a9f167914f..1911582789eaf9995d9e590a54739c137a5b5c01 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library base;
 
 namespace icinga
 {
 
-abstract class Application : DynamicObject
+abstract class Application : ConfigObject
 {
 };
 
similarity index 81%
rename from lib/base/dynamicobject-script.cpp
rename to lib/base/configobject-script.cpp
index 514359c8db78782874698865d67155de9293f3c9..bf112e33f7861947dbb2c2987cd9b7d850e53ce3 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/dictionary.hpp"
 #include "base/function.hpp"
 #include "base/functionwrapper.hpp"
 
 using namespace icinga;
 
-static void DynamicObjectModifyAttribute(const String& attr, const Value& value)
+static void ConfigObjectModifyAttribute(const String& attr, const Value& value)
 {
        ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
-       DynamicObject::Ptr self = vframe->Self;
+       ConfigObject::Ptr self = vframe->Self;
        return self->ModifyAttribute(attr, value);
 }
 
-static void DynamicObjectRestoreAttribute(const String& attr)
+static void ConfigObjectRestoreAttribute(const String& attr)
 {
        ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
-       DynamicObject::Ptr self = vframe->Self;
+       ConfigObject::Ptr self = vframe->Self;
        return self->RestoreAttribute(attr);
 }
 
-Object::Ptr DynamicObject::GetPrototype(void)
+Object::Ptr ConfigObject::GetPrototype(void)
 {
        static Dictionary::Ptr prototype;
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("modify_attribute", new Function(WrapFunction(DynamicObjectModifyAttribute), false));
-               prototype->Set("restore_attribute", new Function(WrapFunction(DynamicObjectRestoreAttribute), false));
+               prototype->Set("modify_attribute", new Function(WrapFunction(ConfigObjectModifyAttribute), false));
+               prototype->Set("restore_attribute", new Function(WrapFunction(ConfigObjectRestoreAttribute), false));
        }
 
        return prototype;
similarity index 73%
rename from lib/base/dynamicobject.cpp
rename to lib/base/configobject.cpp
index 91175af36fd0d1590e11c5de6a710cee769a816a..16f8f3341a057e244773dc93e623ee6771933420 100644 (file)
@@ -17,9 +17,9 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
-#include "base/dynamicobject.tcpp"
-#include "base/dynamictype.hpp"
+#include "base/configobject.hpp"
+#include "base/configobject.tcpp"
+#include "base/configtype.hpp"
 #include "base/serializer.hpp"
 #include "base/netstring.hpp"
 #include "base/json.hpp"
 
 using namespace icinga;
 
-REGISTER_TYPE_WITH_PROTOTYPE(DynamicObject, DynamicObject::GetPrototype());
+REGISTER_TYPE_WITH_PROTOTYPE(ConfigObject, ConfigObject::GetPrototype());
 
-boost::signals2::signal<void (const DynamicObject::Ptr&)> DynamicObject::OnStateChanged;
+boost::signals2::signal<void (const ConfigObject::Ptr&)> ConfigObject::OnStateChanged;
 
-DynamicObject::DynamicObject(void)
+ConfigObject::ConfigObject(void)
 { }
 
-DynamicType::Ptr DynamicObject::GetType(void) const
+ConfigType::Ptr ConfigObject::GetType(void) const
 {
-       return DynamicType::GetByName(GetTypeNameV());
+       return ConfigType::GetByName(GetTypeNameV());
 }
 
-bool DynamicObject::IsActive(void) const
+bool ConfigObject::IsActive(void) const
 {
        return GetActive();
 }
 
-bool DynamicObject::IsPaused(void) const
+bool ConfigObject::IsPaused(void) const
 {
        return GetPaused();
 }
 
-void DynamicObject::SetExtension(const String& key, const Value& value)
+void ConfigObject::SetExtension(const String& key, const Value& value)
 {
        Dictionary::Ptr extensions = GetExtensions();
 
@@ -76,7 +76,7 @@ void DynamicObject::SetExtension(const String& key, const Value& value)
        extensions->Set(key, value);
 }
 
-Value DynamicObject::GetExtension(const String& key)
+Value ConfigObject::GetExtension(const String& key)
 {
        Dictionary::Ptr extensions = GetExtensions();
 
@@ -86,7 +86,7 @@ Value DynamicObject::GetExtension(const String& key)
        return extensions->Get(key);
 }
 
-void DynamicObject::ClearExtension(const String& key)
+void ConfigObject::ClearExtension(const String& key)
 {
        Dictionary::Ptr extensions = GetExtensions();
 
@@ -101,7 +101,7 @@ class ModAttrValidationUtils : public ValidationUtils
 public:
        virtual bool ValidateName(const String& type, const String& name) const override
        {
-               DynamicType::Ptr dtype = DynamicType::GetByName(type);
+               ConfigType::Ptr dtype = ConfigType::GetByName(type);
 
                if (!dtype)
                        return false;
@@ -113,7 +113,7 @@ public:
        }
 };
 
-void DynamicObject::ModifyAttribute(const String& attr, const Value& value)
+void ConfigObject::ModifyAttribute(const String& attr, const Value& value)
 {
        Dictionary::Ptr original_attributes = GetOriginalAttributes();
        bool updated_original_attributes = false;
@@ -146,7 +146,7 @@ void DynamicObject::ModifyAttribute(const String& attr, const Value& value)
                NotifyOriginalAttributes();
 }
 
-void DynamicObject::RestoreAttribute(const String& attr)
+void ConfigObject::RestoreAttribute(const String& attr)
 {
        Dictionary::Ptr original_attributes = GetOriginalAttributes();
 
@@ -159,7 +159,7 @@ void DynamicObject::RestoreAttribute(const String& attr)
        original_attributes->Remove(attr);
 }
 
-bool DynamicObject::IsAttributeModified(const String& attr) const
+bool ConfigObject::IsAttributeModified(const String& attr) const
 {
        Dictionary::Ptr original_attributes = GetOriginalAttributes();
 
@@ -169,23 +169,23 @@ bool DynamicObject::IsAttributeModified(const String& attr) const
        return original_attributes->Contains(attr);
 }
 
-void DynamicObject::Register(void)
+void ConfigObject::Register(void)
 {
        ASSERT(!OwnsLock());
 
-       DynamicType::Ptr dtype = GetType();
+       ConfigType::Ptr dtype = GetType();
        dtype->RegisterObject(this);
 }
 
-void DynamicObject::Unregister(void)
+void ConfigObject::Unregister(void)
 {
        ASSERT(!OwnsLock());
 
-       DynamicType::Ptr dtype = GetType();
+       ConfigType::Ptr dtype = GetType();
        dtype->UnregisterObject(this);
 }
 
-void DynamicObject::Start(void)
+void ConfigObject::Start(void)
 {
        ASSERT(!OwnsLock());
        ObjectLock olock(this);
@@ -193,7 +193,7 @@ void DynamicObject::Start(void)
        SetStartCalled(true);
 }
 
-void DynamicObject::Activate(void)
+void ConfigObject::Activate(void)
 {
        CONTEXT("Activating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
 
@@ -214,7 +214,7 @@ void DynamicObject::Activate(void)
        NotifyActive();
 }
 
-void DynamicObject::Stop(void)
+void ConfigObject::Stop(void)
 {
        ASSERT(!OwnsLock());
        ObjectLock olock(this);
@@ -222,7 +222,7 @@ void DynamicObject::Stop(void)
        SetStopCalled(true);
 }
 
-void DynamicObject::Deactivate(void)
+void ConfigObject::Deactivate(void)
 {
        CONTEXT("Deactivating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
 
@@ -246,37 +246,37 @@ void DynamicObject::Deactivate(void)
        NotifyActive();
 }
 
-void DynamicObject::OnConfigLoaded(void)
+void ConfigObject::OnConfigLoaded(void)
 {
        /* Nothing to do here. */
 }
 
-void DynamicObject::OnAllConfigLoaded(void)
+void ConfigObject::OnAllConfigLoaded(void)
 {
        /* Nothing to do here. */
 }
 
-void DynamicObject::CreateChildObjects(const Type::Ptr& childType)
+void ConfigObject::CreateChildObjects(const Type::Ptr& childType)
 {
        /* Nothing to do here. */
 }
 
-void DynamicObject::OnStateLoaded(void)
+void ConfigObject::OnStateLoaded(void)
 {
        /* Nothing to do here. */
 }
 
-void DynamicObject::Pause(void)
+void ConfigObject::Pause(void)
 {
        SetPauseCalled(true);
 }
 
-void DynamicObject::Resume(void)
+void ConfigObject::Resume(void)
 {
        SetResumeCalled(true);
 }
 
-void DynamicObject::SetAuthority(bool authority)
+void ConfigObject::SetAuthority(bool authority)
 {
        if (authority && GetPaused()) {
                SetResumeCalled(false);
@@ -291,9 +291,9 @@ void DynamicObject::SetAuthority(bool authority)
        }
 }
 
-void DynamicObject::DumpObjects(const String& filename, int attributeTypes)
+void ConfigObject::DumpObjects(const String& filename, int attributeTypes)
 {
-       Log(LogInformation, "DynamicObject")
+       Log(LogInformation, "ConfigObject")
            << "Dumping program state to file '" << filename << "'";
 
        String tempFilename = filename + ".tmp";
@@ -306,8 +306,8 @@ void DynamicObject::DumpObjects(const String& filename, int attributeTypes)
 
        StdioStream::Ptr sfp = new StdioStream(&fp, false);
 
-       BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& type, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, type->GetObjects()) {
                        Dictionary::Ptr persistentObject = new Dictionary();
 
                        persistentObject->Set("type", type->GetName());
@@ -342,27 +342,27 @@ void DynamicObject::DumpObjects(const String& filename, int attributeTypes)
        }
 }
 
-void DynamicObject::RestoreObject(const String& message, int attributeTypes)
+void ConfigObject::RestoreObject(const String& message, int attributeTypes)
 {
        Dictionary::Ptr persistentObject = JsonDecode(message);
 
        String type = persistentObject->Get("type");
 
-       DynamicType::Ptr dt = DynamicType::GetByName(type);
+       ConfigType::Ptr dt = ConfigType::GetByName(type);
 
        if (!dt)
                return;
 
        String name = persistentObject->Get("name");
 
-       DynamicObject::Ptr object = dt->GetObject(name);
+       ConfigObject::Ptr object = dt->GetObject(name);
 
        if (!object)
                return;
 
        ASSERT(!object->IsActive());
 #ifdef I2_DEBUG
-       Log(LogDebug, "DynamicObject")
+       Log(LogDebug, "ConfigObject")
            << "Restoring object '" << name << "' of type '" << type << "'.";
 #endif /* I2_DEBUG */
        Dictionary::Ptr update = persistentObject->Get("update");
@@ -371,12 +371,12 @@ void DynamicObject::RestoreObject(const String& message, int attributeTypes)
        object->SetStateLoaded(true);
 }
 
-void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
+void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)
 {
        if (!Utility::PathExists(filename))
                return;
 
-       Log(LogInformation, "DynamicObject")
+       Log(LogInformation, "ConfigObject")
            << "Restoring program state from file '" << filename << "'";
 
        std::fstream fp;
@@ -399,7 +399,7 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
                if (srs != StatusNewItem)
                        continue;
 
-               upq.Enqueue(boost::bind(&DynamicObject::RestoreObject, message, attributeTypes));
+               upq.Enqueue(boost::bind(&ConfigObject::RestoreObject, message, attributeTypes));
                restored++;
        }
 
@@ -409,8 +409,8 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
 
        unsigned long no_state = 0;
 
-       BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& type, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, type->GetObjects()) {
                        if (!object->GetStateLoaded()) {
                                object->OnStateLoaded();
                                object->SetStateLoaded(true);
@@ -420,23 +420,23 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
                }
        }
 
-       Log(LogInformation, "DynamicObject")
+       Log(LogInformation, "ConfigObject")
            << "Restored " << restored << " objects. Loaded " << no_state << " new objects without state.";
 }
 
-void DynamicObject::StopObjects(void)
+void ConfigObject::StopObjects(void)
 {
-       BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& dt, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, dt->GetObjects()) {
                        object->Deactivate();
                }
        }
 }
 
-void DynamicObject::DumpModifiedAttributes(const boost::function<void(const DynamicObject::Ptr&, const String&, const Value&)>& callback)
+void ConfigObject::DumpModifiedAttributes(const boost::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
 {
-       BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& dt, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, dt->GetObjects()) {
                        Dictionary::Ptr originalAttributes = object->GetOriginalAttributes();
 
                        if (!originalAttributes)
@@ -454,8 +454,8 @@ void DynamicObject::DumpModifiedAttributes(const boost::function<void(const Dyna
 
 }
 
-DynamicObject::Ptr DynamicObject::GetObject(const String& type, const String& name)
+ConfigObject::Ptr ConfigObject::GetObject(const String& type, const String& name)
 {
-       DynamicType::Ptr dtype = DynamicType::GetByName(type);
+       ConfigType::Ptr dtype = ConfigType::GetByName(type);
        return dtype->GetObject(name);
 }
similarity index 85%
rename from lib/base/dynamicobject.hpp
rename to lib/base/configobject.hpp
index 8bca65ef2e9e964bf9f87e2ea843e9587c4d3bc7..5885621f2add2cd28560ed5d4183ee9c72aa167b 100644 (file)
@@ -21,7 +21,7 @@
 #define DYNAMICOBJECT_H
 
 #include "base/i2-base.hpp"
-#include "base/dynamicobject.thpp"
+#include "base/configobject.thpp"
 #include "base/object.hpp"
 #include "base/type.hpp"
 #include "base/dictionary.hpp"
 namespace icinga
 {
 
-class DynamicType;
+class ConfigType;
 
 /**
  * A dynamic object that can be instantiated from the configuration file.
  *
  * @ingroup base
  */
-class I2_BASE_API DynamicObject : public ObjectImpl<DynamicObject>
+class I2_BASE_API ConfigObject : public ObjectImpl<ConfigObject>
 {
 public:
-       DECLARE_OBJECT(DynamicObject);
+       DECLARE_OBJECT(ConfigObject);
 
-       static boost::signals2::signal<void (const DynamicObject::Ptr&)> OnStateChanged;
+       static boost::signals2::signal<void (const ConfigObject::Ptr&)> OnStateChanged;
 
-       intrusive_ptr<DynamicType> GetType(void) const;
+       intrusive_ptr<ConfigType> GetType(void) const;
 
        bool IsActive(void) const;
        bool IsPaused(void) const;
@@ -78,7 +78,7 @@ public:
        template<typename T>
        static intrusive_ptr<T> GetObject(const String& name)
        {
-               DynamicObject::Ptr object = GetObject(T::GetTypeName(), name);
+               ConfigObject::Ptr object = GetObject(T::GetTypeName(), name);
 
                return static_pointer_cast<T>(object);
        }
@@ -87,15 +87,15 @@ public:
        static void RestoreObjects(const String& filename, int attributeTypes = FAState);
        static void StopObjects(void);
 
-       static void DumpModifiedAttributes(const boost::function<void(const DynamicObject::Ptr&, const String&, const Value&)>& callback);
+       static void DumpModifiedAttributes(const boost::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback);
 
        static Object::Ptr GetPrototype(void);
 
 protected:
-       explicit DynamicObject(void);
+       explicit ConfigObject(void);
 
 private:
-       static DynamicObject::Ptr GetObject(const String& type, const String& name);
+       static ConfigObject::Ptr GetObject(const String& type, const String& name);
        static void RestoreObject(const String& message, int attributeTypes);
 };
 
@@ -107,7 +107,7 @@ private:
                                                                                \
        inline static intrusive_ptr<klass> GetByName(const String& name)        \
        {                                                                       \
-               return DynamicObject::GetObject<klass>(name);                   \
+               return ConfigObject::GetObject<klass>(name);                    \
        }
 
 }
similarity index 94%
rename from lib/base/dynamicobject.ti
rename to lib/base/configobject.ti
index c45dfc50f950a6f47e4af5950a358e5461a0833a..20980762945f8f07a8d9bc2bd05923608dd9ed3e 100644 (file)
@@ -38,11 +38,11 @@ public:
 };
 }}}
 
-abstract class DynamicObjectBase
+abstract class ConfigObjectBase
 { };
 
 code {{{
-class I2_BASE_API DynamicObjectBase : public ObjectImpl<DynamicObjectBase>
+class I2_BASE_API ConfigObjectBase : public ObjectImpl<ConfigObjectBase>
 {
 public:
        inline DebugInfo GetDebugInfo(void) const
@@ -60,7 +60,7 @@ private:
 };
 }}}
 
-abstract class DynamicObject : DynamicObjectBase
+abstract class ConfigObject : ConfigObjectBase
 {
        [config, internal] String __name (Name);
        [config] String "name" (ShortName) {
similarity index 70%
rename from lib/base/dynamictype.cpp
rename to lib/base/configtype.cpp
index e6386dcd8865bffb359d9e18128e81712c34c275..90555f992109f8bf9175a7307ab02931f2bf0877 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/serializer.hpp"
 #include "base/debug.hpp"
 #include "base/objectlock.hpp"
 
 using namespace icinga;
 
-DynamicType::DynamicType(const String& name)
+ConfigType::ConfigType(const String& name)
        : m_Name(name)
 {
        InflateMutex();
 }
 
-DynamicType::Ptr DynamicType::GetByName(const String& name)
+ConfigType::Ptr ConfigType::GetByName(const String& name)
 {
        boost::mutex::scoped_lock lock(GetStaticMutex());
 
-       DynamicType::TypeMap::const_iterator tt = InternalGetTypeMap().find(name);
+       ConfigType::TypeMap::const_iterator tt = InternalGetTypeMap().find(name);
 
        if (tt == InternalGetTypeMap().end()) {
                Type::Ptr type = Type::GetByName(name);
 
-               if (!type || !DynamicObject::TypeInstance->IsAssignableFrom(type)
+               if (!type || !ConfigObject::TypeInstance->IsAssignableFrom(type)
                    || type->IsAbstract())
-                       return DynamicType::Ptr();
+                       return ConfigType::Ptr();
 
-               DynamicType::Ptr dtype = new DynamicType(name);
+               ConfigType::Ptr dtype = new ConfigType(name);
 
                InternalGetTypeMap()[type->GetName()] = dtype;
                InternalGetTypeVector().push_back(dtype);
@@ -57,40 +57,40 @@ DynamicType::Ptr DynamicType::GetByName(const String& name)
 }
 
 /**
- * Note: Caller must hold DynamicType::GetStaticMutex() while using the map.
+ * Note: Caller must hold ConfigType::GetStaticMutex() while using the map.
  */
-DynamicType::TypeMap& DynamicType::InternalGetTypeMap(void)
+ConfigType::TypeMap& ConfigType::InternalGetTypeMap(void)
 {
-       static DynamicType::TypeMap typemap;
+       static ConfigType::TypeMap typemap;
        return typemap;
 }
 
-DynamicType::TypeVector& DynamicType::InternalGetTypeVector(void)
+ConfigType::TypeVector& ConfigType::InternalGetTypeVector(void)
 {
-       static DynamicType::TypeVector typevector;
+       static ConfigType::TypeVector typevector;
        return typevector;
 }
 
-DynamicType::TypeVector DynamicType::GetTypes(void)
+ConfigType::TypeVector ConfigType::GetTypes(void)
 {
        boost::mutex::scoped_lock lock(GetStaticMutex());
        return InternalGetTypeVector(); /* Making a copy of the vector here. */
 }
 
-std::pair<DynamicTypeIterator<DynamicObject>, DynamicTypeIterator<DynamicObject> > DynamicType::GetObjects(void)
+std::pair<ConfigTypeIterator<ConfigObject>, ConfigTypeIterator<ConfigObject> > ConfigType::GetObjects(void)
 {
        return std::make_pair(
-           DynamicTypeIterator<DynamicObject>(this, 0),
-           DynamicTypeIterator<DynamicObject>(this, -1)
+           ConfigTypeIterator<ConfigObject>(this, 0),
+           ConfigTypeIterator<ConfigObject>(this, -1)
        );
 }
 
-String DynamicType::GetName(void) const
+String ConfigType::GetName(void) const
 {
        return m_Name;
 }
 
-void DynamicType::RegisterObject(const DynamicObject::Ptr& object)
+void ConfigType::RegisterObject(const ConfigObject::Ptr& object)
 {
        String name = object->GetName();
 
@@ -113,7 +113,7 @@ void DynamicType::RegisterObject(const DynamicObject::Ptr& object)
        }
 }
 
-void DynamicType::UnregisterObject(const DynamicObject::Ptr& object)
+void ConfigType::UnregisterObject(const ConfigObject::Ptr& object)
 {
        String name = object->GetName();
 
@@ -125,19 +125,19 @@ void DynamicType::UnregisterObject(const DynamicObject::Ptr& object)
        }
 }
 
-DynamicObject::Ptr DynamicType::GetObject(const String& name) const
+ConfigObject::Ptr ConfigType::GetObject(const String& name) const
 {
        ObjectLock olock(this);
 
-       DynamicType::ObjectMap::const_iterator nt = m_ObjectMap.find(name);
+       ConfigType::ObjectMap::const_iterator nt = m_ObjectMap.find(name);
 
        if (nt == m_ObjectMap.end())
-               return DynamicObject::Ptr();
+               return ConfigObject::Ptr();
 
        return nt->second;
 }
 
-boost::mutex& DynamicType::GetStaticMutex(void)
+boost::mutex& ConfigType::GetStaticMutex(void)
 {
        static boost::mutex mutex;
        return mutex;
similarity index 66%
rename from lib/base/dynamictype.hpp
rename to lib/base/configtype.hpp
index 9670857e2822bd3258e41b08ff1508a04f7ee214..6624fed7faf6cd784c93b9d6fa77ad7cb95ea10f 100644 (file)
@@ -21,7 +21,7 @@
 #define DYNAMICTYPE_H
 
 #include "base/i2-base.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/objectlock.hpp"
 #include <map>
 # include <boost/iterator/iterator_facade.hpp>
@@ -30,50 +30,50 @@ namespace icinga
 {
 
 template<typename T>
-class DynamicTypeIterator;
+class ConfigTypeIterator;
 
-class I2_BASE_API DynamicType : public Object
+class I2_BASE_API ConfigType : public Object
 {
 public:
-       DECLARE_PTR_TYPEDEFS(DynamicType);
+       DECLARE_PTR_TYPEDEFS(ConfigType);
 
-       DynamicType(const String& name);
+       ConfigType(const String& name);
 
        String GetName(void) const;
 
-       static DynamicType::Ptr GetByName(const String& name);
+       static ConfigType::Ptr GetByName(const String& name);
 
-       DynamicObject::Ptr GetObject(const String& name) const;
+       ConfigObject::Ptr GetObject(const String& name) const;
 
-       void RegisterObject(const DynamicObject::Ptr& object);
-       void UnregisterObject(const DynamicObject::Ptr& object);
+       void RegisterObject(const ConfigObject::Ptr& object);
+       void UnregisterObject(const ConfigObject::Ptr& object);
 
-       static std::vector<DynamicType::Ptr> GetTypes(void);
-       std::pair<DynamicTypeIterator<DynamicObject>, DynamicTypeIterator<DynamicObject> > GetObjects(void);
+       static std::vector<ConfigType::Ptr> GetTypes(void);
+       std::pair<ConfigTypeIterator<ConfigObject>, ConfigTypeIterator<ConfigObject> > GetObjects(void);
 
        template<typename T>
-       static std::pair<DynamicTypeIterator<T>, DynamicTypeIterator<T> > GetObjectsByType(void)
+       static std::pair<ConfigTypeIterator<T>, ConfigTypeIterator<T> > GetObjectsByType(void)
        {
-               DynamicType::Ptr type = GetByName(T::GetTypeName());
+               ConfigType::Ptr type = GetByName(T::GetTypeName());
                return std::make_pair(
-                   DynamicTypeIterator<T>(type, 0),
-                   DynamicTypeIterator<T>(type, UINT_MAX)
+                   ConfigTypeIterator<T>(type, 0),
+                   ConfigTypeIterator<T>(type, UINT_MAX)
                );
        }
 
 private:
-       template<typename T> friend class DynamicTypeIterator;
+       template<typename T> friend class ConfigTypeIterator;
 
        String m_Name;
 
-       typedef std::map<String, DynamicObject::Ptr> ObjectMap;
-       typedef std::vector<DynamicObject::Ptr> ObjectVector;
+       typedef std::map<String, ConfigObject::Ptr> ObjectMap;
+       typedef std::vector<ConfigObject::Ptr> ObjectVector;
 
        ObjectMap m_ObjectMap;
        ObjectVector m_ObjectVector;
 
-       typedef std::map<String, DynamicType::Ptr> TypeMap;
-       typedef std::vector<DynamicType::Ptr> TypeVector;
+       typedef std::map<String, ConfigType::Ptr> TypeMap;
+       typedef std::vector<ConfigType::Ptr> TypeVector;
 
        static TypeMap& InternalGetTypeMap(void);
        static TypeVector& InternalGetTypeVector(void);
@@ -81,18 +81,18 @@ private:
 };
 
 template<typename T>
-class DynamicTypeIterator : public boost::iterator_facade<DynamicTypeIterator<T>, const intrusive_ptr<T>, boost::forward_traversal_tag>
+class ConfigTypeIterator : public boost::iterator_facade<ConfigTypeIterator<T>, const intrusive_ptr<T>, boost::forward_traversal_tag>
 {
 public:
-       DynamicTypeIterator(const DynamicType::Ptr& type, int index)
+       ConfigTypeIterator(const ConfigType::Ptr& type, int index)
                : m_Type(type), m_Index(index)
        { }
 
 private:
        friend class boost::iterator_core_access;
 
-       DynamicType::Ptr m_Type;
-       DynamicType::ObjectVector::size_type m_Index;
+       ConfigType::Ptr m_Type;
+       ConfigType::ObjectVector::size_type m_Index;
        mutable intrusive_ptr<T> m_Current;
 
        void increment(void)
@@ -110,7 +110,7 @@ private:
                m_Index += n;
        }
 
-       bool equal(const DynamicTypeIterator<T>& other) const
+       bool equal(const ConfigTypeIterator<T>& other) const
        {
                ASSERT(other.m_Type == m_Type);
 
index b48de54aba8f14493f5a2bdd649445ed45352443..42ddcd3dbf12f75e77384bb02866977c20abc7a8 100644 (file)
@@ -154,7 +154,7 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta
        if (vex) {
                DebugInfo di;
 
-               DynamicObject::Ptr dobj = vex->GetObject();
+               ConfigObject::Ptr dobj = vex->GetObject();
                if (dobj)
                        di = dobj->GetDebugInfo();
 
@@ -315,7 +315,7 @@ const char *posix_error::what(void) const throw()
        return m_Message;
 }
 
-ValidationError::ValidationError(const DynamicObject::Ptr& object, const std::vector<String>& attributePath, const String& message)
+ValidationError::ValidationError(const ConfigObject::Ptr& object, const std::vector<String>& attributePath, const String& message)
        : m_Object(object), m_AttributePath(attributePath), m_Message(message)
 {
        String path;
@@ -344,7 +344,7 @@ const char *ValidationError::what(void) const throw()
        return m_What.CStr();
 }
 
-DynamicObject::Ptr ValidationError::GetObject(void) const
+ConfigObject::Ptr ValidationError::GetObject(void) const
 {
        return m_Object;
 }
index daeed9677bd752cb960fca589f88aa8819da8d35..d6a9b8470634897ff5c55f78b1b820285d7b0884 100644 (file)
@@ -27,7 +27,7 @@
 #include "base/utility.hpp"
 #include "base/debuginfo.hpp"
 #include "base/dictionary.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include <sstream>
 #include <boost/exception/errinfo_api_function.hpp>
 #include <boost/exception/errinfo_errno.hpp>
@@ -72,12 +72,12 @@ private:
 class I2_BASE_API ValidationError : virtual public user_error
 {
 public:
-       ValidationError(const DynamicObject::Ptr& object, const std::vector<String>& attributePath, const String& message);
+       ValidationError(const ConfigObject::Ptr& object, const std::vector<String>& attributePath, const String& message);
        ~ValidationError(void) throw();
 
        virtual const char *what(void) const throw();
 
-       DynamicObject::Ptr GetObject(void) const;
+       ConfigObject::Ptr GetObject(void) const;
        std::vector<String> GetAttributePath(void) const;
        String GetMessage(void) const;
 
@@ -85,7 +85,7 @@ public:
        Dictionary::Ptr GetDebugHint(void) const;
 
 private:
-       DynamicObject::Ptr m_Object;
+       ConfigObject::Ptr m_Object;
        std::vector<String> m_AttributePath;
        String m_Message;
        String m_What;
index ab981bb7665c1d276b3968004a741b618d9edb08..4a80f131e3eca2dd2ff08e650c6723fed0cc6de4 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "base/filelogger.hpp"
 #include "base/filelogger.tcpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/statsfunction.hpp"
 #include "base/application.hpp"
 #include <fstream>
@@ -34,7 +34,7 @@ void FileLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const FileLogger::Ptr& filelogger, DynamicType::GetObjectsByType<FileLogger>()) {
+       BOOST_FOREACH(const FileLogger::Ptr& filelogger, ConfigType::GetObjectsByType<FileLogger>()) {
                nodes->Set(filelogger->GetName(), 1); //add more stats
        }
 
index 4ffe3ef2b923825fe416b3796903b90509c36b00..27151a9cf6051d326a87f3a822f817714123d9c3 100644 (file)
@@ -21,7 +21,7 @@
 #include "base/logger.tcpp"
 #include "base/application.hpp"
 #include "base/streamlogger.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/objectlock.hpp"
 #include "base/context.hpp"
@@ -54,7 +54,7 @@ void Logger::StaticInitialize(void)
  */
 void Logger::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        boost::mutex::scoped_lock lock(m_Mutex);
        m_Loggers.insert(this);
@@ -67,7 +67,7 @@ void Logger::Stop(void)
                m_Loggers.erase(this);
        }
 
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 }
 
 std::set<Logger::Ptr> Logger::GetLoggers(void)
index e7c4138fdcf0f45d5c74bb6c49d74c4754e0af18..4b1ee634358688090efcfae61a2d9c63b28aacaa 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library base;
 
 namespace icinga
 {
 
-abstract class Logger : DynamicObject
+abstract class Logger : ConfigObject
 {
        [config] String severity;
 };
index edd58c858ec7adb02ba1396450af276aec113170..c43525176de7a662531db3bfd186bb8289e4a1ab 100644 (file)
@@ -24,7 +24,7 @@
 #include "base/json.hpp"
 #include "base/logger.hpp"
 #include "base/objectlock.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/application.hpp"
 #include <boost/foreach.hpp>
 #include <boost/regex.hpp>
@@ -251,7 +251,7 @@ Array::Ptr ScriptUtils::Keys(const Dictionary::Ptr& dict)
        return result;
 }
 
-DynamicObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name)
+ConfigObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name)
 {
        String typeName;
 
@@ -260,24 +260,24 @@ DynamicObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name
        else
                typeName = vtype;
 
-       DynamicType::Ptr dtype = DynamicType::GetByName(typeName);
+       ConfigType::Ptr dtype = ConfigType::GetByName(typeName);
 
        if (!dtype)
-               return DynamicObject::Ptr();
+               return ConfigObject::Ptr();
 
        return dtype->GetObject(name);
 }
 
 Array::Ptr ScriptUtils::GetObjects(const Type::Ptr& type)
 {
-       DynamicType::Ptr dtype = DynamicType::GetByName(type->GetName());
+       ConfigType::Ptr dtype = ConfigType::GetByName(type->GetName());
 
        if (!dtype)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid type name"));
 
        Array::Ptr result = new Array();
 
-       BOOST_FOREACH(const DynamicObject::Ptr& object, dtype->GetObjects())
+       BOOST_FOREACH(const ConfigObject::Ptr& object, dtype->GetObjects())
                result->Add(object);
 
        return result;
index ff36327bc76ea89732cb130611477cf2980bdd8f..204ca7761d1251fcc45b95dcc56a6b8d584961c7 100644 (file)
@@ -25,7 +25,7 @@
 #include "base/array.hpp"
 #include "base/dictionary.hpp"
 #include "base/type.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
@@ -47,7 +47,7 @@ public:
        static Array::Ptr Range(const std::vector<Value>& arguments);
        static Type::Ptr TypeOf(const Value& value);
        static Array::Ptr Keys(const Dictionary::Ptr& dict);
-       static DynamicObject::Ptr GetObject(const Value& type, const String& name);
+       static ConfigObject::Ptr GetObject(const Value& type, const String& name);
        static Array::Ptr GetObjects(const Type::Ptr& type);
        static void Assert(const Value& arg);
        static String MsiGetComponentPathShim(const String& component);
index 34cffbcdd2c33aabbe6cfe6b89b7bb92b693c9f7..b94cc4f674d51b9f8a26e85ea314ae2ef91eea70 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "base/sysloglogger.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/statsfunction.hpp"
 
 #ifndef _WIN32
@@ -34,7 +34,7 @@ void SyslogLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const SyslogLogger::Ptr& sysloglogger, DynamicType::GetObjectsByType<SyslogLogger>()) {
+       BOOST_FOREACH(const SyslogLogger::Ptr& sysloglogger, ConfigType::GetObjectsByType<SyslogLogger>()) {
                nodes->Set(sysloglogger->GetName(), 1); //add more stats
        }
 
index b7b2798391a185912ed530e89145c5e7389eba1f..1759813843123c8e9998bbd200323b65a40444a5 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/cib.hpp"
 #include "icinga/perfdatavalue.hpp"
 #include "remote/apilistener.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
 #include "base/logger.hpp"
@@ -42,7 +42,7 @@ void CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const CheckerComponent::Ptr& checker, DynamicType::GetObjectsByType<CheckerComponent>()) {
+       BOOST_FOREACH(const CheckerComponent::Ptr& checker, ConfigType::GetObjectsByType<CheckerComponent>()) {
                unsigned long idle = checker->GetIdleCheckables();
                unsigned long pending = checker->GetPendingCheckables();
 
@@ -66,15 +66,15 @@ CheckerComponent::CheckerComponent(void)
 
 void CheckerComponent::OnConfigLoaded(void)
 {
-       DynamicObject::OnActiveChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
-       DynamicObject::OnPausedChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
+       ConfigObject::OnActiveChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
+       ConfigObject::OnPausedChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
 
        Checkable::OnNextCheckChanged.connect(bind(&CheckerComponent::NextCheckChangedHandler, this, _1));
 }
 
 void CheckerComponent::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
 
@@ -97,7 +97,7 @@ void CheckerComponent::Stop(void)
        m_ResultTimer->Stop();
        m_Thread.join();
 
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 }
 
 void CheckerComponent::CheckThreadProc(void)
@@ -252,7 +252,7 @@ void CheckerComponent::ResultTimerHandler(void)
        Log(LogNotice, "CheckerComponent", msgbuf.str());
 }
 
-void CheckerComponent::ObjectHandler(const DynamicObject::Ptr& object)
+void CheckerComponent::ObjectHandler(const ConfigObject::Ptr& object)
 {
        Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
 
index 9c11dfdc62f8fe8f24124caed7464987c203fcec..e20c9a944120c3bd185981786911e7658e9b749a 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "checker/checkercomponent.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/timer.hpp"
 #include "base/utility.hpp"
 #include <boost/thread/thread.hpp>
@@ -96,7 +96,7 @@ private:
 
        void AdjustCheckTimer(void);
 
-       void ObjectHandler(const DynamicObject::Ptr& object);
+       void ObjectHandler(const ConfigObject::Ptr& object);
        void NextCheckChangedHandler(const Checkable::Ptr& checkable);
 
        void RescheduleCheckTimer(void);
index 492ee312adff9f0de344385647028b091e52e9df..62beb8112a0e163596b96b7b37ea62a405e727c6 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library checker;
 
 namespace icinga
 {
 
-class CheckerComponent : DynamicObject
+class CheckerComponent : ConfigObject
 {
 };
 
index c503ed364ecbf8c059a8ba541e7ca5edd75a3b52..0856362cb52a530d8a5481822d4a60cfe0f76d21 100644 (file)
@@ -22,8 +22,8 @@
 #include "base/logger.hpp"
 #include "base/application.hpp"
 #include "base/convert.hpp"
-#include "base/dynamicobject.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configobject.hpp"
+#include "base/configtype.hpp"
 #include "base/json.hpp"
 #include "base/netstring.hpp"
 #include "base/stdiostream.hpp"
index d0eb423df9f9137832ce065e5cb6302812a041d3..8bb68bb032e862b55a8bc8233baff983bd785c3c 100644 (file)
@@ -236,7 +236,7 @@ bool RepositoryUtility::AddObject(const std::vector<String>& object_paths, const
                        Deserialize(object, attrs, false, FAConfig);
 
                        RepositoryValidationUtils utils;
-                       static_pointer_cast<DynamicObject>(object)->Validate(FAConfig, utils);
+                       static_pointer_cast<ConfigObject>(object)->Validate(FAConfig, utils);
                } catch (const ScriptError& ex) {
                        Log(LogCritical, "config", DiagnosticInformation(ex));
                        return false;
index 5a90095ec271b040a9b7a83fb5541e9bac5544dd..bc38bdebb702d43ecd72c1af3b5e7211f877a647 100644 (file)
@@ -22,8 +22,8 @@
 #include "base/logger.hpp"
 #include "base/application.hpp"
 #include "base/convert.hpp"
-#include "base/dynamicobject.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configobject.hpp"
+#include "base/configtype.hpp"
 #include "base/json.hpp"
 #include "base/netstring.hpp"
 #include "base/stdiostream.hpp"
index e7662f5c8e0dd1fa0fe443adac0fe79cf11e1645..e3475cd40238b0a1f14cecd4e87e9e3fc29e0601 100644 (file)
@@ -22,7 +22,7 @@
 #include "base/logger.hpp"
 #include "base/application.hpp"
 #include "base/convert.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/debug.hpp"
 #include "base/objectlock.hpp"
 #include "base/console.hpp"
index 1ea5b6f9baec950a293e9b2cfc400262e164a80d..eb344ee70ed0ed9312b3d6606edc41505cfe5830 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/service.hpp"
 #include "icinga/pluginutility.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/convert.hpp"
@@ -44,7 +44,7 @@ void CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Pt
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const CheckResultReader::Ptr& checkresultreader, DynamicType::GetObjectsByType<CheckResultReader>()) {
+       BOOST_FOREACH(const CheckResultReader::Ptr& checkresultreader, ConfigType::GetObjectsByType<CheckResultReader>()) {
                nodes->Set(checkresultreader->GetName(), 1); //add more stats
        }
 
index c0552082f73e6f1bd939c00714955c3dd8f5cd94..a57844066743453ef082c61e4859e82e37a17d86 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library compat;
@@ -25,7 +25,7 @@ library compat;
 namespace icinga
 {
 
-class CheckResultReader : DynamicObject
+class CheckResultReader : ConfigObject
 {
        [config] String spool_dir {
                default {{{ return Application::GetLocalStateDir() + "/lib/icinga2/spool/checkresults/"; }}}
index 57e40d85d60d6e7cff9393b917b8e2b230f43111..ff0f38ba6814256449ecad3f4fc89eb213da67e6 100644 (file)
@@ -26,7 +26,7 @@
 #include "icinga/macroprocessor.hpp"
 #include "icinga/externalcommandprocessor.hpp"
 #include "icinga/compatutility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/exception.hpp"
@@ -47,7 +47,7 @@ void CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const CompatLogger::Ptr& compat_logger, DynamicType::GetObjectsByType<CompatLogger>()) {
+       BOOST_FOREACH(const CompatLogger::Ptr& compat_logger, ConfigType::GetObjectsByType<CompatLogger>()) {
                nodes->Set(compat_logger->GetName(), 1); //add more stats
        }
 
@@ -59,7 +59,7 @@ void CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
  */
 void CompatLogger::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        Checkable::OnNewCheckResult.connect(bind(&CompatLogger::CheckResultHandler, this, _1, _2));
        Checkable::OnNotificationSentToUser.connect(bind(&CompatLogger::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
@@ -479,7 +479,7 @@ void CompatLogger::ReopenFile(bool rotate)
        WriteLine("LOG ROTATION: " + GetRotationMethod());
        WriteLine("LOG VERSION: 2.0");
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                String output;
                CheckResult::Ptr cr = host->GetLastCheckResult();
 
@@ -497,7 +497,7 @@ void CompatLogger::ReopenFile(bool rotate)
                WriteLine(msgbuf.str());
        }
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                Host::Ptr host = service->GetHost();
 
                String output;
index 1313c9c5683ac92317fc3ee76370f0b704478a33..9c1e7db77e552a364bdc1e8d0a2f73d3145d68c4 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library compat;
@@ -25,7 +25,7 @@ library compat;
 namespace icinga
 {
 
-class CompatLogger : DynamicObject
+class CompatLogger : ConfigObject
 {
        [config] String log_dir {
                default {{{ return Application::GetLocalStateDir() + "/log/icinga2/compat"; }}}
index 6c96a4c745a384f47e4a9fb8a13dfb95d76207a6..c13696738f3a61d65d30eecb6d4cf8c6837e7a6d 100644 (file)
@@ -20,7 +20,7 @@
 #include "compat/externalcommandlistener.hpp"
 #include "compat/externalcommandlistener.tcpp"
 #include "icinga/externalcommandprocessor.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/exception.hpp"
 #include "base/application.hpp"
@@ -36,7 +36,7 @@ void ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Arr
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const ExternalCommandListener::Ptr& externalcommandlistener, DynamicType::GetObjectsByType<ExternalCommandListener>()) {
+       BOOST_FOREACH(const ExternalCommandListener::Ptr& externalcommandlistener, ConfigType::GetObjectsByType<ExternalCommandListener>()) {
                nodes->Set(externalcommandlistener->GetName(), 1); //add more stats
        }
 
@@ -48,7 +48,7 @@ void ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Arr
  */
 void ExternalCommandListener::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
 #ifndef _WIN32
        m_CommandThread = boost::thread(boost::bind(&ExternalCommandListener::CommandPipeThread, this, GetCommandPath()));
index b2a562bd09599144318ba764f8456946f6690963..37af1da3e61c909ab5675bb55a82c7fc0566f89f 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library compat;
@@ -25,7 +25,7 @@ library compat;
 namespace icinga
 {
 
-class ExternalCommandListener : DynamicObject
+class ExternalCommandListener : ConfigObject
 {
        [config] String command_path {
                default {{{ return Application::GetRunDir() + "/icinga2/cmd/icinga2.cmd"; }}}
index 673a981c437b5a20686c19ac547d9a807f2c97f8..20f0804726deaeb06b3edfa75351e5d650e2b564 100644 (file)
@@ -29,7 +29,7 @@
 #include "icinga/notificationcommand.hpp"
 #include "icinga/compatutility.hpp"
 #include "icinga/dependency.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/json.hpp"
 #include "base/convert.hpp"
@@ -54,7 +54,7 @@ void StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const StatusDataWriter::Ptr& statusdatawriter, DynamicType::GetObjectsByType<StatusDataWriter>()) {
+       BOOST_FOREACH(const StatusDataWriter::Ptr& statusdatawriter, ConfigType::GetObjectsByType<StatusDataWriter>()) {
                nodes->Set(statusdatawriter->GetName(), 1); //add more stats
        }
 
@@ -72,7 +72,7 @@ void StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr
  */
 void StatusDataWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_StatusTimer = new Timer();
        m_StatusTimer->SetInterval(GetUpdateInterval());
@@ -556,7 +556,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                    "# This file is auto-generated. Do not modify this file." "\n"
                    "\n";
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                std::ostringstream tempobjectfp;
                tempobjectfp << std::fixed;
                DumpHostObject(tempobjectfp, host);
@@ -570,7 +570,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                }
        }
 
-       BOOST_FOREACH(const HostGroup::Ptr& hg, DynamicType::GetObjectsByType<HostGroup>()) {
+       BOOST_FOREACH(const HostGroup::Ptr& hg, ConfigType::GetObjectsByType<HostGroup>()) {
                std::ostringstream tempobjectfp;
                tempobjectfp << std::fixed;
 
@@ -601,7 +601,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                objectfp << tempobjectfp.str();
        }
 
-       BOOST_FOREACH(const ServiceGroup::Ptr& sg, DynamicType::GetObjectsByType<ServiceGroup>()) {
+       BOOST_FOREACH(const ServiceGroup::Ptr& sg, ConfigType::GetObjectsByType<ServiceGroup>()) {
                std::ostringstream tempobjectfp;
                tempobjectfp << std::fixed;
 
@@ -642,7 +642,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                objectfp << tempobjectfp.str();
        }
 
-       BOOST_FOREACH(const User::Ptr& user, DynamicType::GetObjectsByType<User>()) {
+       BOOST_FOREACH(const User::Ptr& user, ConfigType::GetObjectsByType<User>()) {
                std::ostringstream tempobjectfp;
                tempobjectfp << std::fixed;
 
@@ -670,7 +670,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                objectfp << tempobjectfp.str();
        }
 
-       BOOST_FOREACH(const UserGroup::Ptr& ug, DynamicType::GetObjectsByType<UserGroup>()) {
+       BOOST_FOREACH(const UserGroup::Ptr& ug, ConfigType::GetObjectsByType<UserGroup>()) {
                std::ostringstream tempobjectfp;
                tempobjectfp << std::fixed;
 
@@ -686,23 +686,23 @@ void StatusDataWriter::UpdateObjectsCache(void)
                objectfp << tempobjectfp.str();
        }
 
-       BOOST_FOREACH(const Command::Ptr& command, DynamicType::GetObjectsByType<CheckCommand>()) {
+       BOOST_FOREACH(const Command::Ptr& command, ConfigType::GetObjectsByType<CheckCommand>()) {
                DumpCommand(objectfp, command);
        }
 
-       BOOST_FOREACH(const Command::Ptr& command, DynamicType::GetObjectsByType<NotificationCommand>()) {
+       BOOST_FOREACH(const Command::Ptr& command, ConfigType::GetObjectsByType<NotificationCommand>()) {
                DumpCommand(objectfp, command);
        }
 
-       BOOST_FOREACH(const Command::Ptr& command, DynamicType::GetObjectsByType<EventCommand>()) {
+       BOOST_FOREACH(const Command::Ptr& command, ConfigType::GetObjectsByType<EventCommand>()) {
                DumpCommand(objectfp, command);
        }
 
-       BOOST_FOREACH(const TimePeriod::Ptr& tp, DynamicType::GetObjectsByType<TimePeriod>()) {
+       BOOST_FOREACH(const TimePeriod::Ptr& tp, ConfigType::GetObjectsByType<TimePeriod>()) {
                DumpTimePeriod(objectfp, tp);
        }
 
-       BOOST_FOREACH(const Dependency::Ptr& dep, DynamicType::GetObjectsByType<Dependency>()) {
+       BOOST_FOREACH(const Dependency::Ptr& dep, ConfigType::GetObjectsByType<Dependency>()) {
                Checkable::Ptr parent = dep->GetParent();
 
                if (!parent) {
@@ -829,7 +829,7 @@ void StatusDataWriter::StatusTimerHandler(void)
        statusfp << "\t" "}" "\n"
                    "\n";
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                std::ostringstream tempstatusfp;
                tempstatusfp << std::fixed;
                DumpHostStatus(tempstatusfp, host);
index 542e77f4a21b8abe72bb829dd35f5484425705f8..f65b71831b634fcee94ec3222d4bd0482fc1b971 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library compat;
@@ -25,7 +25,7 @@ library compat;
 namespace icinga
 {
 
-class StatusDataWriter : DynamicObject
+class StatusDataWriter : ConfigObject
 {
        [config] String status_path {
                default {{{ return Application::GetLocalStateDir() + "/cache/icinga2/status.dat"; }}}
index 36ee268eaea35575973b5be16d60f0197fb13a36..7fbfc625c96f3187862d9e8a33929824115340a6 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/value.hpp"
 #include "base/utility.hpp"
 #include "base/exception.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/exception.hpp"
 #include <sstream>
 #include <stack>
index 9b34ceb6f5309e15e28bcd014fdf405db1451424..6652cdd8ea8f065b149e37c3d6d2c86bbd72a33f 100644 (file)
@@ -22,7 +22,7 @@
 #include "config/applyrule.hpp"
 #include "config/objectrule.hpp"
 #include "base/application.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include "base/logger.hpp"
@@ -144,12 +144,12 @@ public:
 };
 
 /**
- * Commits the configuration item by creating a DynamicObject
+ * Commits the configuration item by creating a ConfigObject
  * object.
  *
- * @returns The DynamicObject that was created/updated.
+ * @returns The ConfigObject that was created/updated.
  */
-DynamicObject::Ptr ConfigItem::Commit(bool discard)
+ConfigObject::Ptr ConfigItem::Commit(bool discard)
 {
        ASSERT(!OwnsLock());
 
@@ -160,12 +160,12 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
 
        /* Make sure the type is valid. */
        Type::Ptr type = Type::GetByName(GetType());
-       ASSERT(type && DynamicObject::TypeInstance->IsAssignableFrom(type));
+       ASSERT(type && ConfigObject::TypeInstance->IsAssignableFrom(type));
 
        if (IsAbstract())
-               return DynamicObject::Ptr();
+               return ConfigObject::Ptr();
 
-       DynamicObject::Ptr dobj = static_pointer_cast<DynamicObject>(type->Instantiate());
+       ConfigObject::Ptr dobj = static_pointer_cast<ConfigObject>(type->Instantiate());
 
        dobj->SetDebugInfo(m_DebugInfo);
        dobj->SetTypeNameV(m_Type);
@@ -374,7 +374,7 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
        }
 
        BOOST_FOREACH(const Type::Ptr& type, all_types) {
-               if (DynamicObject::TypeInstance->IsAssignableFrom(type))
+               if (ConfigObject::TypeInstance->IsAssignableFrom(type))
                        types.insert(type->GetName());
        }
 
@@ -401,7 +401,7 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
 
                        BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) {
                                if (item->m_Type == type)
-                                       upq.Enqueue(boost::bind(&DynamicObject::OnAllConfigLoaded, item->m_Object));
+                                       upq.Enqueue(boost::bind(&ConfigObject::OnAllConfigLoaded, item->m_Object));
                        }
 
                        completed_types.insert(type);
@@ -414,7 +414,7 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
                        BOOST_FOREACH(const String& loadDep, ptype->GetLoadDependencies()) {
                                BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) {
                                        if (item->m_Type == loadDep)
-                                               upq.Enqueue(boost::bind(&DynamicObject::CreateChildObjects, item->m_Object, ptype));
+                                               upq.Enqueue(boost::bind(&ConfigObject::CreateChildObjects, item->m_Object, ptype));
                                }
                        }
 
@@ -469,7 +469,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, bool restoreState)
        if (restoreState) {
                /* restore the previous program state */
                try {
-                       DynamicObject::RestoreObjects(Application::GetStatePath());
+                       ConfigObject::RestoreObjects(Application::GetStatePath());
                } catch (const std::exception& ex) {
                        Log(LogCritical, "ConfigItem")
                            << "Failed to restore state file: " << DiagnosticInformation(ex);
@@ -478,8 +478,8 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, bool restoreState)
 
        Log(LogInformation, "ConfigItem", "Triggering Start signal for config items");
 
-       BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& type, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, type->GetObjects()) {
                        if (object->IsActive())
                                continue;
 
@@ -487,7 +487,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, bool restoreState)
                        Log(LogDebug, "ConfigItem")
                            << "Activating object '" << object->GetName() << "' of type '" << object->GetType()->GetName() << "'";
 #endif /* I2_DEBUG */
-                       upq.Enqueue(boost::bind(&DynamicObject::Activate, object));
+                       upq.Enqueue(boost::bind(&ConfigObject::Activate, object));
                }
        }
 
@@ -499,8 +499,8 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, bool restoreState)
        }
 
 #ifdef I2_DEBUG
-       BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& type, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, type->GetObjects()) {
                        ASSERT(object->IsActive());
                }
        }
index 8425336deb7457024a7b4bf7f582a6c438b23fd4..9513df9df660e52fc9b0887b5832ad3055127604 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config/i2-config.hpp"
 #include "config/expression.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/workqueue.hpp"
 
 namespace icinga
@@ -53,7 +53,7 @@ public:
        boost::shared_ptr<Expression> GetExpression(void) const;
        boost::shared_ptr<Expression> GetFilter(void) const;
 
-       DynamicObject::Ptr Commit(bool discard = true);
+       ConfigObject::Ptr Commit(bool discard = true);
        void Register(void);
        void Unregister(void);
 
@@ -83,7 +83,7 @@ private:
        Dictionary::Ptr m_Scope; /**< variable scope. */
        String m_Zone; /**< The zone. */
 
-       DynamicObject::Ptr m_Object;
+       ConfigObject::Ptr m_Object;
 
        static boost::mutex m_Mutex;
 
index 5906f9ad6448c85c21ee1fb85ace82c4797eb209..9cf208575d6af6e31289c22e281feb716fde4ff1 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "config/configitembuilder.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <sstream>
 #include <boost/foreach.hpp>
 #include <boost/smart_ptr/make_shared.hpp>
@@ -83,7 +83,7 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
                BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), m_DebugInfo));
        }
 
-       if (!DynamicType::GetByName(m_Type)) {
+       if (!ConfigType::GetByName(m_Type)) {
                std::ostringstream msgbuf;
                msgbuf << "The type '" + m_Type + "' is unknown";
                BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), m_DebugInfo));
index d8a271d169950a0e426ed9342f2bccfcd167fb34..288331e26f58f72277511983e96d8e9244c8db08 100644 (file)
@@ -21,7 +21,7 @@
 #define COMMANDDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index d38aafb45296ecee41961d088c54ce80252f71c5..9c239eefbe4b4942d67d8c447e0e11fe1a3d549c 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "icinga/host.hpp"
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/convert.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
@@ -44,7 +44,7 @@ DbConnection::DbConnection(void)
 
 void DbConnection::OnConfigLoaded(void)
 {
-       DynamicObject::OnConfigLoaded();
+       ConfigObject::OnConfigLoaded();
 
        if (!GetEnableHa()) {
                Log(LogDebug, "DbConnection")
@@ -58,15 +58,15 @@ void DbConnection::OnConfigLoaded(void)
 
 void DbConnection::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
-       DynamicObject::OnActiveChanged.connect(boost::bind(&DbConnection::UpdateObject, this, _1));
+       ConfigObject::OnActiveChanged.connect(boost::bind(&DbConnection::UpdateObject, this, _1));
 }
 
 void DbConnection::Resume(void)
 {
-       DynamicObject::Resume();
+       ConfigObject::Resume();
 
        Log(LogInformation, "DbConnection")
            << "Resuming IDO connection: " << GetName();
@@ -79,7 +79,7 @@ void DbConnection::Resume(void)
 
 void DbConnection::Pause(void)
 {
-       DynamicObject::Pause();
+       ConfigObject::Pause();
 
        Log(LogInformation, "DbConnection")
             << "Pausing IDO connection: " << GetName();
@@ -167,10 +167,10 @@ void DbConnection::ProgramStatusHandler(void)
        query3.WhereCriteria->Set("instance_id", 0);  /* DbConnection class fills in real ID */
        DbObject::OnQuery(query3);
 
-       InsertRuntimeVariable("total_services", std::distance(DynamicType::GetObjectsByType<Service>().first, DynamicType::GetObjectsByType<Service>().second));
-       InsertRuntimeVariable("total_scheduled_services", std::distance(DynamicType::GetObjectsByType<Service>().first, DynamicType::GetObjectsByType<Service>().second));
-       InsertRuntimeVariable("total_hosts", std::distance(DynamicType::GetObjectsByType<Host>().first, DynamicType::GetObjectsByType<Host>().second));
-       InsertRuntimeVariable("total_scheduled_hosts", std::distance(DynamicType::GetObjectsByType<Host>().first, DynamicType::GetObjectsByType<Host>().second));
+       InsertRuntimeVariable("total_services", std::distance(ConfigType::GetObjectsByType<Service>().first, ConfigType::GetObjectsByType<Service>().second));
+       InsertRuntimeVariable("total_scheduled_services", std::distance(ConfigType::GetObjectsByType<Service>().first, ConfigType::GetObjectsByType<Service>().second));
+       InsertRuntimeVariable("total_hosts", std::distance(ConfigType::GetObjectsByType<Host>().first, ConfigType::GetObjectsByType<Host>().second));
+       InsertRuntimeVariable("total_scheduled_hosts", std::distance(ConfigType::GetObjectsByType<Host>().first, ConfigType::GetObjectsByType<Host>().second));
 
        Dictionary::Ptr vars = IcingaApplication::GetInstance()->GetVars();
 
@@ -378,7 +378,7 @@ void DbConnection::ExecuteQuery(const DbQuery&)
        /* Default handler does nothing. */
 }
 
-void DbConnection::UpdateObject(const DynamicObject::Ptr& object)
+void DbConnection::UpdateObject(const ConfigObject::Ptr& object)
 {
        if (!GetConnected())
                return;
@@ -400,9 +400,9 @@ void DbConnection::UpdateObject(const DynamicObject::Ptr& object)
 
 void DbConnection::UpdateAllObjects(void)
 {
-       DynamicType::Ptr type;
-       BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) {
+       ConfigType::Ptr type;
+       BOOST_FOREACH(const ConfigType::Ptr& dt, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, dt->GetObjects()) {
                        UpdateObject(object);
                }
        }
index f3b6b7e7ad35faff4864fc904270926e4c1977fc..ad71a016502cd5e7278740e2f1f22f594457f958 100644 (file)
@@ -90,7 +90,7 @@ protected:
        virtual void FillIDCache(const DbType::Ptr& type) = 0;
        virtual void NewTransaction(void) = 0;
 
-       void UpdateObject(const DynamicObject::Ptr& object);
+       void UpdateObject(const ConfigObject::Ptr& object);
        void UpdateAllObjects(void);
 
        void PrepareDatabase(void);
index 6d4f593bae86e0897b5c4eae249ebfe8a271c4c9..f1f2bef440eaf6be9bc7a8bbeb4488fc01c339b3 100644 (file)
  ******************************************************************************/
 
 #include "db_ido/dbquery.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library db_ido;
 
 namespace icinga
 {
 
-abstract class DbConnection : DynamicObject
+abstract class DbConnection : ConfigObject
 {
        [config] String table_prefix {
                default {{{ return "icinga_"; }}}
index 468d6fbeea4da97e7c0c96c056e29830a53518ba..77b13e5068a19803ad4d07becc6d869797012537 100644 (file)
@@ -23,7 +23,7 @@
 #include "base/convert.hpp"
 #include "base/objectlock.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/logger.hpp"
 #include "remote/endpoint.hpp"
@@ -340,7 +340,7 @@ void DbEvents::AddCommentInternal(const Checkable::Ptr& checkable, const Comment
        AddCommentByType(checkable, comment, historical);
 }
 
-void DbEvents::AddCommentByType(const DynamicObject::Ptr& object, const Comment::Ptr& comment, bool historical)
+void DbEvents::AddCommentByType(const ConfigObject::Ptr& object, const Comment::Ptr& comment, bool historical)
 {
        unsigned long entry_time = static_cast<long>(comment->GetEntryTime());
        unsigned long entry_time_usec = (comment->GetEntryTime() - entry_time) * 1000 * 1000;
@@ -351,11 +351,11 @@ void DbEvents::AddCommentByType(const DynamicObject::Ptr& object, const Comment:
        fields1->Set("entry_type", comment->GetEntryType());
        fields1->Set("object_id", object);
 
-       if (object->GetType() == DynamicType::GetByName("Host")) {
+       if (object->GetType() == ConfigType::GetByName("Host")) {
                fields1->Set("comment_type", 2);
                /* requires idoutils 1.10 schema fix */
                fields1->Set("internal_comment_id", comment->GetLegacyId());
-       } else if (object->GetType() == DynamicType::GetByName("Service")) {
+       } else if (object->GetType() == ConfigType::GetByName("Service")) {
                fields1->Set("comment_type", 1);
                fields1->Set("internal_comment_id", comment->GetLegacyId());
        } else {
@@ -500,11 +500,11 @@ void DbEvents::AddDowntimeByType(const Checkable::Ptr& checkable, const Downtime
        fields1->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime()));
        fields1->Set("object_id", checkable);
 
-       if (checkable->GetType() == DynamicType::GetByName("Host")) {
+       if (checkable->GetType() == ConfigType::GetByName("Host")) {
                fields1->Set("downtime_type", 2);
                /* requires idoutils 1.10 schema fix */
                fields1->Set("internal_downtime_id", downtime->GetLegacyId());
-       } else if (checkable->GetType() == DynamicType::GetByName("Service")) {
+       } else if (checkable->GetType() == ConfigType::GetByName("Service")) {
                fields1->Set("downtime_type", 1);
                fields1->Set("internal_downtime_id", downtime->GetLegacyId());
        } else {
index 5052d4407b63aea72de25e6dbe573987a3b4f036..c1c3b7b7dde80cfa3160e922b922f6949a0763b1 100644 (file)
@@ -21,7 +21,7 @@
 #define DBEVENTS_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "icinga/service.hpp"
 
 namespace icinga
@@ -61,7 +61,7 @@ class DbEvents
 public:
        static void StaticInitialize(void);
 
-       static void AddCommentByType(const DynamicObject::Ptr& object, const Comment::Ptr& comment, bool historical);
+       static void AddCommentByType(const ConfigObject::Ptr& object, const Comment::Ptr& comment, bool historical);
        static void AddComments(const Checkable::Ptr& checkable);
        static void RemoveComments(const Checkable::Ptr& checkable);
 
index 32a89f85561cb7976ef5836100bf539c18438e68..1689e91dc3afd9e79647284d6b412026fce24b64 100644 (file)
@@ -24,8 +24,8 @@
 #include "icinga/service.hpp"
 #include "icinga/compatutility.hpp"
 #include "remote/endpoint.hpp"
-#include "base/dynamicobject.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configobject.hpp"
+#include "base/configtype.hpp"
 #include "base/json.hpp"
 #include "base/convert.hpp"
 #include "base/objectlock.hpp"
@@ -47,16 +47,16 @@ DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const
 void DbObject::StaticInitialize(void)
 {
        /* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
-       DynamicObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
+       ConfigObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
        CustomVarObject::OnVarsChanged.connect(boost::bind(&DbObject::VarsChangedHandler, _1));
 }
 
-void DbObject::SetObject(const DynamicObject::Ptr& object)
+void DbObject::SetObject(const ConfigObject::Ptr& object)
 {
        m_Object = object;
 }
 
-DynamicObject::Ptr DbObject::GetObject(void) const
+ConfigObject::Ptr DbObject::GetObject(void) const
 {
        return m_Object;
 }
@@ -150,7 +150,7 @@ void DbObject::SendStatusUpdate(void)
 
 void DbObject::SendVarsConfigUpdate(void)
 {
-       DynamicObject::Ptr obj = GetObject();
+       ConfigObject::Ptr obj = GetObject();
 
        CustomVarObject::Ptr custom_var_object = dynamic_pointer_cast<CustomVarObject>(obj);
 
@@ -205,7 +205,7 @@ void DbObject::SendVarsConfigUpdate(void)
 
 void DbObject::SendVarsStatusUpdate(void)
 {
-       DynamicObject::Ptr obj = GetObject();
+       ConfigObject::Ptr obj = GetObject();
 
        CustomVarObject::Ptr custom_var_object = dynamic_pointer_cast<CustomVarObject>(obj);
 
@@ -289,7 +289,7 @@ void DbObject::OnStatusUpdate(void)
        /* Default handler does nothing. */
 }
 
-DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object)
+DbObject::Ptr DbObject::GetOrCreateByObject(const ConfigObject::Ptr& object)
 {
        boost::mutex::scoped_lock lock(GetStaticMutex());
 
@@ -314,9 +314,9 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object)
                name1 = service->GetHost()->GetName();
                name2 = service->GetShortName();
        } else {
-               if (object->GetType() == DynamicType::GetByName("CheckCommand") ||
-                   object->GetType() == DynamicType::GetByName("EventCommand") ||
-                   object->GetType() == DynamicType::GetByName("NotificationCommand")) {
+               if (object->GetType() == ConfigType::GetByName("CheckCommand") ||
+                   object->GetType() == ConfigType::GetByName("EventCommand") ||
+                   object->GetType() == ConfigType::GetByName("NotificationCommand")) {
                        Command::Ptr command = dynamic_pointer_cast<Command>(object);
                        name1 = CompatUtility::GetCommandName(command);
                }
@@ -332,7 +332,7 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object)
        return dbobj;
 }
 
-void DbObject::StateChangedHandler(const DynamicObject::Ptr& object)
+void DbObject::StateChangedHandler(const ConfigObject::Ptr& object)
 {
        DbObject::Ptr dbobj = GetOrCreateByObject(object);
 
index 296629ae262e2a160ae3c5e6a273323c35822482..9e808b68f2136eedeec9c3f16dfcf259f845f078 100644 (file)
@@ -25,7 +25,7 @@
 #include "db_ido/dbquery.hpp"
 #include "db_ido/dbtype.hpp"
 #include "icinga/customvarobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
@@ -66,8 +66,8 @@ public:
 
        static void StaticInitialize(void);
 
-       void SetObject(const DynamicObject::Ptr& object);
-       DynamicObject::Ptr GetObject(void) const;
+       void SetObject(const ConfigObject::Ptr& object);
+       ConfigObject::Ptr GetObject(void) const;
 
        String GetName1(void) const;
        String GetName2(void) const;
@@ -76,7 +76,7 @@ public:
        virtual Dictionary::Ptr GetConfigFields(void) const = 0;
        virtual Dictionary::Ptr GetStatusFields(void) const = 0;
 
-       static DbObject::Ptr GetOrCreateByObject(const DynamicObject::Ptr& object);
+       static DbObject::Ptr GetOrCreateByObject(const ConfigObject::Ptr& object);
 
        static boost::signals2::signal<void (const DbQuery&)> OnQuery;
 
@@ -100,11 +100,11 @@ private:
        String m_Name1;
        String m_Name2;
        intrusive_ptr<DbType> m_Type;
-       DynamicObject::Ptr m_Object;
+       ConfigObject::Ptr m_Object;
        double m_LastConfigUpdate;
        double m_LastStatusUpdate;
 
-       static void StateChangedHandler(const DynamicObject::Ptr& object);
+       static void StateChangedHandler(const ConfigObject::Ptr& object);
        static void VarsChangedHandler(const CustomVarObject::Ptr& object);
        static boost::mutex& GetStaticMutex(void);
 
index ec06d1a36a7681b6ae176efd28ce3682564a79ae..dcab8771bd0b23a6ec47b3bfdbd0cf4bda5c27c3 100644 (file)
@@ -23,7 +23,7 @@
 #include "db_ido/i2-db_ido.hpp"
 #include "icinga/customvarobject.hpp"
 #include "base/dictionary.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index 21fa9ae25817658cdbf44d9e7881ce22afbbed3a..db024f4cb29a8cf37568306bdbbca263a8655de0 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "base/objectlock.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
 #include "base/logger.hpp"
index 66f6555ea85af1cccdd0698090f265c64ee00f64..f468c7e72359494997167e288cff41774dc1fe11 100644 (file)
@@ -21,7 +21,7 @@
 #define ENDPOINTDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "remote/endpoint.hpp"
 
 namespace icinga
index 2dddea375c45cdd9c23daa2d079b6ebde283d03a..f3d1fc6957438a0759b8a65aca3c4e64c4db07a4 100644 (file)
@@ -21,7 +21,7 @@
 #define HOSTDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index ad771f29892df81df9b257a3129f5b3b40d52c15..9d96af5f59fbe4e8fe3ef9dc9f0f2e1b00eeb0be 100644 (file)
@@ -22,7 +22,7 @@
 #include "db_ido/dbvalue.hpp"
 #include "base/objectlock.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
index fab7b1e26e17f2951b131eb2dc2dff3435b328cd..5544cd861d2762094aadfb3962256dab9d323c2b 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "db_ido/dbobject.hpp"
 #include "icinga/hostgroup.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index 7020ef4becac8108191b1721057b6da19558b13e..6e70b91b8baaac5b67966a8965219b7fa06ff9f0 100644 (file)
@@ -27,7 +27,7 @@
 #include "remote/zone.hpp"
 #include "base/function.hpp"
 #include "base/utility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/convert.hpp"
 #include <boost/foreach.hpp>
 
@@ -87,7 +87,7 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
                return;
        }
 
-       DynamicType::Ptr dtype = DynamicType::GetByName(idoType);
+       ConfigType::Ptr dtype = ConfigType::GetByName(idoType);
        VERIFY(dtype);
 
        DbConnection::Ptr conn = static_pointer_cast<DbConnection>(dtype->GetObject(idoName));
index bae4b3f54d86866d6c931a068e6af24738e6ac3c..3791d4632fda2b9a5d99b908a71fc93025e48c32 100644 (file)
@@ -32,7 +32,7 @@
 #include "base/convert.hpp"
 #include "base/objectlock.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/logger.hpp"
 #include <boost/foreach.hpp>
index e43b636be75b5974ac7b4edd1a43e92ad5e1540c..ccc289e6c299ce0326ef6f8f30e1a0cf3a9e4205 100644 (file)
@@ -21,7 +21,7 @@
 #define SERVICEDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "icinga/service.hpp"
 
 namespace icinga
index 274565258acb41f7d9062ab6fdd008be1a08ec40..4d7a1971a8ba46527244e90fab76fcedc6b0f827 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "db_ido/dbobject.hpp"
 #include "icinga/servicegroup.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index d94eb9362387951cf52a2ca492a9002e3b5ba703..4bedf7f5d2938c0d0cfeedee3d744f465ba15b29 100644 (file)
@@ -21,7 +21,7 @@
 #define TIMEPERIODDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index 8f41ba1fa37b53b9833228d6e205fd47bd2cc314..2ea254ef05cf9f0521247d3c5c6aec054ffcf0bd 100644 (file)
@@ -21,7 +21,7 @@
 #define USERDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index 651047ed28ac492cdbb3b99d81e09f1daf725f5a..d124d8d734409831809bcba549ffaa9029f78472 100644 (file)
@@ -22,7 +22,7 @@
 #include "db_ido/dbvalue.hpp"
 #include "base/objectlock.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
index a33ebf9b276cac9677065d9ac87068bf91e8a668..d56ec2536ad507c40efced95b9b7b75719db99d4 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "db_ido/dbobject.hpp"
 #include "icinga/usergroup.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 namespace icinga
 {
index c0a1395e12852f78ad56cb8e984c3d50ed3737b2..59b5f3989de40f09e4483877bc87eb83edd213db 100644 (file)
@@ -21,7 +21,7 @@
 #define ZONEDBOBJECT_H
 
 #include "db_ido/dbobject.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "remote/zone.hpp"
 
 namespace icinga
index 8834d5200f0793d186fe60b87dd69bc796f2d5c8..93a811af8a965a15f4e7ccf95199531eca4f316f 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/convert.hpp"
 #include "base/utility.hpp"
 #include "base/application.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/exception.hpp"
 #include "base/statsfunction.hpp"
 #include <boost/tuple/tuple.hpp>
@@ -47,7 +47,7 @@ void IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::P
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const IdoMysqlConnection::Ptr& idomysqlconnection, DynamicType::GetObjectsByType<IdoMysqlConnection>()) {
+       BOOST_FOREACH(const IdoMysqlConnection::Ptr& idomysqlconnection, ConfigType::GetObjectsByType<IdoMysqlConnection>()) {
                size_t items = idomysqlconnection->m_QueryQueue.GetLength();
 
                Dictionary::Ptr stats = new Dictionary();
@@ -672,7 +672,7 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
 
        Value rawvalue = DbValue::ExtractValue(value);
 
-       if (rawvalue.IsObjectType<DynamicObject>()) {
+       if (rawvalue.IsObjectType<ConfigObject>()) {
                DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
 
                if (!dbobjcol) {
index 729ff4c1b26da8e9c859259a6ca69d6fb9a72ea9..db9e7a6edd487e780858f8faab1b607558e29c28 100644 (file)
@@ -27,7 +27,7 @@
 #include "base/convert.hpp"
 #include "base/utility.hpp"
 #include "base/application.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/exception.hpp"
 #include "base/context.hpp"
 #include "base/statsfunction.hpp"
@@ -48,7 +48,7 @@ void IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::P
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const IdoPgsqlConnection::Ptr& idopgsqlconnection, DynamicType::GetObjectsByType<IdoPgsqlConnection>()) {
+       BOOST_FOREACH(const IdoPgsqlConnection::Ptr& idopgsqlconnection, ConfigType::GetObjectsByType<IdoPgsqlConnection>()) {
                size_t items = idopgsqlconnection->m_QueryQueue.GetLength();
 
                Dictionary::Ptr stats = new Dictionary();
@@ -545,7 +545,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
 
        Value rawvalue = DbValue::ExtractValue(value);
 
-       if (rawvalue.IsObjectType<DynamicObject>()) {
+       if (rawvalue.IsObjectType<ConfigObject>()) {
                DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
 
                if (!dbobjcol) {
index fe2d9419d8ff487c5dab43516c636db1d9a79a20..221a138b4f454db37eaaa2abb52de8442a2edb20 100644 (file)
@@ -21,7 +21,7 @@
 #include "demo/demo.tcpp"
 #include "remote/apilistener.hpp"
 #include "remote/apifunction.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 
 using namespace icinga;
@@ -35,7 +35,7 @@ REGISTER_APIFUNCTION(HelloWorld, demo, &Demo::DemoMessageHandler);
  */
 void Demo::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_DemoTimer = new Timer();
        m_DemoTimer->SetInterval(5);
@@ -54,7 +54,7 @@ void Demo::DemoTimerHandler(void)
        ApiListener::Ptr listener = ApiListener::GetInstance();
        if (listener) {
                MessageOrigin::Ptr origin = new MessageOrigin();
-               listener->RelayMessage(origin, DynamicObject::Ptr(), message, true);
+               listener->RelayMessage(origin, ConfigObject::Ptr(), message, true);
                Log(LogInformation, "Demo", "Sent demo::HelloWorld message");
        }
 }
index 0fd373c606cf66d7fa2c9f22a713e14ed31b2afb..2f52e6d45522282154cdf5bdc1032664cfb2e2fc 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library demo;
 
 namespace icinga
 {
 
-class Demo : DynamicObject
+class Demo : ConfigObject
 {
 };
 
index 1c2691aa73487d35f4cf9690053c96ade06ca660..11440d142470868fd768fe424ba3c0f9d6fceae2 100644 (file)
@@ -37,7 +37,7 @@ Dictionary::Ptr ApiActions::CreateResult(const int code, const String& status) {
 REGISTER_APIACTION(reschedule_check, "Service;Host", &ApiActions::RescheduleCheck);
 REGISTER_APIACTION(process_check_result, "Service;Host", &ApiActions::ProcessCheckResult);
 
-Dictionary::Ptr ApiActions::RescheduleCheck(const DynamicObject::Ptr& object, const Dictionary::Ptr& params)
+Dictionary::Ptr ApiActions::RescheduleCheck(const ConfigObject::Ptr& object, const Dictionary::Ptr& params)
 {
        Checkable::Ptr checkable = static_pointer_cast<Checkable>(object);
 
@@ -58,7 +58,7 @@ Dictionary::Ptr ApiActions::RescheduleCheck(const DynamicObject::Ptr& object, co
        return ApiActions::CreateResult(200, "Successfully rescheduled check for " + checkable->GetName());
 }
 
-Dictionary::Ptr ApiActions::ProcessCheckResult(const DynamicObject::Ptr& object, const Dictionary::Ptr& params)
+Dictionary::Ptr ApiActions::ProcessCheckResult(const ConfigObject::Ptr& object, const Dictionary::Ptr& params)
 {
        Checkable::Ptr checkable = static_pointer_cast<Checkable>(object);
 
index 7682276d075c5bcd46635a55e98b79ae1c0a38d4..9dbb1681b2486d113b741108651f1f40f78ed75b 100644 (file)
@@ -21,7 +21,7 @@
 #define APIACTIONS_H
 
 #include "icinga/i2-icinga.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/dictionary.hpp"
 
 namespace icinga
@@ -33,8 +33,8 @@ namespace icinga
 class I2_ICINGA_API ApiActions
 {
 public:
-       static Dictionary::Ptr RescheduleCheck(const DynamicObject::Ptr& object, const Dictionary::Ptr& params);
-       static Dictionary::Ptr ProcessCheckResult(const DynamicObject::Ptr& object, const Dictionary::Ptr& params);
+       static Dictionary::Ptr RescheduleCheck(const ConfigObject::Ptr& object, const Dictionary::Ptr& params);
+       static Dictionary::Ptr ProcessCheckResult(const ConfigObject::Ptr& object, const Dictionary::Ptr& params);
 
 private:
        static Dictionary::Ptr CreateResult(const int code, const String& status);
index e352db69e3285f26be3923c01a993f2d1acc7308..8a5e4932e8dfb00846ca8bb9ae42f4914286ae69 100644 (file)
@@ -26,7 +26,7 @@
 #include "remote/zone.hpp"
 #include "remote/apifunction.hpp"
 #include "base/application.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/exception.hpp"
 #include "base/initialize.hpp"
@@ -1241,7 +1241,7 @@ void ApiEvents::VarsChangedHandler(const CustomVarObject::Ptr& object, const Mes
        Dictionary::Ptr params = new Dictionary();
        params->Set("object", object->GetName());
 
-       DynamicType::Ptr dtype = object->GetType();
+       ConfigType::Ptr dtype = object->GetType();
        ASSERT(dtype);
 
        params->Set("object_type", dtype->GetName());
@@ -1295,7 +1295,7 @@ Value ApiEvents::VarsChangedAPIHandler(const MessageOrigin::Ptr& origin, const D
                if (!object)
                        object = NotificationCommand::GetByName(objectName);
        } else {
-               DynamicType::Ptr dtype = DynamicType::GetByName(objectType);
+               ConfigType::Ptr dtype = ConfigType::GetByName(objectType);
 
                if (!dtype)
                        return Empty;
@@ -1847,7 +1847,7 @@ void ApiEvents::RepositoryTimerHandler(void)
 
        Dictionary::Ptr repository = new Dictionary();
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                Array::Ptr services = new Array();
 
                BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
index f957df2d788d6b3cce9c785aaa75e258ad1e09be..89ea47611f05aa8a4eb09d35912b11be692de4bb 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/timer.hpp"
 #include "base/utility.hpp"
@@ -234,11 +234,11 @@ void Checkable::RemoveExpiredComments(void)
 
 void Checkable::CommentsExpireTimerHandler(void)
 {
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                host->RemoveExpiredComments();
        }
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                service->RemoveExpiredComments();
        }
 }
index 2dd058058c59cbd4110ba0878949c968a3df55e1..5f1f68f0a64abbced05278e92a4151fdf74da993 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/timer.hpp"
@@ -321,11 +321,11 @@ void Checkable::RemoveExpiredDowntimes(void)
 
 void Checkable::DowntimesExpireTimerHandler(void)
 {
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                host->RemoveExpiredDowntimes();
        }
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                service->RemoveExpiredDowntimes();
        }
 }
index f26631e0b36b0c558d764ea1908bdc000134dcb7..bccb68fed7e6efe47f2cec1174d0488728ff318e 100644 (file)
@@ -47,7 +47,7 @@ void Checkable::Start(void)
        if (GetNextCheck() < now + 300)
                UpdateNextCheck();
 
-       DynamicObject::Start();
+       ConfigObject::Start();
 }
 
 void Checkable::OnStateLoaded(void)
index 26e39984ecb90ba61ff5e3a0116fd98bbe3f3588..a9b7cc6ca37b3078d9235fbbbb601dfb95505f36 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "icinga/checkcommand.hpp"
 #include "icinga/checkcommand.tcpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 
 using namespace icinga;
 
index 5b106d2bbf9da13e2c4dae4e23a048c6ee738d68..5f8aabd3ae8f532286a0f0c32730af326ae93d96 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/service.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/statsfunction.hpp"
 #include <boost/foreach.hpp>
 
@@ -80,7 +80,7 @@ CheckableCheckStatistics CIB::CalculateHostCheckStats(void)
        double min_execution_time = -1, max_execution_time = 0, sum_execution_time = 0;
        int count_execution_time = 0;
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                ObjectLock olock(host);
 
                CheckResult::Ptr cr = host->GetLastCheckResult();
@@ -129,7 +129,7 @@ CheckableCheckStatistics CIB::CalculateServiceCheckStats(void)
        double min_execution_time = -1, max_execution_time = 0, sum_execution_time = 0;
        int count_execution_time = 0;
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                ObjectLock olock(service);
 
                CheckResult::Ptr cr = service->GetLastCheckResult();
@@ -175,7 +175,7 @@ ServiceStatistics CIB::CalculateServiceStats(void)
 {
        ServiceStatistics ss = {0};
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                ObjectLock olock(service);
 
                CheckResult::Ptr cr = service->GetLastCheckResult();
@@ -209,7 +209,7 @@ HostStatistics CIB::CalculateHostStats(void)
 {
        HostStatistics hs = {0};
 
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                ObjectLock olock(host);
 
                if (host->IsReachable()) {
index ce6f8576efb1807777d020d88e937bd2a077a96f..bdbfcc50e27f63c8aaaf6e5156a3aa68aecbc742 100644 (file)
@@ -20,7 +20,7 @@
 #include "icinga/comment.hpp"
 #include "icinga/comment.tcpp"
 #include "base/utility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 
 using namespace icinga;
 
index b88aafe9b0b58e3131be0b19b692fbe17c313d7a..11bb2370ecfab1844d2df9ed916354bf00bab584 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/pluginutility.hpp"
 #include "icinga/service.hpp"
 #include "base/utility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include <boost/foreach.hpp>
@@ -62,11 +62,11 @@ String CompatUtility::GetCommandNamePrefix(const Command::Ptr command)
                return Empty;
 
        String prefix;
-       if (command->GetType() == DynamicType::GetByName("CheckCommand"))
+       if (command->GetType() == ConfigType::GetByName("CheckCommand"))
                prefix = "check_";
-       else if (command->GetType() == DynamicType::GetByName("NotificationCommand"))
+       else if (command->GetType() == ConfigType::GetByName("NotificationCommand"))
                prefix = "notification_";
-       else if (command->GetType() == DynamicType::GetByName("EventCommand"))
+       else if (command->GetType() == ConfigType::GetByName("EventCommand"))
                prefix = "event_";
 
        return prefix;
@@ -376,12 +376,12 @@ Array::Ptr CompatUtility::GetModifiedAttributesList(const CustomVarObject::Ptr&
 {
        Array::Ptr mod_attr_list = new Array();
 
-       if (object->GetType() != DynamicType::GetByName("Host") &&
-           object->GetType() != DynamicType::GetByName("Service") &&
-           object->GetType() != DynamicType::GetByName("User") &&
-           object->GetType() != DynamicType::GetByName("CheckCommand") &&
-           object->GetType() != DynamicType::GetByName("EventCommand") &&
-           object->GetType() != DynamicType::GetByName("NotificationCommand"))
+       if (object->GetType() != ConfigType::GetByName("Host") &&
+           object->GetType() != ConfigType::GetByName("Service") &&
+           object->GetType() != ConfigType::GetByName("User") &&
+           object->GetType() != ConfigType::GetByName("CheckCommand") &&
+           object->GetType() != ConfigType::GetByName("EventCommand") &&
+           object->GetType() != ConfigType::GetByName("NotificationCommand"))
                return mod_attr_list;
 
        int flags = object->GetModifiedAttributes();
index 41327fe71d163e6fad130575db73eba7c65d3f16..46dd59d17da82fa27d9f5288aff8fb02898141e4 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "icinga/i2-icinga.hpp"
 #include "icinga/customvarobject.thpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "remote/messageorigin.hpp"
 
 namespace icinga
index ee6a915c7261bb5a235a0d65f898283a3a6322c5..d4d027178e1c7eee23dd79752b6131c9b6fa3c59 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library icinga;
 
 namespace icinga
 {
 
-abstract class CustomVarObject : DynamicObject
+abstract class CustomVarObject : ConfigObject
 {
        [config] Dictionary::Ptr vars;
 };
index 9f86befc50d8a2f74b01fbbbbf44005fdf1532e7..8f650fd7a174d847d762692b7484b426e2c07daa 100644 (file)
@@ -22,7 +22,7 @@
 #include "config/configitembuilder.hpp"
 #include "config/applyrule.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
 #include "base/workqueue.hpp"
index fc1545e125606829a0e18a08ab542a5071440a32..de7ebf390daead15c8ca0f42eff49a8d9bb2614f 100644 (file)
@@ -82,7 +82,7 @@ void Dependency::OnConfigLoaded(void)
 
 void Dependency::OnAllConfigLoaded(void)
 {
-       DynamicObject::OnAllConfigLoaded();
+       ConfigObject::OnAllConfigLoaded();
 
        Host::Ptr childHost = Host::GetByName(GetChildHostName());
 
@@ -125,7 +125,7 @@ void Dependency::OnAllConfigLoaded(void)
 
 void Dependency::Stop(void)
 {
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 
        GetChild()->RemoveDependency(this);
        GetParent()->RemoveReverseDependency(this);
index c6e00962829f629f4f11f974b59ec0d561c7d5f6..fdf495aa16fd085f0d2190cf4b3bdc6b4d600be7 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/hostgroup.tcpp"
 #include "config/objectrule.hpp"
 #include "config/configitem.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/objectlock.hpp"
 #include "base/context.hpp"
index e7920b4d2618343249cf1b96ced65beba94efaa9..e7b827f3231fe41a7a47fb2c685259403ca46e5c 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/icingaapplication.tcpp"
 #include "icinga/cib.hpp"
 #include "config/configwriter.cpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
@@ -69,7 +69,7 @@ void IcingaApplication::StatsFunc(const Dictionary::Ptr& status, const Array::Pt
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const IcingaApplication::Ptr& icingaapplication, DynamicType::GetObjectsByType<IcingaApplication>()) {
+       BOOST_FOREACH(const IcingaApplication::Ptr& icingaapplication, ConfigType::GetObjectsByType<IcingaApplication>()) {
                Dictionary::Ptr stats = new Dictionary();
                stats->Set("node_name", icingaapplication->GetNodeName());
                stats->Set("enable_notifications", icingaapplication->GetEnableNotifications());
@@ -138,7 +138,7 @@ void IcingaApplication::OnShutdown(void)
        DumpProgramState();
 }
 
-static void PersistModAttrHelper(const ConfigWriter::Ptr& cw, DynamicObject::Ptr& previousObject, const DynamicObject::Ptr& object, const String& attr, const Value& value)
+static void PersistModAttrHelper(const ConfigWriter::Ptr& cw, ConfigObject::Ptr& previousObject, const ConfigObject::Ptr& object, const String& attr, const Value& value)
 {
        if (object != previousObject) {
                if (previousObject)
@@ -168,11 +168,11 @@ static void PersistModAttrHelper(const ConfigWriter::Ptr& cw, DynamicObject::Ptr
 
 void IcingaApplication::DumpProgramState(void)
 {
-       DynamicObject::DumpObjects(GetStatePath());
+       ConfigObject::DumpObjects(GetStatePath());
 
        ConfigWriter::Ptr cw = new ConfigWriter(GetModAttrPath());
-       DynamicObject::Ptr previousObject;
-       DynamicObject::DumpModifiedAttributes(boost::bind(&PersistModAttrHelper, cw, boost::ref(previousObject), _1, _2, _3));
+       ConfigObject::Ptr previousObject;
+       ConfigObject::DumpModifiedAttributes(boost::bind(&PersistModAttrHelper, cw, boost::ref(previousObject), _1, _2, _3));
 
        if (previousObject)
                cw->EmitRaw("\n}\n");
index f01ec47545d502b4a1639c3af96bc4e4e0a106e0..b9963783c4f05d847a7714c5055ef23b94091756 100644 (file)
@@ -20,7 +20,7 @@
 #include "icinga/icingastatuswriter.hpp"
 #include "icinga/icingastatuswriter.tcpp"
 #include "icinga/cib.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/exception.hpp"
 #include "base/application.hpp"
@@ -40,7 +40,7 @@ void IcingaStatusWriter::StatsFunc(const Dictionary::Ptr& status, const Array::P
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const IcingaStatusWriter::Ptr& icingastatuswriter, DynamicType::GetObjectsByType<IcingaStatusWriter>()) {
+       BOOST_FOREACH(const IcingaStatusWriter::Ptr& icingastatuswriter, ConfigType::GetObjectsByType<IcingaStatusWriter>()) {
                nodes->Set(icingastatuswriter->GetName(), 1); //add more stats
        }
 
@@ -58,7 +58,7 @@ void IcingaStatusWriter::StatsFunc(const Dictionary::Ptr& status, const Array::P
  */
 void IcingaStatusWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_StatusTimer = new Timer();
        m_StatusTimer->SetInterval(GetUpdateInterval());
index f99c8ae0d90f6e9c2aa04f66bb0bba482634e472..1421dcce7bb6ced9eeb480366ab49fdd8a050d22 100644 (file)
@@ -25,7 +25,7 @@ library icinga;
 namespace icinga
 {
 
-class IcingaStatusWriter : DynamicObject
+class IcingaStatusWriter : ConfigObject
 {
        [config] String status_path {
                default {{{ return Application::GetLocalStateDir() + "/cache/icinga2/status.json"; }}}
index e6a72252b9d6a673609e4f0e64ea497043548aae..07f38b42917ecddae24449e6c2a8010e2eeb266e 100644 (file)
@@ -24,7 +24,7 @@
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/scriptframe.hpp"
 #include <boost/foreach.hpp>
 #include <boost/algorithm/string/split.hpp>
index 707cf59d7b5206c5cf549034d29f7d5941be0458..9d46b49d71715e1096cd9a07ccdc84716bcc1ec1 100644 (file)
@@ -22,7 +22,7 @@
 #include "config/configitembuilder.hpp"
 #include "config/applyrule.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
 #include "base/workqueue.hpp"
index 45ba8ba439cdd44c4d1a70776dd7c326b2f7197b..5488345c52930188247afbef4f273fa6ea45b88f 100644 (file)
@@ -115,7 +115,7 @@ void Notification::OnAllConfigLoaded(void)
 
 void Notification::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        Checkable::Ptr obj = GetCheckable();
 
@@ -125,7 +125,7 @@ void Notification::Start(void)
 
 void Notification::Stop(void)
 {
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 
        Checkable::Ptr obj = GetCheckable();
 
index ebbb631dae690f866442d550e8bfdec7e2cb2126..9088d7bb1afc243e1405d34f9ada3189ba8df613 100644 (file)
@@ -22,7 +22,7 @@
 #include "config/configitembuilder.hpp"
 #include "config/applyrule.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
 #include "base/exception.hpp"
index 21d14f477bb9a729eb94c8460d138abcee892099..908493fb0b36c6301f97bc1f4f4fe1a4cb5222b0 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/downtime.hpp"
 #include "icinga/service.hpp"
 #include "base/timer.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/initialize.hpp"
 #include "base/utility.hpp"
 #include "base/objectlock.hpp"
@@ -98,14 +98,14 @@ void ScheduledDowntime::OnAllConfigLoaded(void)
 
 void ScheduledDowntime::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        CreateNextDowntime();
 }
 
 void ScheduledDowntime::TimerProc(void)
 {
-       BOOST_FOREACH(const ScheduledDowntime::Ptr& sd, DynamicType::GetObjectsByType<ScheduledDowntime>()) {
+       BOOST_FOREACH(const ScheduledDowntime::Ptr& sd, ConfigType::GetObjectsByType<ScheduledDowntime>()) {
                sd->CreateNextDowntime();
        }
 }
index 00baa5e65bbd50c9390b87845d899b7a3bf57a75..b6373c5e1ef2ebbb7ef5e7d1c87c9b48486686a1 100644 (file)
@@ -21,7 +21,7 @@
 #include "config/configitembuilder.hpp"
 #include "config/applyrule.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
 #include "base/workqueue.hpp"
index 5513889dca39425906f2f8bbb39b4fc54c5bd614..8e4a393045bb24761a95c2d1f23f873a2cd5259b 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/servicegroup.tcpp"
 #include "config/objectrule.hpp"
 #include "config/configitem.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
index 2611a7ed31b55611e81e5db06848de1c57f94fd1..7a37ee80af2f6ff4965cc14611fdb7e3ce52addf 100644 (file)
@@ -20,7 +20,7 @@
 #include "icinga/timeperiod.hpp"
 #include "icinga/timeperiod.tcpp"
 #include "icinga/legacytimeperiod.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/exception.hpp"
 #include "base/logger.hpp"
@@ -46,7 +46,7 @@ void TimePeriod::StaticInitialize(void)
 
 void TimePeriod::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        /* Pre-fill the time period for the next 24 hours. */
        double now = Utility::GetTime();
@@ -268,7 +268,7 @@ void TimePeriod::UpdateTimerHandler(void)
 {
        double now = Utility::GetTime();
 
-       BOOST_FOREACH(const TimePeriod::Ptr& tp, DynamicType::GetObjectsByType<TimePeriod>()) {
+       BOOST_FOREACH(const TimePeriod::Ptr& tp, ConfigType::GetObjectsByType<TimePeriod>()) {
                double valid_end;
 
                {
index 073bd9d615000dcb9cd887d8398fb61aa0fb10a9..ff4d9661fd8f503eaac34044a45c3099f54d087b 100644 (file)
@@ -32,7 +32,7 @@ REGISTER_TYPE(User);
 
 void User::OnConfigLoaded(void)
 {
-       DynamicObject::OnConfigLoaded();
+       ConfigObject::OnConfigLoaded();
 
        SetTypeFilter(FilterArrayToInt(GetTypes(), ~0));
        SetStateFilter(FilterArrayToInt(GetStates(), ~0));
@@ -40,7 +40,7 @@ void User::OnConfigLoaded(void)
 
 void User::OnAllConfigLoaded(void)
 {
-       DynamicObject::OnAllConfigLoaded();
+       ConfigObject::OnAllConfigLoaded();
 
        UserGroup::EvaluateObjectRules(this);
 
@@ -62,7 +62,7 @@ void User::OnAllConfigLoaded(void)
 
 void User::Stop(void)
 {
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 
        Array::Ptr groups = GetGroups();
 
index 82bc4b518668dae1a6487035d6ef5ec5a9092455..f122b231c715c7aa8f96ee1ad8aea250a6ff1529 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/usergroup.tcpp"
 #include "config/objectrule.hpp"
 #include "config/configitem.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/context.hpp"
index 349d6068bd73e0a0925ab931c31c3403442b57f8..f8e7c133e184d1800b8274bac913cdb8075c299f 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/eventcommand.hpp"
 #include "icinga/notificationcommand.hpp"
 #include "icinga/compatutility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include <boost/foreach.hpp>
@@ -60,17 +60,17 @@ String CommandsTable::GetPrefix(void) const
 
 void CommandsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjectsByType<CheckCommand>()) {
+       BOOST_FOREACH(const ConfigObject::Ptr& object, ConfigType::GetObjectsByType<CheckCommand>()) {
                if (!addRowFn(object, LivestatusGroupByNone, Empty))
                        return;
        }
 
-       BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjectsByType<EventCommand>()) {
+       BOOST_FOREACH(const ConfigObject::Ptr& object, ConfigType::GetObjectsByType<EventCommand>()) {
                if (!addRowFn(object, LivestatusGroupByNone, Empty))
                        return;
        }
 
-       BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjectsByType<NotificationCommand>()) {
+       BOOST_FOREACH(const ConfigObject::Ptr& object, ConfigType::GetObjectsByType<NotificationCommand>()) {
                if (!addRowFn(object, LivestatusGroupByNone, Empty))
                        return;
        }
index a9b297864dad694fabe70fc19031d0197c17c9a5..c182c84d4e886aa3eab0a579d0c20135c9342a76 100644 (file)
@@ -21,7 +21,7 @@
 #include "livestatus/hoststable.hpp"
 #include "livestatus/servicestable.hpp"
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include <boost/tuple/tuple.hpp>
 #include <boost/foreach.hpp>
@@ -65,7 +65,7 @@ String CommentsTable::GetPrefix(void) const
 
 void CommentsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                Dictionary::Ptr comments = host->GetComments();
 
                ObjectLock olock(comments);
@@ -80,7 +80,7 @@ void CommentsTable::FetchRows(const AddRowFunction& addRowFn)
                }
        }
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                Dictionary::Ptr comments = service->GetComments();
 
                ObjectLock olock(comments);
index c1f9b6c030bd2068ebb5479faad7af30f2b18c59..fdf8074418b3b79b614def9c80eb6fd60b5ff7ee 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "livestatus/contactgroupstable.hpp"
 #include "icinga/usergroup.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -49,7 +49,7 @@ String ContactGroupsTable::GetPrefix(void) const
 
 void ContactGroupsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const UserGroup::Ptr& ug, DynamicType::GetObjectsByType<UserGroup>()) {
+       BOOST_FOREACH(const UserGroup::Ptr& ug, ConfigType::GetObjectsByType<UserGroup>()) {
                if (!addRowFn(ug, LivestatusGroupByNone, Empty))
                        return;
        }
index e557ae89f3e09921792ff3e4f4cf680bdd0a1362..490ca5e6868c5b4b033f65f4c8ddc1c5232144de 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/user.hpp"
 #include "icinga/timeperiod.hpp"
 #include "icinga/compatutility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/json.hpp"
 #include "base/utility.hpp"
@@ -70,7 +70,7 @@ String ContactsTable::GetPrefix(void) const
 
 void ContactsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const User::Ptr& user, DynamicType::GetObjectsByType<User>()) {
+       BOOST_FOREACH(const User::Ptr& user, ConfigType::GetObjectsByType<User>()) {
                if (!addRowFn(user, LivestatusGroupByNone, Empty))
                        return;
        }
index e9b8ed7c9eb3e13461c60bc0528fc58028e07d00..0bfc301e9656f19a7ac2926eaa83407318a94108 100644 (file)
@@ -21,7 +21,7 @@
 #include "livestatus/hoststable.hpp"
 #include "livestatus/servicestable.hpp"
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include <boost/tuple/tuple.hpp>
 #include <boost/foreach.hpp>
@@ -65,7 +65,7 @@ String DowntimesTable::GetPrefix(void) const
 
 void DowntimesTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+       BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                Dictionary::Ptr downtimes = host->GetDowntimes();
 
                ObjectLock olock(downtimes);
@@ -80,7 +80,7 @@ void DowntimesTable::FetchRows(const AddRowFunction& addRowFn)
                }
        }
 
-       BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+       BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                Dictionary::Ptr downtimes = service->GetDowntimes();
 
                ObjectLock olock(downtimes);
index ef8b1d2900b38c4430b1c942418e20f04c5af25b..fe8e53d51bfacebc95e932e15734ed64536daca7 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "remote/endpoint.hpp"
 #include "remote/zone.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include "base/utility.hpp"
@@ -62,7 +62,7 @@ String EndpointsTable::GetPrefix(void) const
 
 void EndpointsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                if (!addRowFn(endpoint, LivestatusGroupByNone, Empty))
                        return;
        }
index 01782aa9ad33b6f5b19391b577c92348647cc07d..591cf8974d1434d72b3185ac35f42d6608aa0ea8 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/hostgroup.hpp"
 #include "icinga/host.hpp"
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -73,7 +73,7 @@ String HostGroupsTable::GetPrefix(void) const
 
 void HostGroupsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const HostGroup::Ptr& hg, DynamicType::GetObjectsByType<HostGroup>()) {
+       BOOST_FOREACH(const HostGroup::Ptr& hg, ConfigType::GetObjectsByType<HostGroup>()) {
                if (!addRowFn(hg, LivestatusGroupByNone, Empty))
                        return;
        }
index bff1b7de0955a13eae0408b5b9f0d26000c201e8..02c028d79a4694805e854abdf9edf5cce7f8f4be 100644 (file)
@@ -29,7 +29,7 @@
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
 #include "icinga/compatutility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/json.hpp"
 #include "base/convert.hpp"
@@ -187,7 +187,7 @@ String HostsTable::GetPrefix(void) const
 void HostsTable::FetchRows(const AddRowFunction& addRowFn)
 {
        if (GetGroupByType() == LivestatusGroupByHostGroup) {
-               BOOST_FOREACH(const HostGroup::Ptr& hg, DynamicType::GetObjectsByType<HostGroup>()) {
+               BOOST_FOREACH(const HostGroup::Ptr& hg, ConfigType::GetObjectsByType<HostGroup>()) {
                        BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
                                /* the caller must know which groupby type and value are set for this row */
                                if (!addRowFn(host, LivestatusGroupByHostGroup, hg))
@@ -195,7 +195,7 @@ void HostsTable::FetchRows(const AddRowFunction& addRowFn)
                        }
                }
        } else {
-               BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
+               BOOST_FOREACH(const Host::Ptr& host, ConfigType::GetObjectsByType<Host>()) {
                        if (!addRowFn(host, LivestatusGroupByNone, Empty))
                                return;
                }
index 10a46d4d9046ba1e6d97027389b56d874cd30017..98aa99db6a4a49ac147eb7fb46ef48403e8d41a7 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/perfdatavalue.hpp"
 #include "base/utility.hpp"
 #include "base/objectlock.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/exception.hpp"
 #include "base/tcpsocket.hpp"
@@ -47,7 +47,7 @@ void LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::P
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const LivestatusListener::Ptr& livestatuslistener, DynamicType::GetObjectsByType<LivestatusListener>()) {
+       BOOST_FOREACH(const LivestatusListener::Ptr& livestatuslistener, ConfigType::GetObjectsByType<LivestatusListener>()) {
                Dictionary::Ptr stats = new Dictionary();
                stats->Set("connections", l_Connections);
 
@@ -64,7 +64,7 @@ void LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::P
  */
 void LivestatusListener::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        if (GetSocketType() == "tcp") {
                TcpSocket::Ptr socket = new TcpSocket();
@@ -121,7 +121,7 @@ void LivestatusListener::Start(void)
 
 void LivestatusListener::Stop(void)
 {
-       DynamicObject::Stop();
+       ConfigObject::Stop();
 
        m_Listener->Close();
 
index bbc8d0e3559750bec88ac9d80c93b71e791766fd..f6a1c8ee919776134da6ebcbc00aee84a30579a8 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library livestatus;
@@ -25,7 +25,7 @@ library livestatus;
 namespace icinga
 {
 
-class LivestatusListener : DynamicObject {
+class LivestatusListener : ConfigObject {
        [config] String socket_type {
                default {{{ return "unix"; }}}
        };
index c1f81af2bf6f5ee9f6426145e2acaf1751164d0e..3eed539bf13bde76371d52769ea917e4d0fbfb4a 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "livestatus/servicegroupstable.hpp"
 #include "icinga/servicegroup.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -64,7 +64,7 @@ String ServiceGroupsTable::GetPrefix(void) const
 
 void ServiceGroupsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const ServiceGroup::Ptr& sg, DynamicType::GetObjectsByType<ServiceGroup>()) {
+       BOOST_FOREACH(const ServiceGroup::Ptr& sg, ConfigType::GetObjectsByType<ServiceGroup>()) {
                if (!addRowFn(sg, LivestatusGroupByNone, Empty))
                        return;
        }
index 729141143dca96a5d26edafb4f2e2db5f98b96d8..644240a946ab8f89fcb3b942db3593f53624aba0 100644 (file)
@@ -31,7 +31,7 @@
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
 #include "icinga/compatutility.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/json.hpp"
 #include "base/convert.hpp"
@@ -167,7 +167,7 @@ String ServicesTable::GetPrefix(void) const
 void ServicesTable::FetchRows(const AddRowFunction& addRowFn)
 {
        if (GetGroupByType() == LivestatusGroupByServiceGroup) {
-               BOOST_FOREACH(const ServiceGroup::Ptr& sg, DynamicType::GetObjectsByType<ServiceGroup>()) {
+               BOOST_FOREACH(const ServiceGroup::Ptr& sg, ConfigType::GetObjectsByType<ServiceGroup>()) {
                        BOOST_FOREACH(const Service::Ptr& service, sg->GetMembers()) {
                                /* the caller must know which groupby type and value are set for this row */
                                if (!addRowFn(service, LivestatusGroupByServiceGroup, sg))
@@ -175,7 +175,7 @@ void ServicesTable::FetchRows(const AddRowFunction& addRowFn)
                        }
                }
        } else if (GetGroupByType() == LivestatusGroupByHostGroup) {
-               BOOST_FOREACH(const HostGroup::Ptr& hg, DynamicType::GetObjectsByType<HostGroup>()) {
+               BOOST_FOREACH(const HostGroup::Ptr& hg, ConfigType::GetObjectsByType<HostGroup>()) {
                        ObjectLock ylock(hg);
                        BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
                                ObjectLock ylock(host);
@@ -187,7 +187,7 @@ void ServicesTable::FetchRows(const AddRowFunction& addRowFn)
                        }
                }
        } else {
-               BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjectsByType<Service>()) {
+               BOOST_FOREACH(const Service::Ptr& service, ConfigType::GetObjectsByType<Service>()) {
                        if (!addRowFn(service, LivestatusGroupByNone, Empty))
                                return;
                }
index 2a2078256ffff1fbf9d7e7978124dd624eea5d47..1bcd6c305be7efeec4a3855dc657884fc36d3742 100644 (file)
@@ -23,7 +23,7 @@
 #include "icinga/cib.hpp"
 #include "icinga/host.hpp"
 #include "icinga/service.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/application.hpp"
 #include <boost/foreach.hpp>
@@ -207,12 +207,12 @@ Value StatusTable::ProgramStartAccessor(const Value&)
 
 Value StatusTable::NumHostsAccessor(const Value&)
 {
-       return std::distance(DynamicType::GetObjectsByType<Host>().first, DynamicType::GetObjectsByType<Host>().second);
+       return std::distance(ConfigType::GetObjectsByType<Host>().first, ConfigType::GetObjectsByType<Host>().second);
 }
 
 Value StatusTable::NumServicesAccessor(const Value&)
 {
-       return std::distance(DynamicType::GetObjectsByType<Service>().first, DynamicType::GetObjectsByType<Service>().second);
+       return std::distance(ConfigType::GetObjectsByType<Service>().first, ConfigType::GetObjectsByType<Service>().second);
 }
 
 Value StatusTable::ProgramVersionAccessor(const Value&)
index 31e1ed5ab1bb5ace0bf2c88eba029f7327273b00..cf60b5822c0080ee0df2bc38bb3654b252629ae2 100644 (file)
@@ -20,7 +20,7 @@
 #include "livestatus/timeperiodstable.hpp"
 #include "icinga/icingaapplication.hpp"
 #include "icinga/timeperiod.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include "base/utility.hpp"
@@ -54,7 +54,7 @@ String TimePeriodsTable::GetPrefix(void) const
 
 void TimePeriodsTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const TimePeriod::Ptr& tp, DynamicType::GetObjectsByType<TimePeriod>()) {
+       BOOST_FOREACH(const TimePeriod::Ptr& tp, ConfigType::GetObjectsByType<TimePeriod>()) {
                if (!addRowFn(tp, LivestatusGroupByNone, Empty))
                        return;
        }
index 89461d97ea4b9a8c952b661d635fdf5fbefb97ed..1265320da469e200429f2492648935e20baea0b2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "livestatus/zonestable.hpp"
 #include "remote/zone.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -50,7 +50,7 @@ String ZonesTable::GetPrefix(void) const
 
 void ZonesTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                if (!addRowFn(zone, LivestatusGroupByNone, Empty))
                        return;
        }
index 254e24225104b95d743db3c26b19c778a0d08981..be3b195649e85cbac35ef41c8511dddf6848e694 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/checkcommand.hpp"
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/function.hpp"
 #include "base/utility.hpp"
index bfe8c972e6a54a5c9edfddbaa596398181c2cd9d..77bddce23f36f172369420015225dd53e4f378cb 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/convert.hpp"
 #include "base/utility.hpp"
 #include "base/function.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include <boost/algorithm/string/join.hpp>
 #include <boost/foreach.hpp>
 
index 7ff5a9f4e34c3b9f83bcb4c89fd3ebda2789261d..5e2643db9da1388637c74e4b06545b43cfe0507b 100644 (file)
@@ -26,7 +26,7 @@
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
 #include "base/function.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 
 using namespace icinga;
 
index bf1e5fee85ba054607ba8f48c496368a6a27247a..ed39ed6c97d67e45b58258f808904856be397ba6 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/checkcommand.hpp"
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/function.hpp"
 #include "base/utility.hpp"
index bf6e0874941a4eb4ad26ef604c088a9c9cecb670..e753949aa9671b539a3a0e8c75c54bb58da4f203 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/macroprocessor.hpp"
 #include "icinga/pluginutility.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/function.hpp"
 #include "base/utility.hpp"
index bc00116945642101a51f02cd3742fd9d101d2be4..ccd2f61549a71e46c82e0a246ad1e2de31767ea5 100644 (file)
@@ -21,7 +21,7 @@
 #include "notification/notificationcomponent.tcpp"
 #include "icinga/service.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/utility.hpp"
@@ -39,7 +39,7 @@ void NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const NotificationComponent::Ptr& notification_component, DynamicType::GetObjectsByType<NotificationComponent>()) {
+       BOOST_FOREACH(const NotificationComponent::Ptr& notification_component, ConfigType::GetObjectsByType<NotificationComponent>()) {
                nodes->Set(notification_component->GetName(), 1); //add more stats
        }
 
@@ -51,7 +51,7 @@ void NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array
  */
 void NotificationComponent::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
            _2, _3, _4, _5));
@@ -71,7 +71,7 @@ void NotificationComponent::NotificationTimerHandler(void)
 {
        double now = Utility::GetTime();
 
-       BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjectsByType<Notification>()) {
+       BOOST_FOREACH(const Notification::Ptr& notification, ConfigType::GetObjectsByType<Notification>()) {
                Checkable::Ptr checkable = notification->GetCheckable();
 
                if (checkable->IsPaused() && GetEnableHA())
index e75f63fefaa8d75585e224b4d93118784b973ddb..88e8fd0a570bc9e1b007cce5a173bc9b51eb0e71 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "notification/notificationcomponent.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/timer.hpp"
 
 namespace icinga
index 31d78e22c3e0059b7e4bf1e7db613e26b5f99722..55422e13e196ffdba1f8de22d07b3317346ebb1e 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library notification;
 
 namespace icinga
 {
 
-class NotificationComponent : DynamicObject
+class NotificationComponent : ConfigObject
 {
        [config] bool enable_ha (EnableHA) {
                default {{{ return true; }}}
index 1efec3ec6a5c7aca0021e55268e86a4b7a8d6236..10a9a948f997cca2d97e55fef86ef4aa692ae891 100644 (file)
@@ -25,7 +25,7 @@
 #include "icinga/compatutility.hpp"
 #include "icinga/perfdatavalue.hpp"
 #include "base/tcpsocket.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/utility.hpp"
@@ -40,7 +40,7 @@ REGISTER_TYPE(GelfWriter);
 
 void GelfWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
index 374010c1235d3f1d36b62a445581fb0c919b9615..7b2dc6847a88a0ee47200edba7496e26fb058e82 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "perfdata/gelfwriter.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/tcpsocket.hpp"
 #include "base/timer.hpp"
 #include <fstream>
index d2b00eddd13a0f2fcc645bc3a18cc95bbdc5122a..1f7fdc16c712bfec896c6cd8e287b95ee6c576b7 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library perfdata;
 
 namespace icinga
 {
 
-class GelfWriter : DynamicObject
+class GelfWriter : ConfigObject
 {
        [config] String host {
                default {{{ return "127.0.0.1"; }}}
index ef717116ff462560807131fac4b3d7fd3a1e83f6..8a48ceb6650183536bc9f8d0187a9c4851aaed19 100644 (file)
@@ -25,7 +25,7 @@
 #include "icinga/compatutility.hpp"
 #include "icinga/perfdatavalue.hpp"
 #include "base/tcpsocket.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/convert.hpp"
@@ -51,7 +51,7 @@ void GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const GraphiteWriter::Ptr& graphitewriter, DynamicType::GetObjectsByType<GraphiteWriter>()) {
+       BOOST_FOREACH(const GraphiteWriter::Ptr& graphitewriter, ConfigType::GetObjectsByType<GraphiteWriter>()) {
                nodes->Set(graphitewriter->GetName(), 1); //add more stats
        }
 
@@ -60,7 +60,7 @@ void GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 
 void GraphiteWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
index e20c88f221ec55345db086d1839d208ed1f6dd49..32d961bbd7b4593c95bff06fe4b96dd3b9d81c55 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "perfdata/graphitewriter.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/tcpsocket.hpp"
 #include "base/timer.hpp"
 #include <fstream>
index cfcaa694af60dd8fab0ad64d3f9305cac0c5e1d4..3863d4f3bfbbd1112c883fe666d408d6e561f35a 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library perfdata;
 
 namespace icinga
 {
 
-class GraphiteWriter : DynamicObject
+class GraphiteWriter : ConfigObject
 {
        [config] String host {
                default {{{ return "127.0.0.1"; }}}
index 44f5751771669a7015096618f4ce23dd8c32f80a..b8c51414baff1da69feaff0968fc6027d2a6124e 100644 (file)
@@ -25,7 +25,7 @@
 #include "icinga/compatutility.hpp"
 #include "icinga/perfdatavalue.hpp"
 #include "base/tcpsocket.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/convert.hpp"
@@ -51,7 +51,7 @@ void OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const OpenTsdbWriter::Ptr& opentsdbwriter, DynamicType::GetObjectsByType<OpenTsdbWriter>()) {
+       BOOST_FOREACH(const OpenTsdbWriter::Ptr& opentsdbwriter, ConfigType::GetObjectsByType<OpenTsdbWriter>()) {
                nodes->Set(opentsdbwriter->GetName(), 1); //add more stats
        }
 
@@ -60,7 +60,7 @@ void OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 
 void OpenTsdbWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
index 4aa3afff89071a2949377feb437f597dc8068846..02649cbcc25ce567927a1d73ed9365977c48e6ef 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "perfdata/opentsdbwriter.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/tcpsocket.hpp"
 #include "base/timer.hpp"
 #include <fstream>
index 3e63e9cf6e4dfe5125259e6650e79360c7aa86d0..74c3dbbb1b74aac9f943a39e9dadca7ea619c92e 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
  
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library perfdata;
 
 namespace icinga
 {
 
-class OpenTsdbWriter : DynamicObject
+class OpenTsdbWriter : ConfigObject
 {
        [config] String host {
                default {{{ return "127.0.0.1"; }}}
index 94a5c5090328cf0c4022faaf5abd0d7ef5202eb8..0f9cc664c55baee652c20563083deef15690aea0 100644 (file)
@@ -22,7 +22,7 @@
 #include "icinga/service.hpp"
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/convert.hpp"
@@ -42,7 +42,7 @@ void PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
        Dictionary::Ptr nodes = new Dictionary();
 
-       BOOST_FOREACH(const PerfdataWriter::Ptr& perfdatawriter, DynamicType::GetObjectsByType<PerfdataWriter>()) {
+       BOOST_FOREACH(const PerfdataWriter::Ptr& perfdatawriter, ConfigType::GetObjectsByType<PerfdataWriter>()) {
                nodes->Set(perfdatawriter->GetName(), 1); //add more stats
        }
 
@@ -51,7 +51,7 @@ void PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 
 void PerfdataWriter::Start(void)
 {
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        Checkable::OnNewCheckResult.connect(boost::bind(&PerfdataWriter::CheckResultHandler, this, _1, _2));
 
index aa58c7a1bcf3c3dcd34cf18f864d3ad63da27004..b5f40629699a676983348659479e3a164865adcf 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "perfdata/perfdatawriter.thpp"
 #include "icinga/service.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/timer.hpp"
 #include <fstream>
 
index 753dbf0a45296e684c1b0e66764fdcdcec55d181..f73d12ec7c4b5061a71b1987b1e5b93a139f3e29 100644 (file)
@@ -17,7 +17,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library perfdata;
@@ -25,7 +25,7 @@ library perfdata;
 namespace icinga
 {
 
-class PerfdataWriter : DynamicObject
+class PerfdataWriter : ConfigObject
 {
        [config] String host_perfdata_path {
                default {{{ return Application::GetLocalStateDir() + "/spool/icinga2/perfdata/host-perfdata"; }}}
index f9291d492749d2503e8d9af31bcb5263ea150dc0..89ad369101c2f77728ea15b48bea1c54aa98984c 100644 (file)
@@ -57,11 +57,11 @@ bool ActionsHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& reques
 
        Dictionary::Ptr params = HttpUtility::FetchRequestParameters(request);
 
-       std::vector<DynamicObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
+       std::vector<ConfigObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
 
        Array::Ptr results = new Array();
 
-       BOOST_FOREACH(const DynamicObject::Ptr& obj, objs) {
+       BOOST_FOREACH(const ConfigObject::Ptr& obj, objs) {
                try {
                        results->Add(action->Invoke(obj, params));
                } catch (const std::exception& ex) {
index 3c999d3e7abfdf19b856b8543056745a25896869..ba4c4dcffcf3b6b7e43179c46293da93949879d7 100644 (file)
@@ -26,7 +26,7 @@ ApiAction::ApiAction(const std::vector<String>& types, const Callback& action)
 : m_Types(types), m_Callback(action)
 { }
 
-Value ApiAction::Invoke(const DynamicObject::Ptr& target, const Dictionary::Ptr& params)
+Value ApiAction::Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)
 {
        return m_Callback(target, params);
 }
index ff7e9243222a6472e7aeca2d7da2adb71e5265f9..e95f678533735bdd34519a4a95680b1fc16ef642 100644 (file)
@@ -24,7 +24,7 @@
 #include "base/registry.hpp"
 #include "base/value.hpp"
 #include "base/dictionary.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include <vector>
 #include <boost/function.hpp>
 #include <boost/algorithm/string/replace.hpp>
@@ -44,11 +44,11 @@ class I2_REMOTE_API ApiAction : public Object
 public:
        DECLARE_PTR_TYPEDEFS(ApiAction);
 
-       typedef boost::function<Value(const DynamicObject::Ptr& target, const Dictionary::Ptr& params)> Callback;
+       typedef boost::function<Value(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)> Callback;
 
        ApiAction(const std::vector<String>& registerTypes, const Callback& function);
 
-       Value Invoke(const DynamicObject::Ptr& target, const Dictionary::Ptr& params);
+       Value Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params);
 
        const std::vector<String>& GetTypes(void) const;
 
index 920d3098557e9cf5004d48f88570afb87e5b4f3c..95edd3ff7ecd53a2cc1ae746438fa790c2fcc1d5 100644 (file)
@@ -20,7 +20,7 @@
 #include "remote/apilistener.hpp"
 #include "remote/apifunction.hpp"
 #include "config/configcompiler.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/convert.hpp"
 #include "base/exception.hpp"
@@ -154,7 +154,7 @@ void ApiListener::SyncZoneDir(const Zone::Ptr& zone) const
 
 void ApiListener::SyncZoneDirs(void) const
 {
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                if (!IsConfigMaster(zone))
                        continue;
 
@@ -182,7 +182,7 @@ void ApiListener::SendConfigUpdate(const JsonRpcConnection::Ptr& aclient)
 
        String zonesDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
 
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                String zoneDir = zonesDir + "/" + zone->GetName();
 
                if (!zone->IsChildOf(azone) && !zone->IsGlobal()) {
index 9fb6ee707a9bbee1dcc69f70eb2477cf1c1928b5..f743daf48e307da161622ca7af8adfc0802ad318 100644 (file)
@@ -26,7 +26,7 @@
 #include "base/convert.hpp"
 #include "base/netstring.hpp"
 #include "base/json.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/objectlock.hpp"
 #include "base/stdiostream.hpp"
@@ -97,12 +97,12 @@ void ApiListener::Start(void)
 {
        SyncZoneDirs();
 
-       if (std::distance(DynamicType::GetObjectsByType<ApiListener>().first, DynamicType::GetObjectsByType<ApiListener>().second) > 1) {
+       if (std::distance(ConfigType::GetObjectsByType<ApiListener>().first, ConfigType::GetObjectsByType<ApiListener>().second) > 1) {
                Log(LogCritical, "ApiListener", "Only one ApiListener object is allowed.");
                return;
        }
 
-       DynamicObject::Start();
+       ConfigObject::Start();
 
        {
                boost::mutex::scoped_lock(m_LogLock);
@@ -128,7 +128,7 @@ void ApiListener::Start(void)
 
 ApiListener::Ptr ApiListener::GetInstance(void)
 {
-       BOOST_FOREACH(const ApiListener::Ptr& listener, DynamicType::GetObjectsByType<ApiListener>())
+       BOOST_FOREACH(const ApiListener::Ptr& listener, ConfigType::GetObjectsByType<ApiListener>())
                return listener;
 
        return ApiListener::Ptr();
@@ -403,7 +403,7 @@ void ApiListener::ApiTimerHandler(void)
        BOOST_FOREACH(int ts, files) {
                bool need = false;
 
-               BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+               BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                        if (endpoint->GetName() == GetIdentity())
                                continue;
 
@@ -426,7 +426,7 @@ void ApiListener::ApiTimerHandler(void)
 
        Zone::Ptr my_zone = Zone::GetLocalZone();
 
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                /* only connect to endpoints in a) the same zone b) our parent zone c) immediate child zones */
                if (my_zone != zone && my_zone != zone->GetParent() && zone != my_zone->GetParent()) {
                        Log(LogDebug, "ApiListener")
@@ -468,7 +468,7 @@ void ApiListener::ApiTimerHandler(void)
                }
        }
 
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                if (!endpoint->IsConnected())
                        continue;
 
@@ -500,7 +500,7 @@ void ApiListener::ApiTimerHandler(void)
                    << "Current zone master: " << master->GetName();
 
        std::vector<String> names;
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>())
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>())
                if (endpoint->IsConnected())
                        names.push_back(endpoint->GetName() + " (" + Convert::ToString(endpoint->GetClients().size()) + ")");
 
@@ -508,12 +508,12 @@ void ApiListener::ApiTimerHandler(void)
            << "Connected endpoints: " << Utility::NaturalJoin(names);
 }
 
-void ApiListener::RelayMessage(const MessageOrigin::Ptr& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log)
+void ApiListener::RelayMessage(const MessageOrigin::Ptr& origin, const ConfigObject::Ptr& secobj, const Dictionary::Ptr& message, bool log)
 {
        m_RelayQueue.Enqueue(boost::bind(&ApiListener::SyncRelayMessage, this, origin, secobj, message, log));
 }
 
-void ApiListener::PersistMessage(const Dictionary::Ptr& message, const DynamicObject::Ptr& secobj)
+void ApiListener::PersistMessage(const Dictionary::Ptr& message, const ConfigObject::Ptr& secobj)
 {
        double ts = message->Get("ts");
 
@@ -557,7 +557,7 @@ void ApiListener::SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionar
 }
 
 
-void ApiListener::SyncRelayMessage(const MessageOrigin::Ptr& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log)
+void ApiListener::SyncRelayMessage(const MessageOrigin::Ptr& origin, const ConfigObject::Ptr& secobj, const Dictionary::Ptr& message, bool log)
 {
        double ts = Utility::GetTime();
        message->Set("ts", ts);
@@ -578,7 +578,7 @@ void ApiListener::SyncRelayMessage(const MessageOrigin::Ptr& origin, const Dynam
        std::vector<Endpoint::Ptr> skippedEndpoints;
        std::set<Zone::Ptr> finishedZones;
 
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                /* don't relay messages to ourselves or disconnected endpoints */
                if (endpoint->GetName() == GetIdentity() || !endpoint->IsConnected())
                        continue;
@@ -770,12 +770,12 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
                                Dictionary::Ptr secname = pmessage->Get("secobj");
                                
                                if (secname) {
-                                       DynamicType::Ptr dtype = DynamicType::GetByName(secname->Get("type"));
+                                       ConfigType::Ptr dtype = ConfigType::GetByName(secname->Get("type"));
                                        
                                        if (!dtype)
                                                continue;
                                        
-                                       DynamicObject::Ptr secobj = dtype->GetObject(secname->Get("name"));
+                                       ConfigObject::Ptr secobj = dtype->GetObject(secname->Get("name"));
                                        
                                        if (!secobj)
                                                continue;
@@ -856,7 +856,7 @@ std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)
 
        Zone::Ptr my_zone = Zone::GetLocalZone();
 
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                /* only check endpoints in a) the same zone b) our parent zone c) immediate child zones */
                if (my_zone != zone && my_zone != zone->GetParent() && zone != my_zone->GetParent()) {
                        Log(LogDebug, "ApiListener")
index a7dcd00f6f0d08d2c8b0723390ae5ff96f8f47a8..7368439b1553091bba6103d82e3555153a6a4de8 100644 (file)
@@ -25,7 +25,7 @@
 #include "remote/httpconnection.hpp"
 #include "remote/endpoint.hpp"
 #include "remote/messageorigin.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/timer.hpp"
 #include "base/workqueue.hpp"
 #include "base/tcpsocket.hpp"
@@ -60,7 +60,7 @@ public:
        static String GetApiDir(void);
 
        void SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionary::Ptr& message);
-       void RelayMessage(const MessageOrigin::Ptr& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
+       void RelayMessage(const MessageOrigin::Ptr& origin, const ConfigObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
 
        static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
        std::pair<Dictionary::Ptr, Dictionary::Ptr> GetStatus(void);
@@ -103,8 +103,8 @@ private:
        Stream::Ptr m_LogFile;
        size_t m_LogMessageCount;
 
-       void SyncRelayMessage(const MessageOrigin::Ptr& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
-       void PersistMessage(const Dictionary::Ptr& message, const DynamicObject::Ptr& secobj);
+       void SyncRelayMessage(const MessageOrigin::Ptr& origin, const ConfigObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
+       void PersistMessage(const Dictionary::Ptr& message, const ConfigObject::Ptr& secobj);
 
        void OpenLogFile(void);
        void RotateLogFile(void);
index 8855584ac19378d0972f4efef62e63c657cbca90..2b7e82be2ac0bb54bdce7539ec78e815b321d3d0 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "remote/i2-remote.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include "base/application.hpp"
 
 library remote;
@@ -26,7 +26,7 @@ library remote;
 namespace icinga
 {
 
-class ApiListener : DynamicObject
+class ApiListener : ConfigObject
 {
        [config, required] String cert_path;
        [config, required] String key_path;
index 7427100121cd5425366b10895e60cec4071f5f1c..0ba44e30e3e9ca1bb8612bda50c610c412d974f5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "remote/apiuser.hpp"
 #include "remote/apiuser.tcpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 
 using namespace icinga;
 
@@ -42,7 +42,7 @@ bool ApiUser::CheckPassword(const String& password) const
 
 ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
 {
-       BOOST_FOREACH(const ApiUser::Ptr& user, DynamicType::GetObjectsByType<ApiUser>()) {
+       BOOST_FOREACH(const ApiUser::Ptr& user, ConfigType::GetObjectsByType<ApiUser>()) {
                if (user->GetClientCN() == cn)
                        return user;
        }
index 7f774d5658ba012a9726c43f8c76436deb443814..7007fb2654c590461fa60385faa837615c751403 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library remote;
 
 namespace icinga
 {
 
-class ApiUser : DynamicObject
+class ApiUser : ConfigObject
 {
        [config, protected] String password (PasswordRaw);
        [config] String client_cn (ClientCN);
index 86db949244b90801d8b0b9424c285f91c5f02447..e737a99db92735fc3fda69aa19e9479e48088aa7 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "remote/zone.hpp"
 #include "remote/apilistener.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/initialize.hpp"
 #include "base/timer.hpp"
@@ -29,7 +29,7 @@ using namespace icinga;
 
 static Timer::Ptr l_AuthorityTimer;
 
-static bool ObjectNameLessComparer(const DynamicObject::Ptr& a, const DynamicObject::Ptr& b)
+static bool ObjectNameLessComparer(const ConfigObject::Ptr& a, const ConfigObject::Ptr& b)
 {
        return a->GetName() < b->GetName();
 }
@@ -57,8 +57,8 @@ static void AuthorityTimerHandler(void)
 
        std::sort(endpoints.begin(), endpoints.end(), ObjectNameLessComparer);
 
-       BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
-               BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
+       BOOST_FOREACH(const ConfigType::Ptr& type, ConfigType::GetTypes()) {
+               BOOST_FOREACH(const ConfigObject::Ptr& object, type->GetObjects()) {
                        Endpoint::Ptr endpoint = endpoints[Utility::SDBM(object->GetName()) % endpoints.size()];
 
                        if (object->GetHAMode() == HARunOnce)
index aa21b79338a3e6783989e006fe64a85c95f47b28..fe532dfdfe841b7117802fba3ba0d9483450a1f9 100644 (file)
@@ -57,11 +57,11 @@ bool DeleteObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& r
                params->Set(attr, request.RequestUrl->GetPath()[2]);
        }
 
-       std::vector<DynamicObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
+       std::vector<ConfigObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
 
        Array::Ptr results = new Array();
 
-       BOOST_FOREACH(const DynamicObject::Ptr& obj, objs) {
+       BOOST_FOREACH(const ConfigObject::Ptr& obj, objs) {
                Dictionary::Ptr result1 = new Dictionary();
                result1->Set("type", type->GetName());
                result1->Set("name", obj->GetName());
index 71612c318b09b2a7d92053537fb2ce566f407545..29068ac0d235c6fcd39c14fe22d68a5de0714303 100644 (file)
@@ -22,7 +22,7 @@
 #include "remote/apilistener.hpp"
 #include "remote/jsonrpcconnection.hpp"
 #include "remote/zone.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/utility.hpp"
 #include "base/exception.hpp"
 #include "base/convert.hpp"
@@ -37,9 +37,9 @@ boost::signals2::signal<void(const Endpoint::Ptr&, const JsonRpcConnection::Ptr&
 
 void Endpoint::OnAllConfigLoaded(void)
 {
-       DynamicObject::OnConfigLoaded();
+       ConfigObject::OnConfigLoaded();
 
-       BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
+       BOOST_FOREACH(const Zone::Ptr& zone, ConfigType::GetObjectsByType<Zone>()) {
                const std::set<Endpoint::Ptr> members = zone->GetEndpoints();
 
                if (members.empty())
index b2b5bc1f63e61d21af25731e58929ee8c5d18bac..9625d9b66a6b50ce67783545606e5e29e8e39f7a 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library remote;
 
 namespace icinga
 {
 
-class Endpoint : DynamicObject
+class Endpoint : ConfigObject
 {
        [config] String host;
        [config] String port {
index 143939b56eb81f437c603e3a5ba9454a37dd979a..949e027b931fd0938b3c1108a0c5dea8f6a2caee 100644 (file)
@@ -22,7 +22,7 @@
 #include "config/configcompiler.hpp"
 #include "config/expression.hpp"
 #include "base/json.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
@@ -34,7 +34,7 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
        String uname = pluralName;
        boost::algorithm::to_lower(uname);
 
-       BOOST_FOREACH(const DynamicType::Ptr& dtype, DynamicType::GetTypes()) {
+       BOOST_FOREACH(const ConfigType::Ptr& dtype, ConfigType::GetTypes()) {
                Type::Ptr type = Type::GetByName(dtype->GetName());
                ASSERT(type);
 
@@ -48,17 +48,17 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
        return Type::Ptr();
 }
 
-DynamicObject::Ptr FilterUtility::GetObjectByTypeAndName(const String& type, const String& name)
+ConfigObject::Ptr FilterUtility::GetObjectByTypeAndName(const String& type, const String& name)
 {
-       DynamicType::Ptr dtype = DynamicType::GetByName(type);
+       ConfigType::Ptr dtype = ConfigType::GetByName(type);
        ASSERT(dtype);
 
        return dtype->GetObject(name);
 }
 
-std::vector<DynamicObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescription& qd, const Dictionary::Ptr& query)
+std::vector<ConfigObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescription& qd, const Dictionary::Ptr& query)
 {
-       std::vector<DynamicObject::Ptr> result;
+       std::vector<ConfigObject::Ptr> result;
 
        BOOST_FOREACH(const Type::Ptr& type, qd.Types) {
                String attr = type->GetName();
@@ -66,7 +66,7 @@ std::vector<DynamicObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescr
 
                if (query->Contains(attr)) {
                        String name = HttpUtility::GetLastParameter(query, attr);
-                       DynamicObject::Ptr obj = GetObjectByTypeAndName(type->GetName(), name);
+                       ConfigObject::Ptr obj = GetObjectByTypeAndName(type->GetName(), name);
                        if (!obj)
                                BOOST_THROW_EXCEPTION(std::invalid_argument("Object does not exist."));
                        result.push_back(obj);
@@ -80,7 +80,7 @@ std::vector<DynamicObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescr
                        if (names) {
                                ObjectLock olock(names);
                                BOOST_FOREACH(const String& name, names) {
-                                       DynamicObject::Ptr obj = GetObjectByTypeAndName(type->GetName(), name);
+                                       ConfigObject::Ptr obj = GetObjectByTypeAndName(type->GetName(), name);
                                        if (!obj)
                                                BOOST_THROW_EXCEPTION(std::invalid_argument("Object does not exist."));
                                        result.push_back(obj);
@@ -111,7 +111,7 @@ std::vector<DynamicObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescr
                if (qd.Types.find(utype) == qd.Types.end())
                        BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid type specified for this query."));
 
-               DynamicType::Ptr dtype = DynamicType::GetByName(type);
+               ConfigType::Ptr dtype = ConfigType::GetByName(type);
                ASSERT(dtype);
 
                Expression *ufilter = ConfigCompiler::CompileText("<API query>", filter, false);
@@ -122,7 +122,7 @@ std::vector<DynamicObject::Ptr> FilterUtility::GetFilterTargets(const QueryDescr
                boost::algorithm::to_lower(varName);
 
                try {
-                       BOOST_FOREACH(const DynamicObject::Ptr& object, dtype->GetObjects()) {
+                       BOOST_FOREACH(const ConfigObject::Ptr& object, dtype->GetObjects()) {
                                frame.Locals->Set(varName, object);
 
                                if (Convert::ToBool(ufilter->Evaluate(frame)))
index 42a3d27607cac3ae356cac3f905ef597970ef458..70e0c3e00546c4a7a77483d6d170ab9ee7d3cacd 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "remote/i2-remote.hpp"
 #include "base/dictionary.hpp"
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 #include <set>
 
 namespace icinga
@@ -42,8 +42,8 @@ class I2_REMOTE_API FilterUtility
 {
 public:
        static Type::Ptr TypeFromPluralName(const String& pluralName);
-       static DynamicObject::Ptr GetObjectByTypeAndName(const String& type, const String& name);
-       static std::vector<DynamicObject::Ptr> GetFilterTargets(const QueryDescription& qd, const Dictionary::Ptr& query);
+       static ConfigObject::Ptr GetObjectByTypeAndName(const String& type, const String& name);
+       static std::vector<ConfigObject::Ptr> GetFilterTargets(const QueryDescription& qd, const Dictionary::Ptr& query);
 };
 
 }
index 8dec67b066e3da3292f5a3bbacecf2b58632e27e..48c1ac6635bbfa72fd5c79059d4915ac0eebd616 100644 (file)
@@ -23,7 +23,7 @@
 #include "remote/apifunction.hpp"
 #include "remote/jsonrpc.hpp"
 #include "remote/base64.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
 #include "base/logger.hpp"
index c12bccaf0f18bfae7e264d0349ca256827d89b69..fdf5400f3450c85b243495754594ea3f7eeff7f0 100644 (file)
@@ -21,7 +21,7 @@
 #include "remote/messageorigin.hpp"
 #include "remote/apifunction.hpp"
 #include "base/initialize.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/logger.hpp"
 #include "base/utility.hpp"
 #include <boost/foreach.hpp>
@@ -44,7 +44,7 @@ INITIALIZE_ONCE(StartHeartbeatTimer);
 
 void JsonRpcConnection::HeartbeatTimerHandler(void)
 {
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                BOOST_FOREACH(const JsonRpcConnection::Ptr& client, endpoint->GetClients()) {
                        if (endpoint->GetSyncing()) {
                                Log(LogInformation, "JsonRpcConnection")
index c0fd1b61f5f484d9ddb3cb723aa06ad3390fd704..bb62c4414506ab2b801379db7c33865c5663f816 100644 (file)
@@ -21,7 +21,7 @@
 #include "remote/apilistener.hpp"
 #include "remote/apifunction.hpp"
 #include "remote/jsonrpc.hpp"
-#include "base/dynamictype.hpp"
+#include "base/configtype.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
 #include "base/logger.hpp"
@@ -284,7 +284,7 @@ void JsonRpcConnection::TimeoutTimerHandler(void)
                client->CheckLiveness();
        }
 
-       BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
+       BOOST_FOREACH(const Endpoint::Ptr& endpoint, ConfigType::GetObjectsByType<Endpoint>()) {
                BOOST_FOREACH(const JsonRpcConnection::Ptr& client, endpoint->GetClients()) {
                        client->CheckLiveness();
                }
index 296392261c6468c07a74f275965c5e88ee3277a4..f912c284890243cfa2fa70c10b646def4683e609 100644 (file)
@@ -56,13 +56,13 @@ bool ModifyObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& r
                params->Set(attr, request.RequestUrl->GetPath()[2]);
        }
 
-       std::vector<DynamicObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
+       std::vector<ConfigObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
 
        Dictionary::Ptr attrs = params->Get("attrs");
 
        Array::Ptr results = new Array();
 
-       BOOST_FOREACH(const DynamicObject::Ptr& obj, objs) {
+       BOOST_FOREACH(const ConfigObject::Ptr& obj, objs) {
                Dictionary::Ptr result1 = new Dictionary();
 
                result1->Set("type", type->GetName());
index 8e0773cdee20f517c33eec6bd0ab768cf10b6591..153c86ddf9096a1a14cb5f5fff45a71d11061ef3 100644 (file)
@@ -57,7 +57,7 @@ bool StatusQueryHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& re
                params->Set(attr, request.RequestUrl->GetPath()[2]);
        }
 
-       std::vector<DynamicObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
+       std::vector<ConfigObject::Ptr> objs = FilterUtility::GetFilterTargets(qd, params);
 
        Array::Ptr results = new Array();
 
@@ -71,7 +71,7 @@ bool StatusQueryHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& re
                }
        }
 
-       BOOST_FOREACH(const DynamicObject::Ptr& obj, objs) {
+       BOOST_FOREACH(const ConfigObject::Ptr& obj, objs) {
                BOOST_FOREACH(const String& joinType, joinTypes) {
                        String prefix = joinType;
                        boost::algorithm::to_lower(prefix);
index 3d05cc430e6f992a20e524b82a4e6132c76d7f83..f90a75e778718718b9a34d60dcf6e3adec42ccbf 100644 (file)
@@ -54,7 +54,7 @@ std::set<Endpoint::Ptr> Zone::GetEndpoints(void) const
        return result;
 }
 
-bool Zone::CanAccessObject(const DynamicObject::Ptr& object)
+bool Zone::CanAccessObject(const ConfigObject::Ptr& object)
 {
        Zone::Ptr object_zone;
 
index d0172df91406b10bfd140ffaa4b87528cfcf2317..9092e26fa5686dfd5a31f51119fca28035b3ddc5 100644 (file)
@@ -39,7 +39,7 @@ public:
        Zone::Ptr GetParent(void) const;
        std::set<Endpoint::Ptr> GetEndpoints(void) const;
 
-       bool CanAccessObject(const DynamicObject::Ptr& object);
+       bool CanAccessObject(const ConfigObject::Ptr& object);
        bool IsChildOf(const Zone::Ptr& zone);
        bool IsGlobal(void) const;
 
index 9ce64803760a061f0576cdcbbef6e495643c14b7..f6224e40669927b1e6d89350922afdcb21ce9d51 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/dynamicobject.hpp"
+#include "base/configobject.hpp"
 
 library remote;
 
 namespace icinga
 {
 
-class Zone : DynamicObject
+class Zone : ConfigObject
 {
        [config] name(Zone) parent (ParentRaw);
        [config] Array::Ptr endpoints (EndpointsRaw);
index 9b76e06a5cf6e19b3b5679a5142bddd4ca23a9e6..ab704e2709cebb6992e606533872871ce0f0d31c 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(gettype)
 BOOST_AUTO_TEST_CASE(assign)
 {
        Type::Ptr t1 = Type::GetByName("Application");
-       Type::Ptr t2 = Type::GetByName("DynamicObject");
+       Type::Ptr t2 = Type::GetByName("ConfigObject");
 
        BOOST_CHECK(t1->IsAssignableFrom(t1));
        BOOST_CHECK(t2->IsAssignableFrom(t1));
index fafbcb7b07e4e0c529aad90331b7554b1a7aab54..4a85acfbca6d9dfd33367681ad4a672da2ce284b 100644 (file)
@@ -484,13 +484,13 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                                else
                                        m_Impl << "\t" << "if (value.IsEmpty())" << std::endl;
 
-                               m_Impl << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<DynamicObject *>(this), boost::assign::list_of(\"" << field.Name << "\"), \"Attribute must not be empty.\"));" << std::endl << std::endl;
+                               m_Impl << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), boost::assign::list_of(\"" << field.Name << "\"), \"Attribute must not be empty.\"));" << std::endl << std::endl;
                        }
 
                        if (field.Type.IsName) {
                                m_Impl << "\t" << "String ref = value;" << std::endl
                                       << "\t" << "if (!ref.IsEmpty() && !utils.ValidateName(\"" << field.Type.TypeName << "\", ref))" << std::endl
-                                      << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<DynamicObject *>(this), boost::assign::list_of(\"" << field.Name << "\"), \"Object '\" + ref + \"' of type '" << field.Type.TypeName
+                                      << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), boost::assign::list_of(\"" << field.Name << "\"), \"Object '\" + ref + \"' of type '" << field.Type.TypeName
                                       << "' does not exist.\"));" << std::endl;
                        }
                }
@@ -748,7 +748,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
 
                        m_Impl << "void ObjectImpl<" << klass.Name << ">::Notify" << it->GetFriendlyName() << "(const Value& cookie)" << std::endl
                               << "{" << std::endl
-                              << "\t" << "DynamicObject *dobj = dynamic_cast<DynamicObject *>(this);" << std::endl;
+                              << "\t" << "ConfigObject *dobj = dynamic_cast<ConfigObject *>(this);" << std::endl;
 
                        if (it->Name != "active") {
                                m_Impl << "\t" << "if (!dobj || dobj->IsActive())" << std::endl
@@ -800,7 +800,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                }
        }
 
-       if (klass.Name == "DynamicObject")
+       if (klass.Name == "ConfigObject")
                m_Header << "\t" << "friend class ConfigItem;" << std::endl;
 
        if (!klass.TypeBase.empty())
@@ -842,7 +842,7 @@ void ClassCompiler::CodeGenValidator(const std::string& name, const std::string&
                                m_Impl << "\t" << "if (!value)" << std::endl;
 
                        if (required)
-                               m_Impl << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<DynamicObject *>(this), location, \"This attribute must not be empty.\"));" << std::endl;
+                               m_Impl << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), location, \"This attribute must not be empty.\"));" << std::endl;
                        else
                                m_Impl << "\t\t" << "return;" << std::endl;
 
@@ -884,7 +884,7 @@ void ClassCompiler::CodeGenValidator(const std::string& name, const std::string&
                               << "\t\t\t" << "if (utils.ValidateName(\"" << rule.Type << "\", value))" << std::endl
                               << "\t\t\t\t" << "return;" << std::endl
                               << "\t\t\t" << "else" << std::endl
-                              << "\t\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<DynamicObject>(object), location, \"Object '\" + value + \"' of type '" << rule.Type << "' does not exist.\"));" << std::endl
+                              << "\t\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<ConfigObject>(object), location, \"Object '\" + value + \"' of type '" << rule.Type << "' does not exist.\"));" << std::endl
                               << "\t\t" << "}" << std::endl;
                }
 
@@ -963,7 +963,7 @@ void ClassCompiler::CodeGenValidator(const std::string& name, const std::string&
 
                                        if (rule.Type == "Dictionary") {
                                                m_Impl << (type_check ? "\t" : "") << "\t\t" << "if (dict.Get(\"" << srule.Pattern << "\").IsEmpty())" << std::endl
-                                                      << (type_check ? "\t" : "") << "\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<DynamicObject *>(this), location, \"Required dictionary item '" << srule.Pattern << "' is not set.\"));" << std::endl;
+                                                      << (type_check ? "\t" : "") << "\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), location, \"Required dictionary item '" << srule.Pattern << "' is not set.\"));" << std::endl;
                                        } else if (rule.Type == "Array") {
                                                int index = -1;
                                                std::stringstream idxbuf;
@@ -976,7 +976,7 @@ void ClassCompiler::CodeGenValidator(const std::string& name, const std::string&
                                                }
 
                                                m_Impl << (type_check ? "\t" : "") << "\t\t" << "if (arr.GetLength() < " << (index + 1) << ")" << std::endl
-                                                      << (type_check ? "\t" : "") << "\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<DynamicObject *>(this), location, \"Required index '" << index << "' is not set.\"));" << std::endl;
+                                                      << (type_check ? "\t" : "") << "\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), location, \"Required index '" << index << "' is not set.\"));" << std::endl;
                                        }
                                }
 
@@ -995,11 +995,11 @@ void ClassCompiler::CodeGenValidator(const std::string& name, const std::string&
        if (type_check || validatorType != ValidatorField) {
                if (validatorType != ValidatorField) {
                        m_Impl << "\t" << "if (!known_attribute)" << std::endl
-                              << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<DynamicObject>(object), location, \"Invalid attribute: \" + key));" << std::endl
+                              << "\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<ConfigObject>(object), location, \"Invalid attribute: \" + key));" << std::endl
                               << "\t" << "else" << std::endl;
                }
 
-               m_Impl << (validatorType != ValidatorField ? "\t" : "") << "\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<DynamicObject>(object), location, \"Invalid type.\"));" << std::endl;
+               m_Impl << (validatorType != ValidatorField ? "\t" : "") << "\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_pointer_cast<ConfigObject>(object), location, \"Invalid type.\"));" << std::endl;
        }
 
        m_Impl << "}" << std::endl << std::endl;