Added support for binding-independent RPCs
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-common-util / src / main / java / org / opendaylight / controller / sal / common / util / Rpcs.java
@@ -5,38 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
  */\r
-package org.opendaylight.controller.sal.core.impl;\r
+package org.opendaylight.controller.sal.common.util;\r
 \r
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 import java.util.Collections;\r
-import java.util.List;\r
-import java.util.concurrent.Callable;\r
-\r
-import org.opendaylight.controller.sal.core.api.RpcImplementation;\r
-import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.common.RpcError;\r
 import org.opendaylight.controller.yang.common.RpcResult;\r
-import org.opendaylight.controller.yang.data.api.CompositeNode;\r
-\r
-\r
-public class RpcUtils {\r
-\r
-    Callable<RpcResult<CompositeNode>> callableFor(\r
-            final RpcImplementation implemenation, final QName rpc,\r
-            final CompositeNode input) {\r
-\r
-        return new Callable<RpcResult<CompositeNode>>() {\r
-\r
-            @Override\r
-            public RpcResult<CompositeNode> call() throws Exception {\r
-                return implemenation.invokeRpc(rpc, input);\r
-            }\r
-        };\r
-    }\r
 \r
+public class Rpcs {\r
     public static <T> RpcResult<T> getRpcResult(boolean successful, T result,\r
-            List<RpcError> errors) {\r
+            Collection<RpcError> errors) {\r
         RpcResult<T> ret = new RpcResultTO<T>(successful, result, errors);\r
         return ret;\r
     }\r
@@ -47,7 +26,8 @@ public class RpcUtils {
         private final T result;\r
         private final boolean successful;\r
 \r
-        public RpcResultTO(boolean successful, T result, List<RpcError> errors) {\r
+        public RpcResultTO(boolean successful, T result,\r
+                Collection<RpcError> errors) {\r
             this.successful = successful;\r
             this.result = result;\r
             this.errors = Collections.unmodifiableList(new ArrayList<RpcError>(\r
@@ -71,4 +51,3 @@ public class RpcUtils {
 \r
     }\r
 }\r
-