1 package org.simantics.databoard.channel;
3 import org.simantics.databoard.binding.Binding;
6 * This interface is intended to be used by service handler implementations.
8 * @author Toni Kalajainen <toni.kalajainen@iki.fi>
10 public interface ServiceRequest {
13 * Context is an idetification of the requester. The actual implementation
14 * depends on the implementation of the channel.
16 * For example: TCP based implementation can publish user identification,
17 * security policy, application instance certificate, session identifier,
18 * socket address, etc..
20 * Application local implementation may carry no data. <p>
22 * @return client context
24 Object getClientContext();
27 * Get the command specification of the request.
29 * The identifier of the spec is a well-known id of the requested service.
31 * @return command specification
33 CommandSpec getCommandSpec();
36 * Get an access to the request object.
39 * @return access to request
41 Object getRequest(Binding binding);
44 * Send a successful result. Result can be sent from any thread but only once.
49 void sendResult( Binding binding, Object result );
52 * Send an error result. Result can be sent from any thread but only once.
57 void sendError( Binding binding, Object error );