blob: d13ae242c2db6f192b93c795150e43ec6def4f11 [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{
12namespace internal
13{
14
15using CreateIface = sdbusplus::server::object::object<
16 sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>;
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050017using Mgr = phosphor::dump::Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050018
19/** @class Manager
20 * @brief Implementation for the
21 * xyz.openbmc_project.Dump.Internal.Create DBus API.
22 */
23class Manager : public CreateIface
24{
25 public:
26 Manager() = delete;
27 Manager(const Manager&) = delete;
28 Manager& operator=(const Manager&) = delete;
29 Manager(Manager&&) = delete;
30 Manager& operator=(Manager&&) = delete;
31 virtual ~Manager() = default;
32
33 /** @brief Constructor to put object onto bus at a dbus path.
34 * @param[in] bus - Bus to attach to.
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050035 * @param[in] dumpMgr - Dump Manager object
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050036 * @param[in] path - Path to attach at.
37 */
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050038 Manager(sdbusplus::bus::bus& bus, Mgr& dumpMgr, const char* path):
39 CreateIface(bus, path),
40 dumpMgr(dumpMgr) {};
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050041
42 /** @brief Implementation for Create
43 * Create BMC Dump based on the Dump type.
44 *
45 * @param[in] type - Type of the Dump.
46 * @param[in] fullPaths - List of absolute paths to the files
47 * to be included as part of Dump package.
48 */
49 void create(
50 Type type,
51 std::vector<std::string> fullPaths) override;
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050052 private:
53 /** @brief Dump Manager object. */
54 Mgr& dumpMgr;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050055};
56
57} // namespace internal
58} // namespace dump
59} // namespace phosphor