1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2 
3 #ifndef ZONE_H
4 #define ZONE_H
5 
6 #include "remote/i2-remote.hpp"
7 #include "remote/zone-ti.hpp"
8 #include "remote/endpoint.hpp"
9 
10 namespace icinga
11 {
12 
13 /**
14  * @ingroup remote
15  */
16 class Zone final : public ObjectImpl<Zone>
17 {
18 public:
19 	DECLARE_OBJECT(Zone);
20 	DECLARE_OBJECTNAME(Zone);
21 
22 	void OnAllConfigLoaded() override;
23 
24 	Zone::Ptr GetParent() const;
25 	std::set<Endpoint::Ptr> GetEndpoints() const;
26 	std::vector<Zone::Ptr> GetAllParentsRaw() const;
27 	Array::Ptr GetAllParents() const override;
28 
29 	bool CanAccessObject(const ConfigObject::Ptr& object);
30 	bool IsChildOf(const Zone::Ptr& zone);
31 	bool IsGlobal() const;
32 	bool IsSingleInstance() const;
33 
34 	static Zone::Ptr GetLocalZone();
35 
36 protected:
37 	void ValidateEndpointsRaw(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils) override;
38 
39 private:
40 	Zone::Ptr m_Parent;
41 	std::vector<Zone::Ptr> m_AllParents;
42 };
43 
44 }
45 
46 #endif /* ZONE_H */
47