--- /dev/null
+package org.simantics.databoard.channel;\r
+\r
+import org.simantics.databoard.binding.Binding;\r
+\r
+/**\r
+ * This interface is intended to be used by service handler implementations.\r
+ *\r
+ * @author Toni Kalajainen <toni.kalajainen@iki.fi>\r
+ */\r
+public interface ServiceRequest {\r
+ \r
+ /**\r
+ * Context is an idetification of the requester. The actual implementation\r
+ * depends on the implementation of the channel. \r
+ * \r
+ * For example: TCP based implementation can publish user identification, \r
+ * security policy, application instance certificate, session identifier, \r
+ * socket address, etc..\r
+ * \r
+ * Application local implementation may carry no data. <p>\r
+ * \r
+ * @return client context\r
+ */\r
+ Object getClientContext();\r
+ \r
+ /**\r
+ * Get the command specification of the request.\r
+ * \r
+ * The identifier of the spec is a well-known id of the requested service.\r
+ * \r
+ * @return command specification\r
+ */\r
+ CommandSpec getCommandSpec();\r
+ \r
+ /**\r
+ * Get an access to the request object.\r
+ * \r
+ * @param binding \r
+ * @return access to request\r
+ */\r
+ Object getRequest(Binding binding);\r
+ \r
+ /**\r
+ * Send a successful result. Result can be sent from any thread but only once.\r
+ * \r
+ * @param binding\r
+ * @param result\r
+ */\r
+ void sendResult( Binding binding, Object result );\r
+ \r
+ /**\r
+ * Send an error result. Result can be sent from any thread but only once. \r
+ * \r
+ * @param binding\r
+ * @param error\r
+ */\r
+ void sendError( Binding binding, Object error ); \r
+ \r
+}\r