]> granicus.if.org Git - icinga2/blob - lib/icinga/user.hpp
Merge pull request #7527 from Icinga/bugfix/checkable-command-endpoint-zone
[icinga2] / lib / icinga / user.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef USER_H
4 #define USER_H
5
6 #include "icinga/i2-icinga.hpp"
7 #include "icinga/user-ti.hpp"
8 #include "icinga/timeperiod.hpp"
9 #include "remote/messageorigin.hpp"
10
11 namespace icinga
12 {
13
14 /**
15  * A User.
16  *
17  * @ingroup icinga
18  */
19 class User final : public ObjectImpl<User>
20 {
21 public:
22         DECLARE_OBJECT(User);
23         DECLARE_OBJECTNAME(User);
24
25         void AddGroup(const String& name);
26
27         /* Notifications */
28         TimePeriod::Ptr GetPeriod() const;
29
30         void ValidateStates(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils) override;
31         void ValidateTypes(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils) override;
32
33 protected:
34         void Stop(bool runtimeRemoved) override;
35
36         void OnConfigLoaded() override;
37         void OnAllConfigLoaded() override;
38 private:
39         mutable boost::mutex m_UserMutex;
40 };
41
42 }
43
44 #endif /* USER_H */