public class AtomixClusterBuilder extends Object implements Builder<AtomixCluster>
| Modifier and Type | Method and Description |
|---|---|
AtomixCluster |
build()
Builds the object.
|
AtomixClusterBuilder |
setBroadcastInterval(Duration interval)
Sets the reachability broadcast interval.
|
AtomixClusterBuilder |
setReachabilityThreshold(int threshold)
Sets the reachability failure detection threshold.
|
AtomixClusterBuilder |
withAddress(Address address)
Sets the member address.
|
AtomixClusterBuilder |
withAddress(int port)
Sets the member address using local host.
|
AtomixClusterBuilder |
withAddress(String address)
Sets the member address.
|
AtomixClusterBuilder |
withAddress(String host,
int port)
Sets the member host/port.
|
AtomixClusterBuilder |
withClusterId(String clusterId)
Sets the cluster identifier.
|
AtomixClusterBuilder |
withHost(String host)
Sets the host to which the member belongs.
|
AtomixClusterBuilder |
withMemberId(MemberId localMemberId)
Sets the local member identifier.
|
AtomixClusterBuilder |
withMemberId(String localMemberId)
Sets the local member identifier.
|
AtomixClusterBuilder |
withMembershipProvider(NodeDiscoveryProvider locationProvider)
Sets the membership provider.
|
AtomixClusterBuilder |
withMulticastAddress(Address address)
Sets the multicast address.
|
AtomixClusterBuilder |
withMulticastEnabled()
Enables multicast node discovery.
|
AtomixClusterBuilder |
withMulticastEnabled(boolean multicastEnabled)
Sets whether multicast node discovery is enabled.
|
AtomixClusterBuilder |
withProperties(Properties properties)
Sets the member properties.
|
AtomixClusterBuilder |
withProperty(String key,
String value)
Sets a property of the member.
|
AtomixClusterBuilder |
withRack(String rack)
Sets the rack to which the member belongs.
|
AtomixClusterBuilder |
withReachabilityTimeout(Duration timeout)
Sets the reachability failure timeout.
|
AtomixClusterBuilder |
withZone(String zone)
Sets the zone to which the member belongs.
|
public AtomixClusterBuilder withClusterId(String clusterId)
clusterId - the cluster identifierpublic AtomixClusterBuilder withMemberId(String localMemberId)
localMemberId - the local member identifierpublic AtomixClusterBuilder withMemberId(MemberId localMemberId)
localMemberId - the local member identifierpublic AtomixClusterBuilder withAddress(String address)
address - a host:port tupleMalformedAddressException - if a valid Address cannot be constructed from the argumentspublic AtomixClusterBuilder withAddress(String host, int port)
host - the host nameport - the port numberMalformedAddressException - if a valid Address cannot be constructed from the argumentspublic AtomixClusterBuilder withAddress(int port)
port - the port numberMalformedAddressException - if a valid Address cannot be constructed from the argumentspublic AtomixClusterBuilder withAddress(Address address)
address - the member addresspublic AtomixClusterBuilder withZone(String zone)
zone - the zone to which the member belongspublic AtomixClusterBuilder withRack(String rack)
rack - the rack to which the member belongspublic AtomixClusterBuilder withHost(String host)
host - the host to which the member belongspublic AtomixClusterBuilder withProperties(Properties properties)
properties - the member propertiesNullPointerException - if the properties are nullpublic AtomixClusterBuilder withProperty(String key, String value)
key - the property key to setvalue - the property value to setNullPointerException - if the property is nullpublic AtomixClusterBuilder withMulticastEnabled()
public AtomixClusterBuilder withMulticastEnabled(boolean multicastEnabled)
multicastEnabled - whether to enable multicast node discoverypublic AtomixClusterBuilder withMulticastAddress(Address address)
address - the multicast addresspublic AtomixClusterBuilder setBroadcastInterval(Duration interval)
interval - the reachability broadcast intervalpublic AtomixClusterBuilder setReachabilityThreshold(int threshold)
threshold - the reachability failure detection thresholdpublic AtomixClusterBuilder withReachabilityTimeout(Duration timeout)
timeout - the reachability failure timeoutpublic AtomixClusterBuilder withMembershipProvider(NodeDiscoveryProvider locationProvider)
locationProvider - the membership providerpublic AtomixCluster build()
BuilderThe returned object may be a new instance of the built class or a recycled instance, depending on the semantics of the builder implementation. Users should never assume that a builder allocates a new instance.
build in interface Builder<AtomixCluster>Copyright © 2013–2018. All rights reserved.