GetClasses()[type] = factory;
}
-DynamicObject::Ptr DynamicObject::Create(const String& type, const Dictionary::Ptr& properties)
+DynamicObject::Ptr DynamicObject::Create(const String& type, const Dictionary::Ptr& serializedUpdate)
{
DynamicObject::ClassMap::iterator ct;
ct = GetClasses().find(type);
DynamicObject::Ptr obj;
if (ct != GetClasses().end()) {
- obj = ct->second(properties);
+ obj = ct->second(serializedUpdate);
} else {
- obj = boost::make_shared<DynamicObject>(properties);
+ obj = boost::make_shared<DynamicObject>(serializedUpdate);
Logger::Write(LogCritical, "base", "Creating generic DynamicObject for type '" + type + "'");
}
m_PersistentUpdates.erase(st);
}
+ /* apply the object's non-config attributes */
+ obj->ApplyUpdate(serializedUpdate, Attribute_All & ~Attribute_Config);
+
return obj;
}
static void RestoreObjects(const String& filename);
static void RegisterClass(const String& type, Factory factory);
- static DynamicObject::Ptr Create(const String& type, const Dictionary::Ptr& properties);
+ static DynamicObject::Ptr Create(const String& type, const Dictionary::Ptr& serializedUpdate);
static double GetCurrentTx(void);
static void BeginTx(void);
*/
void CIBSyncComponent::Start(void)
{
- m_SyncingConfig = false;
-
m_Endpoint = boost::make_shared<VirtualEndpoint>();
/* config objects */
void CIBSyncComponent::LocalObjectRegisteredHandler(const DynamicObject::Ptr& object)
{
- /* don't send messages when we're currently processing a remote update */
- if (m_SyncingConfig)
- return;
-
if (!ShouldReplicateObject(object))
return;
void CIBSyncComponent::LocalObjectUnregisteredHandler(const DynamicObject::Ptr& object)
{
- /* don't send messages when we're currently processing a remote update */
- if (m_SyncingConfig)
- return;
-
if (!ShouldReplicateObject(object))
return;
return;
if (!object->IsLocal()) {
- try {
- m_SyncingConfig = true;
- object->Unregister();
- m_SyncingConfig = false;
- } catch (...) {
- m_SyncingConfig = false;
- throw;
- }
+ object->Unregister();
}
}
private:
VirtualEndpoint::Ptr m_Endpoint;
- bool m_SyncingConfig;
static void ServiceStateChangeRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request);
5JKirNidgG9PuD8x47VsRTkESLlq/pS7KjkE1nWCG9JpR5oVSzx2WXomiaAZ4q2C
WS1z4HD9HF4NbhY+xVBi0Fj/kotuXCCweRo5EVp7Q4fabm1maJemFwMTHGhBLu7a
v4dquYyOk9Dhkwcjajyn+KWceCoUTdI3LB2t
------END CERTIFICATE----------BEGIN PRIVATE KEY-----
+-----END CERTIFICATE-----
+-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKznFbotQFqI2z7i
v+1nvbsCAS2ji3wcUESN/pOj8843bWl0+Io0/w0mr0OVOMBji2IdMrksqkvPEF/w
7Kgxi150lbPJk9+24qDDsNl4p6mjUOsSuL8otBWMUnsCOmDpGIu9d+TRGklIHfNo
-local object application "icinga" {
- ca = "ca.crt",
- cert = "icinga-c2.pem"
+local object Application "icinga" {
+ cert = "icinga-c2.pem",
+ ca = "ca.crt",
+
+ pidpath = "icinga-checker1.pid",
+
+ macros = {
+ plugindir = "/usr/local/icinga/libexec"
+ }
}
-local object component "checker" {
+local object Component "checker" {
}
-local object component "discovery" {
- broker = 0
+local object Component "discovery" {
+ broker = 0
}
/* trusted upstream endpoint */
-local object endpoint "icinga-c1" {
- node = "192.168.5.46",
- service = 7777,
+local object Endpoint "icinga-c1" {
+ node = "192.168.5.46",
+ service = 7777,
- roles = { "all" }
+ roles = { "all" }
}
-local object role "all" {
- publications = { "*" },
- subscriptions = { "*" }
+local object Role "all" {
+ publications = { "*" },
+ subscriptions = { "*" }
}
-