org.simantics.databoard.channel
Interface ServiceRequest


public interface ServiceRequest

This interface is intended to be used by service handler implementations.

Author:
Toni Kalajainen

Method Summary
 java.lang.Object getClientContext()
          Context is an idetification of the requester.
 CommandSpec getCommandSpec()
          Get the command specification of the request.
 java.lang.Object getRequest(Binding binding)
          Get an access to the request object.
 void sendError(Binding binding, java.lang.Object error)
          Send an error result.
 void sendResult(Binding binding, java.lang.Object result)
          Send a successful result.
 

Method Detail

getClientContext

java.lang.Object getClientContext()
Context is an idetification of the requester. The actual implementation depends on the implementation of the channel. For example: TCP based implementation can publish user identification, security policy, application instance certificate, session identifier, socket address, etc.. Application local implementation may carry no data.

Returns:
client context

getCommandSpec

CommandSpec getCommandSpec()
Get the command specification of the request. The identifier of the spec is a well-known id of the requested service.

Returns:
command specification

getRequest

java.lang.Object getRequest(Binding binding)
Get an access to the request object.

Parameters:
binding -
Returns:
access to request

sendResult

void sendResult(Binding binding,
                java.lang.Object result)
Send a successful result. Result can be sent from any thread but only once.

Parameters:
binding -
result -

sendError

void sendError(Binding binding,
               java.lang.Object error)
Send an error result. Result can be sent from any thread but only once.

Parameters:
binding -
error -