mirror of https://github.com/Icinga/icinga2.git
Renamed m_*Endpoint to m_Endpoint.
This commit is contained in:
parent
9b1de189be
commit
5649f3efb2
|
@ -28,13 +28,13 @@ string CheckerComponent::GetName(void) const
|
|||
|
||||
void CheckerComponent::Start(void)
|
||||
{
|
||||
m_CheckerEndpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_CheckerEndpoint->RegisterTopicHandler("checker::AssignService",
|
||||
m_Endpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_Endpoint->RegisterTopicHandler("checker::AssignService",
|
||||
boost::bind(&CheckerComponent::AssignServiceRequestHandler, this, _2, _3));
|
||||
m_CheckerEndpoint->RegisterTopicHandler("checker::ClearServices",
|
||||
m_Endpoint->RegisterTopicHandler("checker::ClearServices",
|
||||
boost::bind(&CheckerComponent::ClearServicesRequestHandler, this, _2, _3));
|
||||
m_CheckerEndpoint->RegisterPublication("checker::CheckResult");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_CheckerEndpoint);
|
||||
m_Endpoint->RegisterPublication("checker::CheckResult");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_Endpoint);
|
||||
|
||||
m_CheckTimer = boost::make_shared<Timer>();
|
||||
m_CheckTimer->SetInterval(5);
|
||||
|
@ -54,7 +54,7 @@ void CheckerComponent::Stop(void)
|
|||
EndpointManager::Ptr mgr = EndpointManager::GetInstance();
|
||||
|
||||
if (mgr)
|
||||
mgr->UnregisterEndpoint(m_CheckerEndpoint);
|
||||
mgr->UnregisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
void CheckerComponent::CheckTimerHandler(void)
|
||||
|
@ -155,7 +155,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
|||
|
||||
rm.SetParams(params);
|
||||
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_CheckerEndpoint, rm);
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint, rm);
|
||||
}
|
||||
|
||||
if (min_latency > 5) {
|
||||
|
@ -200,7 +200,7 @@ void CheckerComponent::AssignServiceRequestHandler(const Endpoint::Ptr& sender,
|
|||
|
||||
MessagePart result;
|
||||
rm.SetResult(result);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_CheckerEndpoint, sender, rm);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, sender, rm);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual void Stop(void);
|
||||
|
||||
private:
|
||||
VirtualEndpoint::Ptr m_CheckerEndpoint;
|
||||
VirtualEndpoint::Ptr m_Endpoint;
|
||||
|
||||
ServiceQueue m_Services;
|
||||
set<ConfigObject::Ptr> m_PendingServices;
|
||||
|
|
|
@ -30,30 +30,30 @@ void ConfigRpcComponent::Start(void)
|
|||
{
|
||||
EndpointManager::Ptr endpointManager = EndpointManager::GetInstance();
|
||||
|
||||
m_ConfigRpcEndpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_Endpoint = boost::make_shared<VirtualEndpoint>();
|
||||
|
||||
long configSource;
|
||||
if (GetConfig()->GetProperty("configSource", &configSource) && configSource != 0) {
|
||||
m_ConfigRpcEndpoint->RegisterTopicHandler("config::FetchObjects",
|
||||
m_Endpoint->RegisterTopicHandler("config::FetchObjects",
|
||||
boost::bind(&ConfigRpcComponent::FetchObjectsHandler, this, _2));
|
||||
|
||||
ConfigObject::GetAllObjects()->OnObjectAdded.connect(boost::bind(&ConfigRpcComponent::LocalObjectCommittedHandler, this, _2));
|
||||
ConfigObject::GetAllObjects()->OnObjectCommitted.connect(boost::bind(&ConfigRpcComponent::LocalObjectCommittedHandler, this, _2));
|
||||
ConfigObject::GetAllObjects()->OnObjectRemoved.connect(boost::bind(&ConfigRpcComponent::LocalObjectRemovedHandler, this, _2));
|
||||
|
||||
m_ConfigRpcEndpoint->RegisterPublication("config::ObjectCommitted");
|
||||
m_ConfigRpcEndpoint->RegisterPublication("config::ObjectRemoved");
|
||||
m_Endpoint->RegisterPublication("config::ObjectCommitted");
|
||||
m_Endpoint->RegisterPublication("config::ObjectRemoved");
|
||||
}
|
||||
|
||||
endpointManager->OnNewEndpoint.connect(boost::bind(&ConfigRpcComponent::NewEndpointHandler, this, _2));
|
||||
|
||||
m_ConfigRpcEndpoint->RegisterPublication("config::FetchObjects");
|
||||
m_ConfigRpcEndpoint->RegisterTopicHandler("config::ObjectCommitted",
|
||||
m_Endpoint->RegisterPublication("config::FetchObjects");
|
||||
m_Endpoint->RegisterTopicHandler("config::ObjectCommitted",
|
||||
boost::bind(&ConfigRpcComponent::RemoteObjectCommittedHandler, this, _3));
|
||||
m_ConfigRpcEndpoint->RegisterTopicHandler("config::ObjectRemoved",
|
||||
m_Endpoint->RegisterTopicHandler("config::ObjectRemoved",
|
||||
boost::bind(&ConfigRpcComponent::RemoteObjectRemovedHandler, this, _3));
|
||||
|
||||
endpointManager->RegisterEndpoint(m_ConfigRpcEndpoint);
|
||||
endpointManager->RegisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
void ConfigRpcComponent::Stop(void)
|
||||
|
@ -61,7 +61,7 @@ void ConfigRpcComponent::Stop(void)
|
|||
EndpointManager::Ptr mgr = EndpointManager::GetInstance();
|
||||
|
||||
if (mgr)
|
||||
mgr->UnregisterEndpoint(m_ConfigRpcEndpoint);
|
||||
mgr->UnregisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
void ConfigRpcComponent::NewEndpointHandler(const Endpoint::Ptr& endpoint)
|
||||
|
@ -78,7 +78,7 @@ void ConfigRpcComponent::SessionEstablishedHandler(const Endpoint::Ptr& endpoint
|
|||
RequestMessage request;
|
||||
request.SetMethod("config::FetchObjects");
|
||||
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_ConfigRpcEndpoint, endpoint, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, endpoint, request);
|
||||
}
|
||||
|
||||
RequestMessage ConfigRpcComponent::MakeObjectMessage(const ConfigObject::Ptr& object, string method, bool includeProperties)
|
||||
|
@ -115,7 +115,7 @@ void ConfigRpcComponent::FetchObjectsHandler(const Endpoint::Ptr& sender)
|
|||
|
||||
RequestMessage request = MakeObjectMessage(object, "config::ObjectCommitted", true);
|
||||
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_ConfigRpcEndpoint, sender, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, sender, request);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ void ConfigRpcComponent::LocalObjectCommittedHandler(const ConfigObject::Ptr& ob
|
|||
if (!ShouldReplicateObject(object))
|
||||
return;
|
||||
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_ConfigRpcEndpoint,
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint,
|
||||
MakeObjectMessage(object, "config::ObjectCommitted", true));
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ void ConfigRpcComponent::LocalObjectRemovedHandler(const ConfigObject::Ptr& obje
|
|||
if (!ShouldReplicateObject(object))
|
||||
return;
|
||||
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_ConfigRpcEndpoint,
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint,
|
||||
MakeObjectMessage(object, "config::ObjectRemoved", false));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
virtual void Stop(void);
|
||||
|
||||
private:
|
||||
VirtualEndpoint::Ptr m_ConfigRpcEndpoint;
|
||||
VirtualEndpoint::Ptr m_Endpoint;
|
||||
|
||||
void NewEndpointHandler(const Endpoint::Ptr& endpoint);
|
||||
void SessionEstablishedHandler(const Endpoint::Ptr& endpoint);
|
||||
|
|
|
@ -39,13 +39,13 @@ void DelegationComponent::Start(void)
|
|||
m_DelegationTimer->Start();
|
||||
m_DelegationTimer->Reschedule(0);
|
||||
|
||||
m_DelegationEndpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_DelegationEndpoint->RegisterPublication("checker::AssignService");
|
||||
m_DelegationEndpoint->RegisterPublication("checker::ClearServices");
|
||||
m_DelegationEndpoint->RegisterTopicHandler("checker::CheckResult",
|
||||
m_Endpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_Endpoint->RegisterPublication("checker::AssignService");
|
||||
m_Endpoint->RegisterPublication("checker::ClearServices");
|
||||
m_Endpoint->RegisterTopicHandler("checker::CheckResult",
|
||||
boost::bind(&DelegationComponent::CheckResultRequestHandler, this, _2, _3));
|
||||
m_DelegationEndpoint->RegisterPublication("delegation::ServiceStatus");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_DelegationEndpoint);
|
||||
m_Endpoint->RegisterPublication("delegation::ServiceStatus");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_Endpoint);
|
||||
|
||||
EndpointManager::GetInstance()->OnNewEndpoint.connect(bind(&DelegationComponent::NewEndpointHandler, this, _2));
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void DelegationComponent::Stop(void)
|
|||
EndpointManager::Ptr mgr = EndpointManager::GetInstance();
|
||||
|
||||
if (mgr)
|
||||
mgr->UnregisterEndpoint(m_DelegationEndpoint);
|
||||
mgr->UnregisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
void DelegationComponent::ObjectCommittedHandler(const ConfigObject::Ptr& object)
|
||||
|
@ -77,7 +77,7 @@ void DelegationComponent::AssignService(const Endpoint::Ptr& checker, const Serv
|
|||
|
||||
Application::Log(LogDebug, "delegation", "Trying to delegate service '" + service.GetName() + "'");
|
||||
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_DelegationEndpoint, checker, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, checker, request);
|
||||
}
|
||||
|
||||
void DelegationComponent::ClearServices(const Endpoint::Ptr& checker)
|
||||
|
@ -88,7 +88,7 @@ void DelegationComponent::ClearServices(const Endpoint::Ptr& checker)
|
|||
MessagePart params;
|
||||
request.SetParams(params);
|
||||
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_DelegationEndpoint, checker, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, checker, request);
|
||||
}
|
||||
|
||||
bool DelegationComponent::IsEndpointChecker(const Endpoint::Ptr& endpoint)
|
||||
|
@ -300,7 +300,7 @@ void DelegationComponent::CheckResultRequestHandler(const Endpoint::Ptr& sender,
|
|||
RequestMessage rm;
|
||||
rm.SetMethod("delegation::ServiceStatus");
|
||||
rm.SetParams(params);
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_DelegationEndpoint, rm);
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint, rm);
|
||||
}
|
||||
|
||||
EXPORT_COMPONENT(delegation, DelegationComponent);
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
virtual void Stop(void);
|
||||
|
||||
private:
|
||||
VirtualEndpoint::Ptr m_DelegationEndpoint;
|
||||
VirtualEndpoint::Ptr m_Endpoint;
|
||||
ConfigObject::Set::Ptr m_AllServices;
|
||||
Timer::Ptr m_DelegationTimer;
|
||||
|
||||
|
|
|
@ -36,11 +36,11 @@ string DemoComponent::GetName(void) const
|
|||
*/
|
||||
void DemoComponent::Start(void)
|
||||
{
|
||||
m_DemoEndpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_DemoEndpoint->RegisterTopicHandler("demo::HelloWorld",
|
||||
m_Endpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_Endpoint->RegisterTopicHandler("demo::HelloWorld",
|
||||
boost::bind(&DemoComponent::HelloWorldRequestHandler, this, _2, _3));
|
||||
m_DemoEndpoint->RegisterPublication("demo::HelloWorld");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_DemoEndpoint);
|
||||
m_Endpoint->RegisterPublication("demo::HelloWorld");
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_Endpoint);
|
||||
|
||||
m_DemoTimer = boost::make_shared<Timer>();
|
||||
m_DemoTimer->SetInterval(5);
|
||||
|
@ -56,7 +56,7 @@ void DemoComponent::Stop(void)
|
|||
EndpointManager::Ptr endpointManager = EndpointManager::GetInstance();
|
||||
|
||||
if (endpointManager)
|
||||
endpointManager->UnregisterEndpoint(m_DemoEndpoint);
|
||||
endpointManager->UnregisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,7 +71,7 @@ void DemoComponent::DemoTimerHandler(void)
|
|||
RequestMessage request;
|
||||
request.SetMethod("demo::HelloWorld");
|
||||
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_DemoEndpoint, request);
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint, request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
private:
|
||||
Timer::Ptr m_DemoTimer;
|
||||
VirtualEndpoint::Ptr m_DemoEndpoint;
|
||||
VirtualEndpoint::Ptr m_Endpoint;
|
||||
|
||||
void DemoTimerHandler(void);
|
||||
void HelloWorldRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request);
|
||||
|
|
|
@ -36,23 +36,23 @@ string DiscoveryComponent::GetName(void) const
|
|||
*/
|
||||
void DiscoveryComponent::Start(void)
|
||||
{
|
||||
m_DiscoveryEndpoint = boost::make_shared<VirtualEndpoint>();
|
||||
m_Endpoint = boost::make_shared<VirtualEndpoint>();
|
||||
|
||||
m_DiscoveryEndpoint->RegisterPublication("discovery::RegisterComponent");
|
||||
m_DiscoveryEndpoint->RegisterTopicHandler("discovery::RegisterComponent",
|
||||
m_Endpoint->RegisterPublication("discovery::RegisterComponent");
|
||||
m_Endpoint->RegisterTopicHandler("discovery::RegisterComponent",
|
||||
boost::bind(&DiscoveryComponent::RegisterComponentMessageHandler, this, _2, _3));
|
||||
|
||||
m_DiscoveryEndpoint->RegisterPublication("discovery::NewComponent");
|
||||
m_DiscoveryEndpoint->RegisterTopicHandler("discovery::NewComponent",
|
||||
m_Endpoint->RegisterPublication("discovery::NewComponent");
|
||||
m_Endpoint->RegisterTopicHandler("discovery::NewComponent",
|
||||
boost::bind(&DiscoveryComponent::NewComponentMessageHandler, this, _3));
|
||||
|
||||
m_DiscoveryEndpoint->RegisterTopicHandler("discovery::Welcome",
|
||||
m_Endpoint->RegisterTopicHandler("discovery::Welcome",
|
||||
boost::bind(&DiscoveryComponent::WelcomeMessageHandler, this, _2, _3));
|
||||
|
||||
EndpointManager::GetInstance()->ForEachEndpoint(boost::bind(&DiscoveryComponent::NewEndpointHandler, this, _2));
|
||||
EndpointManager::GetInstance()->OnNewEndpoint.connect(boost::bind(&DiscoveryComponent::NewEndpointHandler, this, _2));
|
||||
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_DiscoveryEndpoint);
|
||||
EndpointManager::GetInstance()->RegisterEndpoint(m_Endpoint);
|
||||
|
||||
/* create the reconnect timer */
|
||||
m_DiscoveryTimer = boost::make_shared<Timer>();
|
||||
|
@ -72,7 +72,7 @@ void DiscoveryComponent::Stop(void)
|
|||
EndpointManager::Ptr mgr = EndpointManager::GetInstance();
|
||||
|
||||
if (mgr)
|
||||
mgr->UnregisterEndpoint(m_DiscoveryEndpoint);
|
||||
mgr->UnregisterEndpoint(m_Endpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -260,7 +260,7 @@ void DiscoveryComponent::FinishDiscoverySetup(const Endpoint::Ptr& endpoint)
|
|||
endpoint->RegisterSubscription("discovery::Welcome");
|
||||
RequestMessage request;
|
||||
request.SetMethod("discovery::Welcome");
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_DiscoveryEndpoint, endpoint, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, endpoint, request);
|
||||
|
||||
endpoint->SetSentWelcome(true);
|
||||
|
||||
|
@ -310,9 +310,9 @@ void DiscoveryComponent::SendDiscoveryMessage(const string& method, const string
|
|||
params.SetPublications(publications);
|
||||
|
||||
if (recipient)
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_DiscoveryEndpoint, recipient, request);
|
||||
EndpointManager::GetInstance()->SendUnicastMessage(m_Endpoint, recipient, request);
|
||||
else
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_DiscoveryEndpoint, request);
|
||||
EndpointManager::GetInstance()->SendMulticastMessage(m_Endpoint, request);
|
||||
}
|
||||
|
||||
bool DiscoveryComponent::HasMessagePermission(const Dictionary::Ptr& roles, const string& messageType, const string& message)
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
virtual void Stop(void);
|
||||
|
||||
private:
|
||||
VirtualEndpoint::Ptr m_DiscoveryEndpoint;
|
||||
VirtualEndpoint::Ptr m_Endpoint;
|
||||
map<string, ComponentDiscoveryInfo::Ptr> m_Components;
|
||||
Timer::Ptr m_DiscoveryTimer;
|
||||
|
||||
|
|
Loading…
Reference in New Issue