org.simantics.databoard.channel
Interface ServiceRequest


public interface ServiceRequest

Author:
Toni Kalajainen

Method Summary
 java.lang.Object getClientContext()
          Context is an idetification of the requester.
 Variant getCommandId()
          Get the command identifier of the request.
 Accessor getRequest()
          Get an access to the request object.
 void sendError(Binding binding, java.lang.Object error)
          Send an error result.
 void sendResult(Accessor 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

getCommandId

Variant getCommandId()
Get the command identifier of the request. Command identifier is a well-known id of the requested service.

Returns:
command identigier

getRequest

Accessor getRequest()
Get an access to the request object.

Returns:
access to request

sendResult

void sendResult(Accessor result)
Send a successful result. Result can be sent from any thread but only once.

Parameters:
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 -