]> granicus.if.org Git - icinga2/blob - lib/icinga/compatutility.h
ido: Implement commanddbobjects.
[icinga2] / lib / icinga / compatutility.h
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 #ifndef COMPATUTILITY_H
21 #define COMPATUTILITY_H
22
23 #include "icinga/i2-icinga.h"
24 #include "icinga/service.h"
25 #include "icinga/checkcommand.h"
26 #include "base/dictionary.h"
27 #include <vector>
28
29 namespace icinga
30 {
31
32 /**
33  * @ingroup icinga
34  */
35 enum CompatObjectType
36 {
37         CompatTypeService,
38         CompatTypeHost
39 };
40
41 /**
42  * Compatibility utility functions.
43  *
44  * @ingroup icinga
45  */
46 class I2_ICINGA_API CompatUtility
47 {
48 public:
49         static Dictionary::Ptr GetServiceStatusAttributes(const Service::Ptr& service, CompatObjectType type);
50         static Dictionary::Ptr GetServiceConfigAttributes(const Service::Ptr& service, CompatObjectType type);
51
52         static Dictionary::Ptr GetCommandConfigAttributes(const Command::Ptr& command);
53         static String EscapeString(const String& str);
54
55 private:
56         CompatUtility(void);
57 };
58
59 }
60
61 #endif /* COMPATUTILITY_H */