blob: 6ef0fa0a557e8613e99717885a7c459fd890e4b6 [file] [log] [blame]
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <sdbusplus/server/object.hpp>
5
6#include "xyz/openbmc_project/Dump/Internal/Create/server.hpp"
7
8namespace phosphor
9{
10namespace dump
11{
Brad Bishopae871bd2018-10-18 16:32:05 -040012
13class Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050014namespace internal
15{
16
17using CreateIface = sdbusplus::server::object::object<
18 sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>;
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050019using Mgr = phosphor::dump::Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050020
21/** @class Manager
22 * @brief Implementation for the
23 * xyz.openbmc_project.Dump.Internal.Create DBus API.
24 */
25class Manager : public CreateIface
26{
27 public:
28 Manager() = delete;
29 Manager(const Manager&) = delete;
30 Manager& operator=(const Manager&) = delete;
31 Manager(Manager&&) = delete;
32 Manager& operator=(Manager&&) = delete;
33 virtual ~Manager() = default;
34
35 /** @brief Constructor to put object onto bus at a dbus path.
36 * @param[in] bus - Bus to attach to.
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050037 * @param[in] dumpMgr - Dump Manager object
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050038 * @param[in] path - Path to attach at.
39 */
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050040 Manager(sdbusplus::bus::bus& bus, Mgr& dumpMgr, const char* path):
41 CreateIface(bus, path),
42 dumpMgr(dumpMgr) {};
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050043
44 /** @brief Implementation for Create
45 * Create BMC Dump based on the Dump type.
46 *
47 * @param[in] type - Type of the Dump.
48 * @param[in] fullPaths - List of absolute paths to the files
49 * to be included as part of Dump package.
50 */
51 void create(
52 Type type,
53 std::vector<std::string> fullPaths) override;
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050054 private:
55 /** @brief Dump Manager object. */
56 Mgr& dumpMgr;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050057};
58
59} // namespace internal
60} // namespace dump
61} // namespace phosphor