Entry: Populate properties
Create an Entry dbus object when Commit is called and fill in
its properties with the journal data.
Change-Id: I155cacbdfdccfa8b1f594503d858710fa71f2026
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/elog_entry.hpp b/elog_entry.hpp
index bd3915c..92360cb 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -35,11 +35,30 @@
virtual ~Entry() = default;
/** @brief Constructor to put object onto bus at a dbus path.
+ * Defer signal registration (pass true for deferSignal to the
+ * base class) until after the properties are set.
* @param[in] bus - Bus to attach to.
* @param[in] path - Path to attach at.
+ * @param[in] properties - Desired Entry properties.
*/
- Entry(sdbusplus::bus::bus& bus, const char* path) :
- details::ServerObject<details::EntryIface>(bus, path) {};
+ Entry(sdbusplus::bus::bus& bus,
+ const std::string& path,
+ uint32_t idErr,
+ Level severityErr,
+ std::string&& msgErr,
+ std::vector<std::string>&& additionalDataErr) :
+ details::ServerObject<details::EntryIface>
+ (bus, path.c_str(), true)
+ {
+ id(idErr);
+ severity(severityErr);
+ message(std::move(msgErr));
+ additionalData(std::move(additionalDataErr));
+
+ // Emit deferred signal.
+ this->emit_object_added();
+ };
+
};
} // namespace logging