Add Serialization Support for Dump Entry Attributes

Implemented serialization of dump entry attributes using the
nlohmann::json library. Added serialization support in the Dump Entry
class, serializing attributes including originatorId, originatorType,
and startTime. These attributes are not part of the dump filename and
thus require serialization to ensure their state is preserved.

Deserialization will occur only if the serialization version matches
and the dump ID in the dump object matches the ID in the
serialized file.

Tests:
- Created BMC dumps and restarted service
- Created BMC dumps and restarted BMC
- Created 200 BMC dumps and restarted service and BMC multiple times

File:
```
{"dumpId":2,"originatorId":"","originatorType":1,"startTime":1718199238942411,"version":1}
```

Change-Id: I16ecb058bddd464c8771bd8d08a50ea1877747ed
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/dump_entry.hpp b/dump_entry.hpp
index 8f6cf2f..b30489b 100644
--- a/dump_entry.hpp
+++ b/dump_entry.hpp
@@ -6,18 +6,30 @@
 #include "xyz/openbmc_project/Object/Delete/server.hpp"
 #include "xyz/openbmc_project/Time/EpochTime/server.hpp"
 
+#include <phosphor-logging/lg2.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/source/event.hpp>
 
 #include <filesystem>
+#include <fstream>
 
 namespace phosphor
 {
 namespace dump
 {
 
+// Current serialiation version of the class increment if there any change
+// in the serialized data members
+constexpr size_t CLASS_SERIALIZATION_VERSION = 1;
+
+// Folder to store serialized dump contents
+constexpr auto PRESERVE = ".preserve";
+
+// Binary file store the contents
+constexpr auto SERIAL_FILE = "serialized_entry.json";
+
 template <typename T>
 using ServerObject = typename sdbusplus::server::object_t<T>;
 
@@ -127,6 +139,19 @@
      */
     sdbusplus::message::unix_fd getFileHandle() override;
 
+    /**
+     * @brief Serialize the dump entry attributes to a file.
+     *
+     */
+    virtual void serialize();
+
+    /**
+     * @brief Deserialize the dump entry attributes from a file.
+     *
+     * @param[in] dumpPath - The path where the .preserve folder is located.
+     */
+    virtual void deserialize(const std::filesystem::path& dumpPath);
+
   protected:
     /** @brief This entry's parent */
     Manager& parent;