]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src/org/simantics/databoard/channel/CommandChannel.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / channel / CommandChannel.java
diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/CommandChannel.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/CommandChannel.java
new file mode 100644 (file)
index 0000000..66f6c34
--- /dev/null
@@ -0,0 +1,35 @@
+package org.simantics.databoard.channel;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+\r
+/**\r
+ * Command channel is a request-response channel. All operations are asynchronous.\r
+ * This interface is intended to be used by channel clients.   \r
+ * For each callable command there is a commandId and specified datatype for request and error.\r
+ *\r
+ * @author Toni Kalajainen <toni.kalajainen@iki.fi>\r
+ */\r
+public interface CommandChannel {\r
+       \r
+       /**\r
+        * Invoke a service request. A asynchronous result object is returned \r
+        * at-once. <p> \r
+        * \r
+        * @param commandId command identifier\r
+        * @param request the request object\r
+        * @return asynchrouns result object\r
+        */\r
+       AsyncRequest invoke( Variant commandId, Variant request );\r
+       \r
+       /**\r
+        * Get all callable commands of the channel.\r
+        * This result is list of command specifications. For each command there is\r
+        * unique identification, result type and error type.  \r
+        * \r
+        * @return commands\r
+        */\r
+       Collection<CommandSpec> getCommands();\r
+       \r
+}\r