Removed CIB::RequireInformation.

This commit is contained in:
Gunnar Beutner 2012-07-20 14:30:35 +02:00
parent 898e74bb44
commit 7d1ec0332d
6 changed files with 0 additions and 47 deletions

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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)

View File

@ -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);
}
/**

View File

@ -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)

View File

@ -62,8 +62,6 @@ void DiscoveryComponent::Start(void)
/* call the timer as soon as possible */
m_DiscoveryTimer->Reschedule(0);
CIB::RequireInformation(CIB_Configuration);
}
/**