Package io.atomix.protocols.backup
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 Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description PrimaryBackupServerbuild()PrimaryBackupServer.BuilderwithMemberGroupProvider(io.atomix.primitive.partition.MemberGroupProvider memberGroupProvider)Sets the member group provider.PrimaryBackupServer.BuilderwithMembershipService(io.atomix.cluster.ClusterMembershipService membershipService)Sets the cluster membership service.PrimaryBackupServer.BuilderwithPrimaryElection(io.atomix.primitive.partition.PrimaryElection primaryElection)Sets the primary election.PrimaryBackupServer.BuilderwithPrimitiveTypes(io.atomix.primitive.PrimitiveTypeRegistry primitiveTypes)Sets the primitive types.PrimaryBackupServer.BuilderwithProtocol(io.atomix.protocols.backup.protocol.PrimaryBackupServerProtocol protocol)Sets the protocol.PrimaryBackupServer.BuilderwithServerName(java.lang.String serverName)Sets the server name.PrimaryBackupServer.BuilderwithThreadContextFactory(io.atomix.utils.concurrent.ThreadContextFactory threadContextFactory)Sets the client thread context factory.PrimaryBackupServer.BuilderwithThreadModel(io.atomix.utils.concurrent.ThreadModel threadModel)Sets the client thread model.PrimaryBackupServer.BuilderwithThreadPoolSize(int threadPoolSize)Sets the client thread pool size.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withServerName
Sets the server name.- Parameters:
serverName- The server name.- Returns:
- The server builder.
- Throws:
java.lang.NullPointerException- ifserverNameis 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 theprimitiveTypesargument isnull
-
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
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
- Specified by:
buildin interfaceio.atomix.utils.Builder<PrimaryBackupServer>
-