From: Gunnar Beutner Date: Mon, 23 Apr 2012 15:00:39 +0000 (+0200) Subject: Fixed message subscriptions. X-Git-Tag: v0.0.1~594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd3ceb8edd01720412fbbcea2494e86aceb88728;p=icinga2 Fixed message subscriptions. --- diff --git a/icinga/authenticationcomponent.cpp b/icinga/authenticationcomponent.cpp index f5b0ec217..a7c388877 100644 --- a/icinga/authenticationcomponent.cpp +++ b/icinga/authenticationcomponent.cpp @@ -42,8 +42,10 @@ int AuthenticationComponent::NewEndpointHandler(const NewEndpointEventArgs& neea neea.Endpoint->AddAllowedMethodSinkPrefix("auth::"); neea.Endpoint->AddAllowedMethodSourcePrefix("auth::"); + neea.Endpoint->RegisterMethodSink("auth::SetIdentity"); + JsonRpcRequest request; - request.SetMethod("message::SetIdentity"); + request.SetMethod("auth::SetIdentity"); IdentityMessage params; params.SetIdentity("keks"); diff --git a/icinga/subscriptioncomponent.cpp b/icinga/subscriptioncomponent.cpp index 60fc67748..ad00ffe0a 100644 --- a/icinga/subscriptioncomponent.cpp +++ b/icinga/subscriptioncomponent.cpp @@ -73,12 +73,15 @@ int SubscriptionComponent::NewEndpointHandler(const NewEndpointEventArgs& neea) if (neea.Endpoint->IsLocal()) return 0; - EndpointManager::Ptr mgr = GetIcingaApplication()->GetEndpointManager(); - mgr->ForeachEndpoint(bind(&SubscriptionComponent::SyncSubscriptions, this, neea.Endpoint, _1)); - neea.Endpoint->AddAllowedMethodSinkPrefix("message::"); neea.Endpoint->AddAllowedMethodSourcePrefix("message::"); + neea.Endpoint->RegisterMethodSink("message::Subscribe"); + neea.Endpoint->RegisterMethodSink("message::Provide"); + + EndpointManager::Ptr mgr = GetIcingaApplication()->GetEndpointManager(); + mgr->ForeachEndpoint(bind(&SubscriptionComponent::SyncSubscriptions, this, neea.Endpoint, _1)); + return 0; }