Interface ServerOperation<P extends ServerOperationParameters<M>,M extends ServerOperationMessage>
- All Known Implementing Classes:
public interface ServerOperation<P extends ServerOperationParameters<M>,M extends ServerOperationMessage>Base interface for all
ServerOperationimplementations. Implementations perform a server side operation on a document.
Be aware that the
ServerOperationaffects the existing server side document. To be precise, there is a copy of the server-side document is created internally, but all PageSegment instances are shared!
Invocation works in the following way:
- The client sends a
ServerOperation.Requestcontaining the stateful document and a mandatory operation configuration
- The server retrieves the client side representation of the document and updates generates a server-side document copy carrying the client side state with it
- The server retrieves the operation configuration
- The server asynchronously executes the
ServerOperationby invoking its
invoke(Request, ResponseChannel)method on a separate server side thread
- The server immediately answers the
ServerOperation.Requestby sending exactly one
ServerOperation.ResponseChanneltelling the client that the execution was started successfully
- The server may send additional
ServerOperationMessages informing the client about the progress of the operation
- The client may receive those
ServerOperationMessages, update its state and / or display the progress to the user
- The server sends a final
ServerOperationMessagecontaining the result of the operation
- The client receives a final
Observer.onCompleted(), may update its state and display the result of the
ServerOperationto the user
Nested Class Summary
Nested Classes Modifier and Type Interface Description
ServerOperation.Request<P>The client request including operation specific configuration:
ServerOperation.ResponseChannel<M>The channel to which the server sends messages to in order to notify the client.
void invoke(ServerOperation.Request<P> request, ServerOperation.ResponseChannel<M> responseChannel) throws ExceptionExecutes the operation asynchronously on the server side.
request- The client request containing the configuration for the execution
responseChannel- The channel which the server uses to notify the client
Exception- In the case of a server side error during the execution of the operation an exception is thrown. Catching this exception on the client side can be used to implement error handling.