blob: bbbdef8c05c50fdc4a9294ad42dc860f1bc30e29 [file] [log] [blame]
Adriana Kobylak8f7941e2016-11-14 14:46:23 -06001#pragma once
2#include <tuple>
3#include <systemd/sd-bus.h>
4#include <sdbusplus/server.hpp>
5
6namespace sdbusplus
7{
8namespace xyz
9{
10namespace openbmc_project
11{
12namespace Logging
13{
14namespace Internal
15{
16namespace server
17{
18
19class Manager
20{
21 public:
22 /* Define all of the basic class operations:
23 * Not allowed:
24 * - Default constructor to avoid nullptrs.
25 * - Copy operations due to internal unique_ptr.
Adriana Kobylakf477fe22017-01-06 11:56:41 -060026 * - Move operations due to 'this' being registered as the
27 * 'context' with sdbus.
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060028 * Allowed:
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060029 * - Destructor.
30 */
31 Manager() = delete;
32 Manager(const Manager&) = delete;
33 Manager& operator=(const Manager&) = delete;
Adriana Kobylakf477fe22017-01-06 11:56:41 -060034 Manager(Manager&&) = delete;
35 Manager& operator=(Manager&&) = delete;
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060036 virtual ~Manager() = default;
37
38 /** @brief Constructor to put object onto bus at a dbus path.
39 * @param[in] bus - Bus to attach to.
40 * @param[in] path - Path to attach at.
41 */
42 Manager(bus::bus& bus, const char* path);
43
44
45
46 /** @brief Implementation for Commit
47 * Write the requested error/event entry with its associated metadata fields to flash.
48 *
49 * @param[in] transactionId - The unique identifier of the journal entry(ies) to be committed.
50 * @param[in] errMsg - The error exception message associated with the error event log to be committed.
51 */
52 virtual void commit(
53 uint64_t transactionId,
54 std::string errMsg) = 0;
55
56
57
58
59 private:
60
61 /** @brief sd-bus callback for Commit
62 */
63 static int _callback_Commit(
64 sd_bus_message*, void*, sd_bus_error*);
65
66
67 static constexpr auto _interface = "xyz.openbmc_project.Logging.Internal.Manager";
68 static const vtable::vtable_t _vtable[];
69 sdbusplus::server::interface::interface
70 _xyz_openbmc_project_Logging_Internal_Manager_interface;
71
72
73};
74
75
76} // namespace server
77} // namespace Internal
78} // namespace Logging
79} // namespace openbmc_project
80} // namespace xyz
81} // namespace sdbusplus
82