public class MonitorConfig
extends java.lang.Object
implements java.lang.Cloneable
Monitor
.
The following properties identify the target group.
Modifier and Type | Field and Description |
---|---|
static MonitorConfig |
DEFAULT
An instance created using the default constructor is initialized with
the default settings.
|
Constructor and Description |
---|
MonitorConfig()
An instance created using the default constructor is initialized with
the default settings.
|
MonitorConfig(ReplicationConfig repConfig) |
Modifier and Type | Method and Description |
---|---|
MonitorConfig |
clone()
Returns a copy of this configuration object.
|
java.lang.String |
getGroupName()
Gets the name associated with the replication group.
|
java.lang.String |
getHelperHosts()
Returns the string identifying one or more helper host and port pairs in
this format:
|
java.util.Set<java.net.InetSocketAddress> |
getHelperSockets() |
java.lang.String |
getNodeHostname()
Returns the hostname component of the nodeHost property.
|
java.lang.String |
getNodeHostPort()
Returns the hostname and port associated with this node.
|
java.lang.String |
getNodeName()
Returns the unique name associated with this monitor.
|
int |
getNodePort()
Returns the port component of the nodeHost property.
|
java.net.InetSocketAddress |
getNodeSocketAddress() |
int |
getNumRetries()
Returns the number of times a ping thread attempts to contact a node
before deeming it unreachable.
|
long |
getRetryInterval()
Returns the number of milliseconds between ping thread retries.
|
int |
getSocketConnectTimeout()
Returns the socketConnection timeout, in milliseconds, used
when the ping thread attempts to establish a connection with a
replication node.
|
MonitorConfig |
setGroupName(java.lang.String groupName)
Sets the name for the replication group.
|
void |
setGroupNameVoid(java.lang.String groupName) |
MonitorConfig |
setHelperHosts(java.lang.String helperHosts)
Identify one or more helpers nodes by their host and port pairs in this
format:
|
void |
setHelperHostsVoid(java.lang.String helperHosts) |
MonitorConfig |
setNodeHostPort(java.lang.String hostPort)
Sets the hostname and port associated with this monitor.
|
void |
setNodeHostPortVoid(java.lang.String hostPort) |
MonitorConfig |
setNodeName(java.lang.String nodeName)
Sets the name to be associated with this
monitor . |
void |
setNodeNameVoid(java.lang.String nodeName) |
MonitorConfig |
setNumRetries(int numRetries)
Sets the number of times a ping thread attempts to contact a node
before deeming it unreachable.
|
void |
setNumRetriesVoid(int numRetries) |
MonitorConfig |
setRetryInterval(long retryInterval)
Sets the number of milliseconds between ping thread retries.
|
void |
setRetryIntervalVoid(long retryInterval) |
MonitorConfig |
setSocketConnectTimeout(int socketConnectTimeout)
Sets the socketConnection timeout, in milliseconds, used
when the ping thread attempts to establish a connection with a
replication node.
|
void |
setSocketConnectTimeoutVoid(int socketConnectTimeout) |
public static final MonitorConfig DEFAULT
public MonitorConfig()
MonitorConfig(ReplicationConfig repConfig)
public MonitorConfig setGroupName(java.lang.String groupName) throws java.lang.IllegalArgumentException
groupName
- the alpha numeric string representing the name.java.lang.IllegalArgumentException
- if the string name is not valid.public void setGroupNameVoid(java.lang.String groupName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String getGroupName()
public MonitorConfig setNodeName(java.lang.String nodeName) throws java.lang.IllegalArgumentException
monitor
. It must
be unique within the group. When the monitor
is
instantiated and joins the replication group, a check is done to ensure
that the name is unique, and a
RestartRequiredException
is thrown if it is
not.nodeName
- the name of this monitor.java.lang.IllegalArgumentException
public void setNodeNameVoid(java.lang.String nodeName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String getNodeName()
public MonitorConfig setNodeHostPort(java.lang.String hostPort)
hostname[:port]The port must be outside the range of "Well Known Ports" (zero through 1023).
hostPort
- the string containing the hostname and port as above.public void setNodeHostPortVoid(java.lang.String hostPort)
public java.lang.String getNodeHostPort()
hostname:port
public MonitorConfig setHelperHosts(java.lang.String helperHosts)
hostname[:port][,hostname[:port]]*
helperHosts
- the string representing the host and port pairs.public void setHelperHostsVoid(java.lang.String helperHosts)
public java.lang.String getHelperHosts()
hostname[:port][,hostname[:port]]*
public java.util.Set<java.net.InetSocketAddress> getHelperSockets()
public java.lang.String getNodeHostname()
public int getNodePort()
public java.net.InetSocketAddress getNodeSocketAddress()
public MonitorConfig setNumRetries(int numRetries)
public void setNumRetriesVoid(int numRetries)
public int getNumRetries()
public MonitorConfig setRetryInterval(long retryInterval)
public void setRetryIntervalVoid(long retryInterval)
public long getRetryInterval()
public MonitorConfig setSocketConnectTimeout(int socketConnectTimeout)
public void setSocketConnectTimeoutVoid(int socketConnectTimeout)
public int getSocketConnectTimeout()
public MonitorConfig clone()
clone
in class java.lang.Object
Copyright (c) 2004-2012 Oracle. All rights reserved.