Interface ServerOperation<P extends ServerOperationParameters<M>,M extends ServerOperationMessage>

All Known Implementing Classes:
AbstractExportServerOperation, AbstractPDFExportServerOperation, AbstractPostscriptExportServerOperation, AbstractTIFFExportServerOperation, DnDSaveServerOperation, ExportServerOperation, SaveAnnotationServerOperation

public interface ServerOperation<P extends ServerOperationParameters<M>,M extends ServerOperationMessage>
Base interface for all ServerOperation implementations. Implementations perform a server side operation on a document.

Be aware that the ServerOperation affects 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:

  1. The client sends a ServerOperation.Request containing the stateful document and a mandatory operation configuration
  2. 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
  3. The server retrieves the operation configuration
  4. The server asynchronously executes the ServerOperation by invoking its invoke(Request, ResponseChannel) method on a separate server side thread
  5. The server immediately answers the ServerOperation.Request by sending exactly one ServerOperationMessage through the ServerOperation.ResponseChannel telling the client that the execution was started successfully
  6. The server may send additional ServerOperationMessages informing the client about the progress of the operation
  7. The client may receive those ServerOperationMessages, update its state and / or display the progress to the user
  8. The server sends a final ServerOperationMessage containing the result of the operation
  9. The client receives a final ServerOperationMessage in Observer.onCompleted(), may update its state and display the result of the ServerOperation to the user
  • Method Details

    • invoke

      void invoke(ServerOperation.Request<P> request, ServerOperation.ResponseChannel<M> responseChannel) throws Exception
      Executes the operation asynchronously on the server side.
      Parameters:
      request - The client request containing the configuration for the execution
      responseChannel - The channel which the server uses to notify the client
      Throws:
      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.