blob: cae4bbc579edbdae62441585c9a583b95a29e5f6 [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{
20 public:
21
22 ResolveCallout() = delete;
23 ~ResolveCallout() = default;
24 ResolveCallout(const ResolveCallout&) = delete;
25 ResolveCallout& operator=(const ResolveCallout&) = delete;
26 ResolveCallout(ResolveCallout&&) = default;
27 ResolveCallout& operator=(ResolveCallout&&) = default;
28
29 /**
30 * @brief constructor
31 *
32 * @param[in] callout - The callout whose errors need to be resolved.
33 * Normally an inventory path.
34 */
35 explicit ResolveCallout(const std::string& callout) :
36 callout(callout) {}
37
38 /**
39 * @brief Callback interface to resolve errors
40 *
41 * Resolves all error log entries that are associated
42 * with the callout.
43 */
Ratan Guptaa45e0862018-02-21 19:03:13 +053044 void operator()(Context ctx) override;
Matt Spinler56fd8332017-10-31 14:00:18 -050045
46 private:
47
48 /**
49 * @brief Resolves a single error log entry
50 *
51 * param[in] entry - the object path of the error log entry
52 */
53 void resolve(const std::string& entry);
54
55 /**
56 * @brief The object path of the callout, typically an inventory path
57 */
58 std::string callout;
59};
60
61
62} // namespace monitoring
63} // namespace dbus
64} // namespace phosphor