Interface MessageEndpointConnection


public interface MessageEndpointConnection
ENTERPRISE EDITION API

The interface implemented by the application using a custom transportation method to exchange replication data between peers.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called to close the remote connection with the other peer when the replicator stops or when the MessageEndpointListener closes the connection.
    void
    Called to open a remote connection to the other peer when the replicator starts or when the MessageEndpointListener accepts the connection.
    void
    send(Message message, MessagingCompletion completion)
    Called to send the replication data to the other peer.
  • Method Details

    • open

      void open(@NonNull ReplicatorConnection connection, @NonNull MessagingCompletion completion)
      Called to open a remote connection to the other peer when the replicator starts or when the MessageEndpointListener accepts the connection. When the remote connection is established, call the completion block to acknowledge the completion.
      Parameters:
      connection - the replicator connection
      completion - the completion callback
    • send

      void send(@NonNull Message message, @NonNull MessagingCompletion completion)
      Called to send the replication data to the other peer. When the replication data is sent, call the completion block to acknowledge the completion.
      Parameters:
      message - the message
      completion - the completion callback
    • close

      void close(@Nullable Exception error, @NonNull MessagingCloseCompletion completion)
      Called to close the remote connection with the other peer when the replicator stops or when the MessageEndpointListener closes the connection. When the remote connection is closed, call the completion block to acknowledge the completion.
      Parameters:
      error - null on success or an exception describing the failure
      completion - the completion callback