|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.config.MulticastConfig
public class MulticastConfig
Contains the configuration for the multicast discovery mechanism.
With the multicast discovery mechanism Hazelcast allows Hazelcast members to find each other using multicast. So
Hazelcast members do not need to know concrete addresses of members, they just multicast to everyone listening.
It depends on your environment if multicast is possible or allowed; otherwise you need to have a look at the
tcp/ip cluster: TcpIpConfig
.
Field Summary | |
---|---|
static boolean |
DEFAULT_ENABLED
|
static String |
DEFAULT_MULTICAST_GROUP
|
static int |
DEFAULT_MULTICAST_PORT
|
static int |
DEFAULT_MULTICAST_TIMEOUT_SECONDS
|
static int |
DEFAULT_MULTICAST_TTL
|
Constructor Summary | |
---|---|
MulticastConfig()
|
Method Summary | |
---|---|
MulticastConfig |
addTrustedInterface(String ip)
Adds a trusted interface. |
String |
getMulticastGroup()
Gets the multicast group. |
int |
getMulticastPort()
Gets the multicast port. |
int |
getMulticastTimeoutSeconds()
Gets the multicast timeout in seconds. |
int |
getMulticastTimeToLive()
Gets the time to live of the multicast package. |
Set<String> |
getTrustedInterfaces()
Gets the trusted interfaces. |
boolean |
isEnabled()
Check if the multicast discovery mechanism has been enabled. |
MulticastConfig |
setEnabled(boolean enabled)
Enables or disables the multicast discovery mechanism |
MulticastConfig |
setMulticastGroup(String multicastGroup)
Sets the multicast-group. |
MulticastConfig |
setMulticastPort(int multicastPort)
Sets the multicast port. |
MulticastConfig |
setMulticastTimeoutSeconds(int multicastTimeoutSeconds)
Specifies the time in seconds that a node should wait for a valid multicast response from another node running in the network before declaring itself as master node and creating its own cluster. |
MulticastConfig |
setMulticastTimeToLive(int multicastTimeToLive)
Sets the time to live for the multicast package; a value between 0..255. |
MulticastConfig |
setTrustedInterfaces(Set<String> interfaces)
Sets the trusted interfaces. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_ENABLED
public static final String DEFAULT_MULTICAST_GROUP
public static final int DEFAULT_MULTICAST_PORT
public static final int DEFAULT_MULTICAST_TIMEOUT_SECONDS
public static final int DEFAULT_MULTICAST_TTL
Constructor Detail |
---|
public MulticastConfig()
Method Detail |
---|
public boolean isEnabled()
public MulticastConfig setEnabled(boolean enabled)
enabled
- the enabled to set true when disabled, false when disabled.
public String getMulticastGroup()
public MulticastConfig setMulticastGroup(String multicastGroup)
multicastGroup
- the multicastGroup to set
IllegalArgumentException
- if multicastGroup is null or empty.getMulticastGroup()
,
setMulticastPort(int)
public int getMulticastPort()
setMulticastPort(int)
public MulticastConfig setMulticastPort(int multicastPort)
multicastPort
- the multicastPort to set
IllegalArgumentException
- if multicastPort is smaller than 0.getMulticastPort()
,
setMulticastGroup(String)
public int getMulticastTimeoutSeconds()
setMulticastTimeoutSeconds(int)
public MulticastConfig setMulticastTimeoutSeconds(int multicastTimeoutSeconds)
multicastTimeoutSeconds
- the multicastTimeoutSeconds to setgetMulticastTimeoutSeconds()
public Set<String> getTrustedInterfaces()
setTrustedInterfaces(java.util.Set)
public MulticastConfig setTrustedInterfaces(Set<String> interfaces)
interfaces
- the new trusted interfaces.
if interfaces is null.
public MulticastConfig addTrustedInterface(String ip)
ip
- the ip of the trusted interface.
IllegalArgumentException
- if ip is null.setTrustedInterfaces(java.util.Set)
public int getMulticastTimeToLive()
MulticastSocket.setTimeToLive(int)
,
setMulticastTimeToLive(int)
public MulticastConfig setMulticastTimeToLive(int multicastTimeToLive)
multicastTimeToLive
- the time to live.
IllegalArgumentException
- if time to live is smaller than 0 or larger than 255.getMulticastTimeToLive()
,
MulticastSocket.setTimeToLive(int)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |