]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.databoard.channel;\r
2 \r
3 import java.util.Collection;\r
4 \r
5 import org.simantics.databoard.binding.mutable.Variant;\r
6 \r
7 /**\r
8  * Command channel is a request-response channel. All operations are asynchronous.\r
9  * This interface is intended to be used by channel clients.   \r
10  * For each callable command there is a commandId and specified datatype for request and error.\r
11  *\r
12  * @author Toni Kalajainen <toni.kalajainen@iki.fi>\r
13  */\r
14 public interface CommandChannel {\r
15         \r
16         /**\r
17          * Invoke a service request. A asynchronous result object is returned \r
18          * at-once. <p> \r
19          * \r
20          * @param commandId command identifier\r
21          * @param request the request object\r
22          * @return asynchrouns result object\r
23          */\r
24         AsyncRequest invoke( Variant commandId, Variant request );\r
25         \r
26         /**\r
27          * Get all callable commands of the channel.\r
28          * This result is list of command specifications. For each command there is\r
29          * unique identification, result type and error type.  \r
30          * \r
31          * @return commands\r
32          */\r
33         Collection<CommandSpec> getCommands();\r
34         \r
35 }\r