]> granicus.if.org Git - icinga2/commitdiff
Fixed message subscriptions.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 23 Apr 2012 15:00:39 +0000 (17:00 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 23 Apr 2012 15:00:39 +0000 (17:00 +0200)
icinga/authenticationcomponent.cpp
icinga/subscriptioncomponent.cpp

index f5b0ec21783eba505b358d3bfd85c147a1a119a2..a7c3888777b2f2435f6c2d3626427a4c53cddb32 100644 (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");
index 60fc677487fd3a99090cdce9125d9c69ebc08692..ad00ffe0a47c900a9cd7256917b64c8f0eef4462 100644 (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;
 }