mirror of https://github.com/Icinga/icinga2.git
Removed CIB::RequireInformation.
This commit is contained in:
parent
898e74bb44
commit
7d1ec0332d
24
cib/cib.cpp
24
cib/cib.cpp
|
@ -21,27 +21,9 @@
|
|||
|
||||
using namespace icinga;
|
||||
|
||||
int CIB::m_Types;
|
||||
RingBuffer CIB::m_TaskStatistics(15 * 60);
|
||||
boost::signal<void (const ServiceStatusMessage&)> CIB::OnServiceStatusUpdate;
|
||||
|
||||
void CIB::RequireInformation(InformationType types)
|
||||
{
|
||||
m_Types |= types;
|
||||
|
||||
Application::Ptr app = Application::GetInstance();
|
||||
Component::Ptr component = app->GetComponent("cibsync");
|
||||
|
||||
if (!component) {
|
||||
ConfigItemBuilder::Ptr cb = boost::make_shared<ConfigItemBuilder>();
|
||||
cb->SetType("component");
|
||||
cb->SetName("cibsync");
|
||||
cb->SetLocal(true);
|
||||
ConfigItem::Ptr ci = cb->Compile();
|
||||
ci->Commit();
|
||||
}
|
||||
}
|
||||
|
||||
void CIB::UpdateTaskStatistics(long tv, int num)
|
||||
{
|
||||
m_TaskStatistics.InsertValue(tv, num);
|
||||
|
@ -51,9 +33,3 @@ int CIB::GetTaskStatistics(long timespan)
|
|||
{
|
||||
return m_TaskStatistics.GetValues(timespan);
|
||||
}
|
||||
|
||||
int CIB::GetInformationTypes(void)
|
||||
{
|
||||
return m_Types;
|
||||
}
|
||||
|
||||
|
|
12
cib/cib.h
12
cib/cib.h
|
@ -23,27 +23,15 @@
|
|||
namespace icinga
|
||||
{
|
||||
|
||||
enum InformationType
|
||||
{
|
||||
CIB_Configuration = 1<<0,
|
||||
CIB_ProgramStatus = 1<<1,
|
||||
CIB_ServiceStatus = 1<<2
|
||||
};
|
||||
|
||||
class I2_CIB_API CIB
|
||||
{
|
||||
public:
|
||||
static void RequireInformation(InformationType type);
|
||||
static int GetInformationTypes(void);
|
||||
|
||||
static void UpdateTaskStatistics(long tv, int num);
|
||||
static int GetTaskStatistics(long timespan);
|
||||
|
||||
static boost::signal<void (const ServiceStatusMessage&)> OnServiceStatusUpdate;
|
||||
|
||||
private:
|
||||
static int m_Types;
|
||||
|
||||
static RingBuffer m_TaskStatistics;
|
||||
};
|
||||
|
||||
|
|
|
@ -48,9 +48,6 @@ void CheckerComponent::Start(void)
|
|||
m_ResultTimer->SetInterval(5);
|
||||
m_ResultTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::ResultTimerHandler, this));
|
||||
m_ResultTimer->Start();
|
||||
|
||||
CIB::RequireInformation(CIB_Configuration);
|
||||
CIB::RequireInformation(CIB_ServiceStatus);
|
||||
}
|
||||
|
||||
void CheckerComponent::Stop(void)
|
||||
|
|
|
@ -47,10 +47,6 @@ void CompatComponent::Start(void)
|
|||
m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatComponent::StatusTimerHandler, this));
|
||||
m_StatusTimer->Start();
|
||||
m_StatusTimer->Reschedule(0);
|
||||
|
||||
CIB::RequireInformation(CIB_Configuration);
|
||||
CIB::RequireInformation(CIB_ProgramStatus);
|
||||
CIB::RequireInformation(CIB_ServiceStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,8 +49,6 @@ void DelegationComponent::Start(void)
|
|||
EndpointManager::GetInstance()->RegisterEndpoint(m_Endpoint);
|
||||
|
||||
EndpointManager::GetInstance()->OnNewEndpoint.connect(bind(&DelegationComponent::NewEndpointHandler, this, _2));
|
||||
|
||||
CIB::RequireInformation(CIB_Configuration);
|
||||
}
|
||||
|
||||
void DelegationComponent::Stop(void)
|
||||
|
|
|
@ -62,8 +62,6 @@ void DiscoveryComponent::Start(void)
|
|||
|
||||
/* call the timer as soon as possible */
|
||||
m_DiscoveryTimer->Reschedule(0);
|
||||
|
||||
CIB::RequireInformation(CIB_Configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue