Class PrimaryBackupClient.Builder

java.lang.Object
io.atomix.protocols.backup.PrimaryBackupClient.Builder
All Implemented Interfaces:
io.atomix.utils.Builder<PrimaryBackupClient>
Enclosing class:
PrimaryBackupClient

public static class PrimaryBackupClient.Builder
extends java.lang.Object
implements io.atomix.utils.Builder<PrimaryBackupClient>
Primary-backup client builder.
  • Constructor Details

  • Method Details

    • withClientName

      public PrimaryBackupClient.Builder withClientName​(java.lang.String clientName)
      Sets the client name.
      Parameters:
      clientName - The client name.
      Returns:
      The client builder.
      Throws:
      java.lang.NullPointerException - if clientName is null
    • withPartitionId

      public PrimaryBackupClient.Builder withPartitionId​(io.atomix.primitive.partition.PartitionId partitionId)
      Sets the client partition ID.
      Parameters:
      partitionId - the client partition ID
      Returns:
      the client builder
    • withMembershipService

      public PrimaryBackupClient.Builder withMembershipService​(io.atomix.cluster.ClusterMembershipService membershipService)
      Sets the cluster membership service.
      Parameters:
      membershipService - the cluster membership service
      Returns:
      the client builder
    • withProtocol

      public PrimaryBackupClient.Builder withProtocol​(io.atomix.protocols.backup.protocol.PrimaryBackupClientProtocol protocol)
      Sets the client protocol.
      Parameters:
      protocol - the client protocol
      Returns:
      the client builder
    • withPrimaryElection

      public PrimaryBackupClient.Builder withPrimaryElection​(io.atomix.primitive.partition.PrimaryElection primaryElection)
      Sets the primary election.
      Parameters:
      primaryElection - the primary election
      Returns:
      the client builder
    • withSessionIdProvider

      public PrimaryBackupClient.Builder withSessionIdProvider​(io.atomix.primitive.session.SessionIdService sessionIdService)
      Sets the session ID provider.
      Parameters:
      sessionIdService - the session ID provider
      Returns:
      the client builder
    • withThreadModel

      public PrimaryBackupClient.Builder withThreadModel​(io.atomix.utils.concurrent.ThreadModel threadModel)
      Sets the client thread model.
      Parameters:
      threadModel - the client thread model
      Returns:
      the client builder
      Throws:
      java.lang.NullPointerException - if the thread model is null
    • withThreadPoolSize

      public PrimaryBackupClient.Builder withThreadPoolSize​(int threadPoolSize)
      Sets the client thread pool size.
      Parameters:
      threadPoolSize - The client thread pool size.
      Returns:
      The client builder.
      Throws:
      java.lang.IllegalArgumentException - if the thread pool size is not positive
    • withThreadContextFactory

      public PrimaryBackupClient.Builder withThreadContextFactory​(io.atomix.utils.concurrent.ThreadContextFactory threadContextFactory)
      Sets the client thread context factory.
      Parameters:
      threadContextFactory - the client thread context factory
      Returns:
      the client builder
      Throws:
      java.lang.NullPointerException - if the factory is null
    • build

      public PrimaryBackupClient build()
      Specified by:
      build in interface io.atomix.utils.Builder<PrimaryBackupClient>