Fixed message subscriptions.

This commit is contained in:
Gunnar Beutner 2012-04-23 17:00:39 +02:00
parent 9e85d1efe4
commit bd3ceb8edd
2 changed files with 9 additions and 4 deletions

View File

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

View File

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