]> granicus.if.org Git - icinga2/blob - lib/livestatus/downtimestable.hpp
add some object locking to the Dump method (which could theoreticylly suffer from...
[icinga2] / lib / livestatus / downtimestable.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef DOWNTIMESTABLE_H
4 #define DOWNTIMESTABLE_H
5
6 #include "livestatus/table.hpp"
7
8 using namespace icinga;
9
10 namespace icinga
11 {
12
13 /**
14  * @ingroup livestatus
15  */
16 class DowntimesTable final : public Table
17 {
18 public:
19         DECLARE_PTR_TYPEDEFS(DowntimesTable);
20
21         DowntimesTable();
22
23         static void AddColumns(Table *table, const String& prefix = String(),
24                 const Column::ObjectAccessor& objectAccessor = Column::ObjectAccessor());
25
26         String GetName() const override;
27         String GetPrefix() const override;
28
29 protected:
30         void FetchRows(const AddRowFunction& addRowFn) override;
31
32 private:
33         static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
34         static Object::Ptr ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
35
36         static Value AuthorAccessor(const Value& row);
37         static Value CommentAccessor(const Value& row);
38         static Value IdAccessor(const Value& row);
39         static Value EntryTimeAccessor(const Value& row);
40         static Value TypeAccessor(const Value& row);
41         static Value IsServiceAccessor(const Value& row);
42         static Value StartTimeAccessor(const Value& row);
43         static Value EndTimeAccessor(const Value& row);
44         static Value FixedAccessor(const Value& row);
45         static Value DurationAccessor(const Value& row);
46         static Value TriggeredByAccessor(const Value& row);
47 };
48
49 }
50
51 #endif /* DOWNTIMESTABLE_H */