blob: 13e38d9498e506dc64fd35c872e5ff9f5a711163 [file] [log] [blame]
Adriana Kobylak8f7941e2016-11-14 14:46:23 -06001#pragma once
2
Adriana Kobylakf477fe22017-01-06 11:56:41 -06003#include <sdbusplus/bus.hpp>
Adriana Kobylak8f7941e2016-11-14 14:46:23 -06004#include "xyz/openbmc_project/Logging/Internal/Manager/server.hpp"
5
6namespace phosphor
7{
8namespace logging
9{
10namespace details
11{
12
13template <typename T>
14using ServerObject = typename sdbusplus::server::object::object<T>;
15
16using ManagerIface =
17 sdbusplus::xyz::openbmc_project::Logging::Internal::server::Manager;
18
19} // namespace details
20
21/** @class Manager
22 * @brief OpenBMC logging manager implementation.
23 * @details A concrete implementation for the
24 * xyz.openbmc_project.Logging.Internal.Manager DBus API.
25 */
Adriana Kobylakf477fe22017-01-06 11:56:41 -060026class Manager : public details::ServerObject<details::ManagerIface>
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060027{
28 public:
29 Manager() = delete;
30 Manager(const Manager&) = delete;
31 Manager& operator=(const Manager&) = delete;
Adriana Kobylakf477fe22017-01-06 11:56:41 -060032 Manager(Manager&&) = delete;
33 Manager& operator=(Manager&&) = delete;
34 virtual ~Manager() = default;
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060035
Adriana Kobylakf477fe22017-01-06 11:56:41 -060036 /** @brief Constructor to put object onto bus at a dbus path.
37 * @param[in] bus - Bus to attach to.
38 * @param[in] path - Path to attach at.
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060039 */
Adriana Kobylakf477fe22017-01-06 11:56:41 -060040 Manager(sdbusplus::bus::bus& bus, const char* path) :
41 details::ServerObject<details::ManagerIface>(bus, path) {};
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060042
43 /*
44 * @fn commit()
45 * @brief sd_bus Commit method implementation callback.
46 * @details Create an error/event log based on transaction id and
47 * error message.
48 * @param[in] transactionId - Unique identifier of the journal entries
49 * to be committed.
50 * @param[in] errMsg - The error exception message associated with the
51 * error log to be committed.
52 */
53 void commit(uint64_t transactionId, std::string errMsg) override;
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060054};
55
56} // namespace logging
57} // namespace phosphor