Interface SynchronizerClientFactory

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface SynchronizerClientFactory
    extends java.lang.AutoCloseable
    Used to create StateSynchronizer and RevisionedStreamClient objects which allow for reading and writing data from a pre-configured stream with strong consistency guarantees.
    • Method Detail

      • withScope

        static SynchronizerClientFactory withScope​(java.lang.String scope,
                                                   ClientConfig config)
        Creates a new instance of Client Factory.
        Parameters:
        scope - The scope string.
        config - Configuration for the client.
        Returns:
        Instance of ClientFactory implementation.
      • createRevisionedStreamClient

        <T> RevisionedStreamClient<T> createRevisionedStreamClient​(java.lang.String streamName,
                                                                   Serializer<T> serializer,
                                                                   SynchronizerConfig config)
        Creates a new RevisionedStreamClient that will work with the specified stream.
        Type Parameters:
        T - The type of events.
        Parameters:
        streamName - The name of the stream for the synchronizer.
        serializer - The serializer for updates.
        config - The client configuration.
        Returns:
        Revisioned stream client.
      • createStateSynchronizer

        <StateT extends Revisioned,​UpdateT extends Update<StateT>,​InitT extends InitialUpdate<StateT>> StateSynchronizer<StateT> createStateSynchronizer​(java.lang.String streamName,
                                                                                                                                                                     Serializer<UpdateT> updateSerializer,
                                                                                                                                                                     Serializer<InitT> initSerializer,
                                                                                                                                                                     SynchronizerConfig config)
        Creates a new StateSynchronizer that will work on the specified stream.
        Type Parameters:
        StateT - The type of the state being synchronized.
        UpdateT - The type of the updates being written.
        InitT - The type of the initial update used.
        Parameters:
        streamName - The name of the stream for the synchronizer.
        updateSerializer - The serializer for updates.
        initSerializer - The serializer for the initial update.
        config - The synchronizer configuration.
        Returns:
        Newly created StateSynchronizer that will work on the given stream.
      • close

        void close()
        Closes the client factory. This will close any connections created through it.
        Specified by:
        close in interface java.lang.AutoCloseable
        See Also:
        AutoCloseable.close()