blob: c58dc7da360170371ac9b391d4c47a6581d26b55 [file] [log] [blame]
Matt Spinler56fd8332017-10-31 14:00:18 -05001#pragma once
2#include "callback.hpp"
3
4namespace phosphor
5{
6namespace dbus
7{
8namespace 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 */
18class ResolveCallout : public Callback
19{
Brad Bishopd1eac882018-03-29 10:34:05 -040020 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 Spinler56fd8332017-10-31 14:00:18 -050027
Brad Bishopd1eac882018-03-29 10:34:05 -040028 /**
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 Spinler56fd8332017-10-31 14:00:18 -050037
Brad Bishopd1eac882018-03-29 10:34:05 -040038 /**
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 Spinler56fd8332017-10-31 14:00:18 -050045
Brad Bishopd1eac882018-03-29 10:34:05 -040046 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 Spinler56fd8332017-10-31 14:00:18 -050053
Brad Bishopd1eac882018-03-29 10:34:05 -040054 /**
55 * @brief The object path of the callout, typically an inventory path
56 */
57 std::string callout;
Matt Spinler56fd8332017-10-31 14:00:18 -050058};
59
Matt Spinler56fd8332017-10-31 14:00:18 -050060} // namespace monitoring
61} // namespace dbus
62} // namespace phosphor