MCPcopy Create free account
hub / github.com/Icinga/icinga2 / RestoreObject

Method RestoreObject

lib/base/configobject.cpp:511–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511void ConfigObject::RestoreObject(const String& message, int attributeTypes)
512{
513 Dictionary::Ptr persistentObject = JsonDecode(message, std::numeric_limits<size_t>::max());
514
515 String type = persistentObject->Get("type");
516 String name = persistentObject->Get("name");
517
518 ConfigObject::Ptr object = GetObject(type, name);
519
520 if (!object)
521 return;
522
523#ifdef I2_DEBUG
524 Log(LogDebug, "ConfigObject")
525 << "Restoring object '" << name << "' of type '" << type << "'.";
526#endif /* I2_DEBUG */
527 Dictionary::Ptr update = persistentObject->Get("update");
528 Deserialize(object, update, false, attributeTypes);
529 object->OnStateLoaded();
530 object->SetStateLoaded(true);
531}
532
533void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)
534{

Callers

nothing calls this directly

Calls 3

LogClass · 0.85
OnStateLoadedMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected