Create a DBus notification for each LogEntry

For each log entry, a new FilePath DBus object will be created where
the FilePath.path value is the location of the JSON LogEntry file.

Tested:
Tested with unit tests and locally on a machine.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I5999826f7b4447bfca88b83c487d7c03a1c84a08
diff --git a/src/rde/external_storer_file.cpp b/src/rde/external_storer_file.cpp
index 0768134..97f2b10 100644
--- a/src/rde/external_storer_file.cpp
+++ b/src/rde/external_storer_file.cpp
@@ -44,10 +44,11 @@
 }
 
 ExternalStorerFileInterface::ExternalStorerFileInterface(
-    std::string_view rootPath,
+    sdbusplus::bus::bus& bus, std::string_view rootPath,
     std::unique_ptr<FileHandlerInterface> fileHandler) :
-    rootPath(rootPath),
-    fileHandler(std::move(fileHandler)), logServiceId("")
+    bus(bus),
+    rootPath(rootPath), fileHandler(std::move(fileHandler)), logServiceId(""),
+    cperNotifier(std::make_unique<CperFileNotifierHandler>(bus))
 {}
 
 bool ExternalStorerFileInterface::publishJson(std::string_view jsonStr)
@@ -115,8 +116,9 @@
     }
 
     std::string id = boost::uuids::to_string(randomGen());
-    std::string path = "/redfish/v1/Systems/system/LogServices/" +
-                       logServiceId + "/Entries/" + id;
+    std::string fullPath =
+        fmt::format("{}/redfish/v1/Systems/system/LogServices/{}/Entries/{}",
+                    rootPath, logServiceId, id);
 
     // Populate the "Id" with the UUID we generated.
     logEntry["Id"] = id;
@@ -124,7 +126,15 @@
     // a client.
     logEntry.erase("@odata.id");
 
-    return createFile(path, logEntry);
+    if (!fileHandler->createFile(fullPath, logEntry))
+    {
+        fmt::print(stderr, "Failed to create a file for log entry path: {}\n",
+                   fullPath);
+        return false;
+    }
+
+    cperNotifier->createEntry(fullPath + "/index.json");
+    return true;
 }
 
 bool ExternalStorerFileInterface::processLogService(