Default configuration is {@code false}, potentially swamping new nodes with * duplicates. However, this does guarantee that all the data is replicated over to the new * node and is useful especially in the case that the originating node of some data is not * currently running. * * @param bootstrapOnlyLocalEntries if a node provided with this replication should * replicate only local data to the new nodes joining the * replication network * @return this builder back */ @NotNull public B bootstrapOnlyLocalEntries(boolean bootstrapOnlyLocalEntries) { this.bootstrapOnlyLocalEntries = bootstrapOnlyLocalEntries; return (B) this; } /** * Configures replication "name", which could appear in log messages and replication * thread names. Default is {@code "(unknown)"}. * * @param name human-readable replication name * @return this builder back */ public B name(String name) { this.name = name; return (B) this; } /** * Creates a Replication instance with the given node (server) identifier. * * @param identifier the node (server) identifier of the returned replication * @return a new Replication instance with the specified node (server) identifier * @throws IllegalArgumentException if the given identifier is non-positive * @throws IllegalStateException if neither {@link #tcpTransportAndNetwork( * TcpTransportAndNetworkConfig)} nor {@link #udpTransport(UdpTransportConfig)} are * configured to non-{@code null}. At least one of the transport-level configs * should be specified. */ @NotNull public abstract R createWithId(byte identifier); void check(byte identifier) { if (identifier <= 0) throw new IllegalArgumentException("Identifier must be positive, " + identifier + " given"); } } }