Class PrimaryBackupServer.Builder

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

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

  • Method Details

    • withServerName

      public PrimaryBackupServer.Builder withServerName​(java.lang.String serverName)
      Sets the server name.
      Parameters:
      serverName - The server name.
      Returns:
      The server builder.
      Throws:
      java.lang.NullPointerException - if serverName is null
    • withMembershipService

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

      public PrimaryBackupServer.Builder withProtocol​(io.atomix.protocols.backup.protocol.PrimaryBackupServerProtocol protocol)
      Sets the protocol.
      Parameters:
      protocol - the protocol
      Returns:
      the server builder
    • withPrimaryElection

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

      public PrimaryBackupServer.Builder withPrimitiveTypes​(io.atomix.primitive.PrimitiveTypeRegistry primitiveTypes)
      Sets the primitive types.
      Parameters:
      primitiveTypes - the primitive types
      Returns:
      the server builder
      Throws:
      java.lang.NullPointerException - if the primitiveTypes argument is null
    • withMemberGroupProvider

      public PrimaryBackupServer.Builder withMemberGroupProvider​(io.atomix.primitive.partition.MemberGroupProvider memberGroupProvider)
      Sets the member group provider.
      Parameters:
      memberGroupProvider - the member group provider
      Returns:
      the partition group builder
    • withThreadModel

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

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

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

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