blob: 3bec2a9ba3a5e0477073d9dc5d4987510d17874a [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.
26 * Allowed:
27 * - Move operations.
28 * - Destructor.
29 */
30 Manager() = delete;
31 Manager(const Manager&) = delete;
32 Manager& operator=(const Manager&) = delete;
33 Manager(Manager&&) = default;
34 Manager& operator=(Manager&&) = default;
35 virtual ~Manager() = default;
36
37 /** @brief Constructor to put object onto bus at a dbus path.
38 * @param[in] bus - Bus to attach to.
39 * @param[in] path - Path to attach at.
40 */
41 Manager(bus::bus& bus, const char* path);
42
43
44
45 /** @brief Implementation for Commit
46 * Write the requested error/event entry with its associated metadata fields to flash.
47 *
48 * @param[in] transactionId - The unique identifier of the journal entry(ies) to be committed.
49 * @param[in] errMsg - The error exception message associated with the error event log to be committed.
50 */
51 virtual void commit(
52 uint64_t transactionId,
53 std::string errMsg) = 0;
54
55
56
57
58 private:
59
60 /** @brief sd-bus callback for Commit
61 */
62 static int _callback_Commit(
63 sd_bus_message*, void*, sd_bus_error*);
64
65
66 static constexpr auto _interface = "xyz.openbmc_project.Logging.Internal.Manager";
67 static const vtable::vtable_t _vtable[];
68 sdbusplus::server::interface::interface
69 _xyz_openbmc_project_Logging_Internal_Manager_interface;
70
71
72};
73
74
75} // namespace server
76} // namespace Internal
77} // namespace Logging
78} // namespace openbmc_project
79} // namespace xyz
80} // namespace sdbusplus
81