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 double GetTlsHandshakeTimeout() const override;
112 void SetTlsHandshakeTimeout(double value, bool suppress_events = false, const Value& cookie = Empty) override;
114 String GetVarsPath() const override;
115 void SetVarsPath(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
117 String GetZonesDir() const override;
118 void SetZonesDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
121 String GetLocalStateDir() const override;
122 void SetLocalStateDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
124 String GetSysconfDir() const override;
125 void SetSysconfDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
127 String GetRunDir() const override;
128 void SetRunDir(const String& value, bool suppress_events = false, const Value& cookie = Empty) override;
130 static bool GetReadOnly();
131 static void SetReadOnly(bool readOnly);
133 static String ApiBindHost;
134 static String ApiBindPort;
135 static bool AttachDebugger;
136 static String CacheDir;
137 static int Concurrency;
138 static String ConfigDir;
139 static String DataDir;
140 static String EventEngine;
141 static String IncludeConfDir;
142 static String InitRunDir;
143 static String LogDir;
144 static String ModAttrPath;
145 static String ObjectsPath;
146 static String PidPath;
147 static String PkgDataDir;
148 static String PrefixDir;
149 static String ProgramData;
150 static int RLimitFiles;
151 static int RLimitProcesses;
152 static int RLimitStack;
153 static String RunAsGroup;
154 static String RunAsUser;
155 static String SpoolDir;
156 static String StatePath;
157 static double TlsHandshakeTimeout;
158 static String VarsPath;
159 static String ZonesDir;
162 static String LocalStateDir;
163 static String RunDir;
164 static String SysconfDir;
167 static bool m_ReadOnly;
173 #endif /* CONFIGURATION_H */