Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | #include "callback.hpp" |
| 3 | |
| 4 | namespace phosphor |
| 5 | { |
| 6 | namespace dbus |
| 7 | { |
| 8 | namespace monitoring |
| 9 | { |
| 10 | |
| 11 | /** |
| 12 | * @class ResolveCallout |
| 13 | * @brief Resolves error logs with the associated callout |
| 14 | * |
| 15 | * Resolves a log by setting its Resolved property |
| 16 | * to true. |
| 17 | */ |
| 18 | class ResolveCallout : public Callback |
| 19 | { |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 20 | public: |
| 21 | ResolveCallout() = delete; |
| 22 | ~ResolveCallout() = default; |
| 23 | ResolveCallout(const ResolveCallout&) = delete; |
| 24 | ResolveCallout& operator=(const ResolveCallout&) = delete; |
| 25 | ResolveCallout(ResolveCallout&&) = default; |
| 26 | ResolveCallout& operator=(ResolveCallout&&) = default; |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 27 | |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 28 | /** |
| 29 | * @brief constructor |
| 30 | * |
| 31 | * @param[in] callout - The callout whose errors need to be resolved. |
| 32 | * Normally an inventory path. |
| 33 | */ |
| 34 | explicit ResolveCallout(const std::string& callout) : callout(callout) |
| 35 | { |
| 36 | } |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 37 | |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 38 | /** |
| 39 | * @brief Callback interface to resolve errors |
| 40 | * |
| 41 | * Resolves all error log entries that are associated |
| 42 | * with the callout. |
| 43 | */ |
| 44 | void operator()(Context ctx) override; |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 45 | |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 46 | private: |
| 47 | /** |
| 48 | * @brief Resolves a single error log entry |
| 49 | * |
| 50 | * param[in] entry - the object path of the error log entry |
| 51 | */ |
| 52 | void resolve(const std::string& entry); |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 53 | |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 54 | /** |
| 55 | * @brief The object path of the callout, typically an inventory path |
| 56 | */ |
| 57 | std::string callout; |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 58 | }; |
| 59 | |
Matt Spinler | 56fd833 | 2017-10-31 14:00:18 -0500 | [diff] [blame] | 60 | } // namespace monitoring |
| 61 | } // namespace dbus |
| 62 | } // namespace phosphor |