1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2 
3 #include "db_ido/dbquery.hpp"
4 #include "base/initialize.hpp"
5 #include "base/scriptglobal.hpp"
6 
7 using namespace icinga;
8 
9 INITIALIZE_ONCE(&DbQuery::StaticInitialize);
10 
11 std::map<String, int> DbQuery::m_CategoryFilterMap;
12 
StaticInitialize()13 void DbQuery::StaticInitialize()
14 {
15 	ScriptGlobal::Set("Icinga.DbCatConfig", DbCatConfig, true);
16 	ScriptGlobal::Set("Icinga.DbCatState", DbCatState, true);
17 	ScriptGlobal::Set("Icinga.DbCatAcknowledgement", DbCatAcknowledgement, true);
18 	ScriptGlobal::Set("Icinga.DbCatComment", DbCatComment, true);
19 	ScriptGlobal::Set("Icinga.DbCatDowntime", DbCatDowntime, true);
20 	ScriptGlobal::Set("Icinga.DbCatEventHandler", DbCatEventHandler, true);
21 	ScriptGlobal::Set("Icinga.DbCatExternalCommand", DbCatExternalCommand, true);
22 	ScriptGlobal::Set("Icinga.DbCatFlapping", DbCatFlapping, true);
23 	ScriptGlobal::Set("Icinga.DbCatCheck", DbCatCheck, true);
24 	ScriptGlobal::Set("Icinga.DbCatLog", DbCatLog, true);
25 	ScriptGlobal::Set("Icinga.DbCatNotification", DbCatNotification, true);
26 	ScriptGlobal::Set("Icinga.DbCatProgramStatus", DbCatProgramStatus, true);
27 	ScriptGlobal::Set("Icinga.DbCatRetention", DbCatRetention, true);
28 	ScriptGlobal::Set("Icinga.DbCatStateHistory", DbCatStateHistory, true);
29 
30 	ScriptGlobal::Set("Icinga.DbCatEverything", DbCatEverything, true);
31 
32 	m_CategoryFilterMap["DbCatConfig"] = DbCatConfig;
33 	m_CategoryFilterMap["DbCatState"] = DbCatState;
34 	m_CategoryFilterMap["DbCatAcknowledgement"] = DbCatAcknowledgement;
35 	m_CategoryFilterMap["DbCatComment"] = DbCatComment;
36 	m_CategoryFilterMap["DbCatDowntime"] = DbCatDowntime;
37 	m_CategoryFilterMap["DbCatEventHandler"] = DbCatEventHandler;
38 	m_CategoryFilterMap["DbCatExternalCommand"] = DbCatExternalCommand;
39 	m_CategoryFilterMap["DbCatFlapping"] = DbCatFlapping;
40 	m_CategoryFilterMap["DbCatCheck"] = DbCatCheck;
41 	m_CategoryFilterMap["DbCatLog"] = DbCatLog;
42 	m_CategoryFilterMap["DbCatNotification"] = DbCatNotification;
43 	m_CategoryFilterMap["DbCatProgramStatus"] = DbCatProgramStatus;
44 	m_CategoryFilterMap["DbCatRetention"] = DbCatRetention;
45 	m_CategoryFilterMap["DbCatStateHistory"] = DbCatStateHistory;
46 	m_CategoryFilterMap["DbCatEverything"] = DbCatEverything;
47 }
48 
GetCategoryFilterMap()49 const std::map<String, int>& DbQuery::GetCategoryFilterMap()
50 {
51 	return m_CategoryFilterMap;
52 }
53