X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fchannel%2FCommandChannel.java;fp=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fchannel%2FCommandChannel.java;h=66f6c347f6a029a90327f1a1167a283b82defb5e;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git 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 index 000000000..66f6c347f --- /dev/null +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/CommandChannel.java @@ -0,0 +1,35 @@ +package org.simantics.databoard.channel; + +import java.util.Collection; + +import org.simantics.databoard.binding.mutable.Variant; + +/** + * Command channel is a request-response channel. All operations are asynchronous. + * This interface is intended to be used by channel clients. + * For each callable command there is a commandId and specified datatype for request and error. + * + * @author Toni Kalajainen + */ +public interface CommandChannel { + + /** + * Invoke a service request. A asynchronous result object is returned + * at-once.

+ * + * @param commandId command identifier + * @param request the request object + * @return asynchrouns result object + */ + AsyncRequest invoke( Variant commandId, Variant request ); + + /** + * Get all callable commands of the channel. + * This result is list of command specifications. For each command there is + * unique identification, result type and error type. + * + * @return commands + */ + Collection getCommands(); + +}