blob: 895ca375c62d3426b91f3b9ca29749cd41c8a0f7 [file] [log] [blame]
Dhruvaraj Subhashchandranf140f662020-01-30 00:29:01 -06001#pragma once
2
3#include "dump_entry.hpp"
4#include "xyz/openbmc_project/Dump/Entry/System/server.hpp"
5
6#include <sdbusplus/bus.hpp>
7#include <sdbusplus/server/object.hpp>
8
9namespace phosphor
10{
11namespace dump
12{
13namespace system
14{
15template <typename T>
16using ServerObject = typename sdbusplus::server::object::object<T>;
17
18using EntryIfaces = sdbusplus::server::object::object<
19 sdbusplus::xyz::openbmc_project::Dump::Entry::server::System>;
20
21namespace fs = std::experimental::filesystem;
22
23class Manager;
24
25/** @class Entry
26 * @brief System Dump Entry implementation.
27 * @details A concrete implementation for the
28 * xyz.openbmc_project.Dump.Entry DBus API
29 */
30class Entry : virtual public EntryIfaces, virtual public phosphor::dump::Entry
31{
32 public:
33 Entry() = delete;
34 Entry(const Entry&) = delete;
35 Entry& operator=(const Entry&) = delete;
36 Entry(Entry&&) = delete;
37 Entry& operator=(Entry&&) = delete;
38 ~Entry() = default;
39
40 /** @brief Constructor for the Dump Entry Object
41 * @param[in] bus - Bus to attach to.
42 * @param[in] objPath - Object path to attach to
43 * @param[in] dumpId - Dump id.
44 * @param[in] timeStamp - Dump creation timestamp
45 * since the epoch.
46 * @param[in] dumpSize - Dump size in bytes.
47 * @param[in] sourceId - DumpId provided by the source..
48 * @param[in] parent - The dump entry's parent.
49 */
50 Entry(sdbusplus::bus::bus& bus, const std::string& objPath, uint32_t dumpId,
51 uint64_t timeStamp, uint64_t dumpSize, const uint32_t sourceId,
52 phosphor::dump::Manager& parent) :
53 EntryIfaces(bus, objPath.c_str(), true),
54 phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, dumpSize,
55 parent)
56 {
57 sourceDumpId(sourceId);
58 };
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -060059
60 /** @brief Method to initiate the offload of dump
61 * @param[in] uri - URI to offload dump.
62 */
63 void initiateOffload(std::string uri);
Dhruvaraj Subhashchandranf140f662020-01-30 00:29:01 -060064};
65
66} // namespace system
67} // namespace dump
68} // namespace phosphor