1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
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. *
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. *
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 ******************************************************************************/
20 #ifndef CONFIGURATION_H
21 #define CONFIGURATION_H
23 #include "base/i2-base.hpp"
24 #include "base/configuration-ti.hpp"
30 * Global configuration.
34 class Configuration : public ObjectImpl<Configuration>
37 DECLARE_OBJECT(Configuration);
39 String GetApiBindHost() const override;
40 void SetApiBindHost(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
42 String GetApiBindPort() const override;
43 void SetApiBindPort(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
45 bool GetAttachDebugger() const override;
46 void SetAttachDebugger(bool value, bool suppress_events = false, const Value& cookie = Empty) override;
48 String GetCacheDir() const override;
49 void SetCacheDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
51 int GetConcurrency() const override;
52 void SetConcurrency(int value, bool suppress_events = false, const Value& cookie = Empty) override;
54 String GetConfigDir() const override;
55 void SetConfigDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
57 String GetDataDir() const override;
58 void SetDataDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
60 String GetEventEngine() const override;
61 void SetEventEngine(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
63 String GetIncludeConfDir() const override;
64 void SetIncludeConfDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
66 String GetInitRunDir() const override;
67 void SetInitRunDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
69 String GetLogDir() const override;
70 void SetLogDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
72 String GetModAttrPath() const override;
73 void SetModAttrPath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
75 String GetObjectsPath() const override;
76 void SetObjectsPath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
78 String GetPidPath() const override;
79 void SetPidPath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
81 String GetPkgDataDir() const override;
82 void SetPkgDataDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
84 String GetPrefixDir() const override;
85 void SetPrefixDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
87 String GetProgramData() const override;
88 void SetProgramData(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
90 int GetRLimitFiles() const override;
91 void SetRLimitFiles(int value, bool suppress_events = false, const Value& cookie = Empty) override;
93 int GetRLimitProcesses() const override;
94 void SetRLimitProcesses(int value, bool suppress_events = false, const Value& cookie = Empty) override;
96 int GetRLimitStack() const override;
97 void SetRLimitStack(int value, bool suppress_events = false, const Value& cookie = Empty) override;
99 String GetRunAsGroup() const override;
100 void SetRunAsGroup(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
102 String GetRunAsUser() const override;
103 void SetRunAsUser(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
105 String GetSpoolDir() const override;
106 void SetSpoolDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
108 String GetStatePath() const override;
109 void SetStatePath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
111 String GetVarsPath() const override;
112 void SetVarsPath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
114 String GetZonesDir() const override;
115 void SetZonesDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
118 String GetLocalStateDir() const override;
119 void SetLocalStateDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
121 String GetSysconfDir() const override;
122 void SetSysconfDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
124 String GetRunDir() const override;
125 void SetRunDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
127 static bool GetReadOnly();
128 static void SetReadOnly(bool readOnly);
130 static String ApiBindHost;
131 static String ApiBindPort;
132 static bool AttachDebugger;
133 static String CacheDir;
134 static int Concurrency;
135 static String ConfigDir;
136 static String DataDir;
137 static String EventEngine;
138 static String IncludeConfDir;
139 static String InitRunDir;
140 static String LogDir;
141 static String ModAttrPath;
142 static String ObjectsPath;
143 static String PidPath;
144 static String PkgDataDir;
145 static String PrefixDir;
146 static String ProgramData;
147 static int RLimitFiles;
148 static int RLimitProcesses;
149 static int RLimitStack;
150 static String RunAsGroup;
151 static String RunAsUser;
152 static String SpoolDir;
153 static String StatePath;
154 static String VarsPath;
155 static String ZonesDir;
158 static String LocalStateDir;
159 static String RunDir;
160 static String SysconfDir;
163 static bool m_ReadOnly;
169 #endif /* CONFIGURATION_H */