Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include <xyz/openbmc_project/Software/Activation/server.hpp> |
Adriana Kobylak | ea9626f | 2017-04-05 15:37:40 -0500 | [diff] [blame] | 5 | #include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp> |
Saqib Khan | 7254f0e | 2017-04-10 21:45:37 -0500 | [diff] [blame^] | 6 | #include "xyz/openbmc_project/Software/ExtendedVersion/server.hpp" |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 7 | |
| 8 | namespace openpower |
| 9 | { |
| 10 | namespace software |
| 11 | { |
Adriana Kobylak | befe5ce | 2017-04-05 15:57:44 -0500 | [diff] [blame] | 12 | namespace updater |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 13 | { |
| 14 | |
| 15 | using ActivationInherit = sdbusplus::server::object::object< |
Saqib Khan | 7254f0e | 2017-04-10 21:45:37 -0500 | [diff] [blame^] | 16 | sdbusplus::xyz::openbmc_project::Software::server::ExtendedVersion, |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 17 | sdbusplus::xyz::openbmc_project::Software::server::Activation>; |
Adriana Kobylak | ea9626f | 2017-04-05 15:37:40 -0500 | [diff] [blame] | 18 | using ActivationBlocksTransitionInherit = sdbusplus::server::object::object< |
| 19 | sdbusplus::xyz::openbmc_project::Software::server::ActivationBlocksTransition>; |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 20 | |
| 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 | */ |
| 26 | class 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 Khan | 7254f0e | 2017-04-10 21:45:37 -0500 | [diff] [blame^] | 33 | * @param[in] versionId - The software version id |
| 34 | * @param[in] extVersion - The extended version |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 35 | */ |
Adriana Kobylak | bc37a4c | 2017-04-10 09:45:36 -0500 | [diff] [blame] | 36 | Activation(sdbusplus::bus::bus& bus, const std::string& path, |
Saqib Khan | 7254f0e | 2017-04-10 21:45:37 -0500 | [diff] [blame^] | 37 | 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 Kobylak | befe5ce | 2017-04-05 15:57:44 -0500 | [diff] [blame] | 48 | |
| 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 Kobylak | bc37a4c | 2017-04-10 09:45:36 -0500 | [diff] [blame] | 66 | /** @brief Version id */ |
| 67 | std::string versionId; |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 68 | }; |
| 69 | |
Adriana Kobylak | ea9626f | 2017-04-05 15:37:40 -0500 | [diff] [blame] | 70 | /** @class ActivationBlocksTransition |
| 71 | * @brief OpenBMC ActivationBlocksTransition implementation. |
| 72 | * @details A concrete implementation for |
| 73 | * xyz.openbmc_project.Software.ActivationBlocksTransition DBus API. |
| 74 | */ |
| 75 | class 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 Kobylak | befe5ce | 2017-04-05 15:57:44 -0500 | [diff] [blame] | 88 | } // namespace updater |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 89 | } // namespace software |
| 90 | } // namespace openpower |
| 91 | |