Merge "CHange log level from warn to debug in ProtocolSessionPromise when connection...
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / BrokerImpl.xtend
index 7ef594bad94cddd77db1136f6a2e9a311d4203e9..8f734d7d4c3934a22c1ca91af146534a0a5fac5b 100644 (file)
@@ -29,8 +29,13 @@ import org.slf4j.LoggerFactory
 import org.opendaylight.controller.sal.dom.broker.spi.RpcRouter
 import org.opendaylight.yangtools.concepts.ListenerRegistration
 import org.opendaylight.controller.sal.core.api.RpcRegistrationListener
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry
+import org.opendaylight.controller.sal.core.api.RpcImplementation
+import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener
+import org.opendaylight.controller.sal.core.api.RpcRoutingContext
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier
 
-public class BrokerImpl implements Broker, AutoCloseable {
+public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable {
     private static val log = LoggerFactory.getLogger(BrokerImpl);
 
     // Broker Generic Context
@@ -52,7 +57,7 @@ public class BrokerImpl implements Broker, AutoCloseable {
 
     override registerConsumer(Consumer consumer, BundleContext ctx) {
         checkPredicates(consumer);
-        log.info("Registering consumer " + consumer);
+        log.trace("Registering consumer " + consumer);
         val session = newSessionFor(consumer, ctx);
         consumer.onSessionInitiated(session);
         sessions.add(session);
@@ -68,7 +73,7 @@ public class BrokerImpl implements Broker, AutoCloseable {
         return session;
     }
 
-    protected def Future<RpcResult<CompositeNode>> invokeRpc(QName rpc, CompositeNode input) {
+    protected def Future<RpcResult<CompositeNode>> invokeRpcAsync(QName rpc, CompositeNode input) {
         val result = executor.submit([|router.invokeRpc(rpc, input)] as Callable<RpcResult<CompositeNode>>);
         return result;
     }
@@ -115,4 +120,28 @@ public class BrokerImpl implements Broker, AutoCloseable {
         deactivator?.close();
     }
     
+    override addRpcImplementation(QName rpcType, RpcImplementation implementation) throws IllegalArgumentException {
+        router.addRpcImplementation(rpcType,implementation);
+    }
+    
+    override addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) {
+        router.addRoutedRpcImplementation(rpcType,implementation);
+    }
+    
+    override addRpcRegistrationListener(RpcRegistrationListener listener) {
+        return router.addRpcRegistrationListener(listener);
+    }
+    
+    override <L extends RouteChangeListener<RpcRoutingContext, InstanceIdentifier>> registerRouteChangeListener(L listener) {
+        return router.registerRouteChangeListener(listener);
+    }
+
+    override invokeRpc(QName rpc,CompositeNode input){
+        return router.invokeRpc(rpc,input)
+    }
+
+    override getSupportedRpcs() {
+        return router.getSupportedRpcs();
+    }
+    
 }