Create dump manager for each dump type.

Currently all types of dumps exist in the same path
and under the single dump manager. When there are
multiple dumps to be created separate path is needed
for creating and managing the dump. this commit
is splitting the dump manager into multiple objects
without  adding any new functionality. There will be
only one dump manager process but it will contain
seperate dump manager objects for system and BMC
dumps as per current scope.

Tested the existing dump functions with the build
- created bmc dump
- created system dump using notify
- deleted dump entry
- offloaded bmc dump

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: Id4806660be1f1ba0b3cb6f840ae185a967f05a83
diff --git a/dump_manager_system.cpp b/dump_manager_system.cpp
new file mode 100644
index 0000000..ab7ca72
--- /dev/null
+++ b/dump_manager_system.cpp
@@ -0,0 +1,43 @@
+#include "config.h"
+
+#include "dump_manager_system.hpp"
+
+#include "system_dump_entry.hpp"
+
+#include <phosphor-logging/elog.hpp>
+
+namespace phosphor
+{
+namespace dump
+{
+namespace system
+{
+
+using namespace phosphor::logging;
+
+void Manager::notify(NewDump::DumpType dumpType, uint32_t dumpId, uint64_t size)
+{
+
+    if (dumpType != NewDump::DumpType::System)
+    {
+        log<level::ERR>("Only system dump is supported",
+                        entry("DUMPTYPE=%d", dumpType));
+        return;
+    }
+    // Get the timestamp
+    auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
+                  std::chrono::system_clock::now().time_since_epoch())
+                  .count();
+    // Get the id
+    auto id = lastEntryId + 1;
+    auto idString = std::to_string(id);
+    auto objPath = fs::path(baseEntryPath) / idString;
+    entries.insert(std::make_pair(
+        id, std::make_unique<system::Entry>(bus, objPath.c_str(), id, ms, size,
+                                            dumpId, *this)));
+    lastEntryId++;
+}
+
+} // namespace system
+} // namespace dump
+} // namespace phosphor