blob: 948dc3ddb293d8295dec67b69f68084934dcb1db [file] [log] [blame]
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -05001#pragma once
2
3#include "dump_manager.hpp"
4#include "dump_utils.hpp"
5#include "xyz/openbmc_project/Dump/NewDump/server.hpp"
6
7#include <sdbusplus/bus.hpp>
8#include <sdbusplus/server/object.hpp>
9
10namespace phosphor
11{
12namespace dump
13{
14namespace system
15{
16
17using NotifyIface = sdbusplus::server::object::object<
18 sdbusplus::xyz::openbmc_project::Dump::server::NewDump>;
19
20/** @class Manager
21 * @brief System Dump manager implementation.
22 * @details A concrete implementation for the
23 * xyz.openbmc_project.Dump.Notify DBus API
24 */
25class Manager : virtual public NotifyIface,
26 virtual public phosphor::dump::Manager
27{
28 public:
29 Manager() = delete;
30 Manager(const Manager&) = default;
31 Manager& operator=(const Manager&) = delete;
32 Manager(Manager&&) = delete;
33 Manager& operator=(Manager&&) = delete;
34 virtual ~Manager() = default;
35
36 /** @brief Constructor to put object onto bus at a dbus path.
37 * @param[in] bus - Bus to attach to.
38 * @param[in] event - Dump manager sd_event loop.
39 * @param[in] path - Path to attach at.
40 * @param[in] baseEntryPath - Base path of the dump entry.
41 */
42 Manager(sdbusplus::bus::bus& bus, const char* path,
43 const std::string& baseEntryPath) :
44 NotifyIface(bus, path),
45 phosphor::dump::Manager(bus, path, baseEntryPath)
46 {
47 }
48
49 void restore() override
50 {
51 // TODO #2597 Implement the restore to restore the dump entries
52 // after the service restart.
53 }
54
55 /** @brief Notify the system dump manager about creation of a new dump.
56 * @param[in] dumpType - Type of the Dump.
57 * @param[in] dumpId - Id from the source of the dump.
58 * @param[in] size - Size of the dump.
59 */
60 void notify(NewDump::DumpType dumpType, uint32_t dumpId,
61 uint64_t size) override;
62};
63
64} // namespace system
65} // namespace dump
66} // namespace phosphor