]> granicus.if.org Git - icinga2/blob - lib/icinga/notificationrequestmessage.cpp
compatlog: refactor custom/acknowledgement notifications with author/commenttext
[icinga2] / lib / icinga / notificationrequestmessage.cpp
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
4  *                                                                            *
5  * This program is free software; you can redistribute it and/or              *
6  * modify it under the terms of the GNU General Public License                *
7  * as published by the Free Software Foundation; either version 2             *
8  * of the License, or (at your option) any later version.                     *
9  *                                                                            *
10  * This program is distributed in the hope that it will be useful,            *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13  * GNU General Public License for more details.                               *
14  *                                                                            *
15  * You should have received a copy of the GNU General Public License          *
16  * along with this program; if not, write to the Free Software Foundation     *
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18  ******************************************************************************/
19
20 #include "icinga/notificationrequestmessage.h"
21
22 using namespace icinga;
23
24 String NotificationRequestMessage::GetService(void) const
25 {
26         String service;
27         Get("service", &service);
28         return service;
29 }
30
31 void NotificationRequestMessage::SetService(const String& service)
32 {
33         Set("service", service);
34 }
35
36 NotificationType NotificationRequestMessage::GetType(void) const
37 {
38         int type;
39         Get("type", &type);
40         return static_cast<NotificationType>(type);
41 }
42
43 void NotificationRequestMessage::SetType(NotificationType type)
44 {
45         Set("type", type);
46 }
47
48 Dictionary::Ptr NotificationRequestMessage::GetCheckResult(void) const
49 {
50         Dictionary::Ptr cr;
51         Get("check_result", &cr);
52         return cr;
53 }
54
55 void NotificationRequestMessage::SetCheckResult(const Dictionary::Ptr& cr)
56 {
57         Set("check_result", cr);
58 }
59
60 String NotificationRequestMessage::GetAuthor(void) const
61 {
62         String author;
63         Get("author", &author);
64         return author;
65 }
66
67 void NotificationRequestMessage::SetAuthor(const String& author)
68 {
69         Set("author", author);
70 }
71
72 String NotificationRequestMessage::GetText(void) const
73 {
74         String text;
75         Get("text", &text);
76         return text;
77 }
78
79 void NotificationRequestMessage::SetText(const String& text)
80 {
81         Set("text", text);
82 }