2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2014-04-25 14:33:45 +02:00
|
|
|
|
2014-05-03 20:02:22 +02:00
|
|
|
#ifndef ZONE_H
|
|
|
|
#define ZONE_H
|
2014-04-25 14:33:45 +02:00
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "remote/i2-remote.hpp"
|
2018-01-18 13:50:38 +01:00
|
|
|
#include "remote/zone-ti.hpp"
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "remote/endpoint.hpp"
|
2014-04-25 14:33:45 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2014-05-03 20:02:22 +02:00
|
|
|
* @ingroup remote
|
2014-04-25 14:33:45 +02:00
|
|
|
*/
|
2018-01-04 06:11:04 +01:00
|
|
|
class Zone final : public ObjectImpl<Zone>
|
2014-04-25 14:33:45 +02:00
|
|
|
{
|
2014-05-03 20:02:22 +02:00
|
|
|
public:
|
2014-11-03 00:44:04 +01:00
|
|
|
DECLARE_OBJECT(Zone);
|
|
|
|
DECLARE_OBJECTNAME(Zone);
|
2014-04-25 14:33:45 +02:00
|
|
|
|
2018-01-04 05:12:56 +01:00
|
|
|
void OnAllConfigLoaded() override;
|
2015-11-24 15:25:55 +01:00
|
|
|
|
2018-01-04 04:25:35 +01:00
|
|
|
Zone::Ptr GetParent() const;
|
|
|
|
std::set<Endpoint::Ptr> GetEndpoints() const;
|
2018-08-08 13:59:43 +02:00
|
|
|
std::vector<Zone::Ptr> GetAllParentsRaw() const;
|
2018-08-08 14:15:01 +02:00
|
|
|
Array::Ptr GetAllParents() const override;
|
2014-04-25 14:33:45 +02:00
|
|
|
|
2015-08-15 20:28:05 +02:00
|
|
|
bool CanAccessObject(const ConfigObject::Ptr& object);
|
2014-05-13 15:57:02 +02:00
|
|
|
bool IsChildOf(const Zone::Ptr& zone);
|
2018-01-04 04:25:35 +01:00
|
|
|
bool IsGlobal() const;
|
|
|
|
bool IsSingleInstance() const;
|
2014-04-25 14:33:45 +02:00
|
|
|
|
2018-01-04 04:25:35 +01:00
|
|
|
static Zone::Ptr GetLocalZone();
|
2015-11-24 15:25:55 +01:00
|
|
|
|
2016-07-26 08:10:47 +02:00
|
|
|
protected:
|
2018-01-11 07:08:09 +01:00
|
|
|
void ValidateEndpointsRaw(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils) override;
|
2016-07-26 08:10:47 +02:00
|
|
|
|
2015-11-24 15:25:55 +01:00
|
|
|
private:
|
|
|
|
Zone::Ptr m_Parent;
|
2016-01-27 12:18:16 +01:00
|
|
|
std::vector<Zone::Ptr> m_AllParents;
|
2014-04-25 14:33:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-05-03 20:02:22 +02:00
|
|
|
#endif /* ZONE_H */
|