blob: 5c6c5fe5de35417244d5e0dafdbb5341ca7455b1 [file] [log] [blame]
Adriana Kobylak2d8fa222017-03-15 12:34:32 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <xyz/openbmc_project/Software/Activation/server.hpp>
Adriana Kobylakea9626f2017-04-05 15:37:40 -05005#include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp>
Saqib Khan7254f0e2017-04-10 21:45:37 -05006#include "xyz/openbmc_project/Software/ExtendedVersion/server.hpp"
Adriana Kobylak2d8fa222017-03-15 12:34:32 -05007
8namespace openpower
9{
10namespace software
11{
Adriana Kobylakbefe5ce2017-04-05 15:57:44 -050012namespace updater
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050013{
14
15using ActivationInherit = sdbusplus::server::object::object<
Saqib Khan7254f0e2017-04-10 21:45:37 -050016 sdbusplus::xyz::openbmc_project::Software::server::ExtendedVersion,
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050017 sdbusplus::xyz::openbmc_project::Software::server::Activation>;
Adriana Kobylakea9626f2017-04-05 15:37:40 -050018using ActivationBlocksTransitionInherit = sdbusplus::server::object::object<
19 sdbusplus::xyz::openbmc_project::Software::server::ActivationBlocksTransition>;
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050020
21/** @class Activation
22 * @brief OpenBMC activation software management implementation.
23 * @details A concrete implementation for
24 * xyz.openbmc_project.Software.Activation DBus API.
25 */
26class Activation : public ActivationInherit
27{
28 public:
29 /** @brief Constructs Activation Software Manager
30 *
31 * @param[in] bus - The Dbus bus object
32 * @param[in] path - The Dbus object path
Saqib Khan7254f0e2017-04-10 21:45:37 -050033 * @param[in] versionId - The software version id
34 * @param[in] extVersion - The extended version
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050035 */
Adriana Kobylakbc37a4c2017-04-10 09:45:36 -050036 Activation(sdbusplus::bus::bus& bus, const std::string& path,
Saqib Khan7254f0e2017-04-10 21:45:37 -050037 std::string& versionId,
38 std::string& extVersion) :
39 ActivationInherit(bus, path.c_str(), true),
40 versionId(versionId)
41 {
42 // Set Properties.
43 extendedVersion(extVersion);
44
45 // Emit deferred signal.
46 emit_object_added();
47 }
Adriana Kobylakbefe5ce2017-04-05 15:57:44 -050048
49 /** @brief Overloaded Activation property setter function
50 *
51 * @param[in] value - One of Activation::Activations
52 *
53 * @return Success or exception thrown
54 */
55 Activations activation(Activations value) override;
56
57 /** @brief Overloaded requestedActivation property setter function
58 *
59 * @param[in] value - One of Activation::RequestedActivations
60 *
61 * @return Success or exception thrown
62 */
63 RequestedActivations requestedActivation(RequestedActivations value)
64 override;
65
Adriana Kobylakbc37a4c2017-04-10 09:45:36 -050066 /** @brief Version id */
67 std::string versionId;
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050068};
69
Adriana Kobylakea9626f2017-04-05 15:37:40 -050070/** @class ActivationBlocksTransition
71 * @brief OpenBMC ActivationBlocksTransition implementation.
72 * @details A concrete implementation for
73 * xyz.openbmc_project.Software.ActivationBlocksTransition DBus API.
74 */
75class ActivationBlocksTransition : public ActivationBlocksTransitionInherit
76{
77 public:
78 /** @brief Constructs ActivationBlocksTransition.
79 *
80 * @param[in] bus - The Dbus bus object
81 * @param[in] path - The Dbus object path
82 */
83 ActivationBlocksTransition(sdbusplus::bus::bus& bus,
84 const std::string& path) :
85 ActivationBlocksTransitionInherit(bus, path.c_str()) {}
86};
87
Adriana Kobylakbefe5ce2017-04-05 15:57:44 -050088} // namespace updater
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050089} // namespace software
90} // namespace openpower
91