Merge "Json to composite node test"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / spi / RpcRouter.java
index 360f03936695ddcff5813d6a7944d12b285d8aac..7db90b62fdefd090910eb0a6ecdbe1df8ca597be 100644 (file)
@@ -1,7 +1,17 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.binding.spi;
 
+import java.util.Set;
+
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcImplementation;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
 /**
@@ -16,14 +26,23 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
  *            Type of RpcService for which router provides routing information
  *            and route selection.
  */
-public interface RpcRouter<T extends RpcService> {
+public interface RpcRouter<T extends RpcService> extends RpcImplementation{
 
     /**
      * Returns a type of RpcService which is served by this instance of router.
      * 
      * @return type of RpcService which is served by this instance of router.
      */
-    Class<T> getRpcServiceType();
+    Class<T> getServiceType();
+    
+    
+    /**
+     * Returns a instance of T which is associated with this router instance
+     * and routes messages based on routing tables.
+     * 
+     * @return type of RpcService which is served by this instance of router.
+     */
+    T getInvocationProxy();
 
     /**
      * Returns a routing table for particular route context
@@ -44,7 +63,7 @@ public interface RpcRouter<T extends RpcService> {
      * @return instance of RpcService which is responsible for processing
      *         particular path.
      */
-    T getService(Class<? extends BaseIdentity> context, InstanceIdentifier path);
+    T getService(Class<? extends BaseIdentity> context, InstanceIdentifier<?> path);
 
     /**
      * Returns a default fallback instance of RpcService which is responsible
@@ -57,6 +76,8 @@ public interface RpcRouter<T extends RpcService> {
     /**
      * 
      */
-    void setDefaultService();
+    void setDefaultService(T service);
+
+    Set<Class<? extends BaseIdentity>> getContexts();
 
 }