public final class ClusterServer
extends java.lang.Object
ServerConnector
obtained with #getServerConnector
is used to actually
communicate with this ClusterServer when it is active in another instance of
Resin .Modifier and Type | Method and Description |
---|---|
void |
add(ProtocolPort protocolPort) |
void |
addContentProgram(ConfigProgram program)
Adds a program.
|
void |
addHttp(TcpPort listener) |
void |
addListen(TcpPort listener) |
void |
addListenDefault(ConfigProgram program)
Adds a listen-default
|
void |
addPingUrl(java.lang.String url)
Adds a ping url for availability testing
|
void |
addPortDefault(ContainerProgram program)
Adds a port-default
|
void |
close()
Close any ports.
|
TcpPort |
createHttp() |
TcpPort |
createListen() |
TcpPort |
createProtocol() |
static int |
decode(int code) |
void |
generateIdPrefix(java.lang.StringBuilder cb)
Adds the primary/backup/third digits to the id.
|
java.lang.String |
getAddress()
Gets the address
|
ClusterServerMXBean |
getAdmin()
Returns the admin object
|
java.lang.String |
getBamAdminName()
Returns the bam name
|
static java.lang.String |
getBamAdminName(CloudServer server) |
CloudPod |
getCloudPod()
Returns the owning pod
|
CloudServer |
getCloudServer() |
CloudCluster |
getCluster()
Returns the cluster.
|
long |
getClusterIdleTime()
The cluster idle-time.
|
ClientSocketFactory |
getClusterSocketPool()
Returns the socket pool as a pod cluster connector.
|
long |
getClusterSocketTimeout()
The cluster socket-timeout
|
static ClusterServer |
getCurrent() |
java.lang.String |
getDebugId() |
java.lang.String |
getHeartbeatState() |
java.lang.String |
getId()
Gets the server identifier.
|
int |
getIndex()
Returns the server index within the pod.
|
java.lang.String |
getIp()
Gets the ip.
|
long |
getLastHeartbeatTime() |
java.util.ArrayList<TcpPort> |
getListeners() |
long |
getLoadBalanceBusyRecoverTime()
Gets the loadBalance fail-recover-time.
|
int |
getLoadBalanceConnectionMin()
The minimum number of load balance connections for green load balancing.
|
long |
getLoadBalanceConnectTimeout()
Gets the loadBalance connection time.
|
long |
getLoadBalanceIdleTime()
Sets the loadBalance idle-time.
|
long |
getLoadBalanceRecoverTime()
Gets the loadBalance fail-recover-time.
|
ClientSocketFactory |
getLoadBalanceSocketPool()
Returns the socket pool as a load-balancer.
|
long |
getLoadBalanceSocketTimeout()
Gets the loadBalance socket time.
|
long |
getLoadBalanceWarmupTime()
Gets the loadBalance warmup time
|
int |
getLoadBalanceWeight()
Gets the loadBalance weight
|
java.util.ArrayList<java.lang.String> |
getPingUrlList()
Returns the ping url list
|
int |
getPort() |
ConfigProgram |
getPortDefaults()
Returns the port defaults for the Server
|
static CloudServer |
getSelfServer() |
static java.lang.String |
getServerAddress(int index,
int podIndex) |
java.lang.String |
getServerClusterId()
Returns the server's id within the cluster
|
java.lang.String |
getServerDomainId()
Returns the server's id within all Resin clusters
|
ConfigProgram |
getServerProgram()
Returns the configuration program for the Server.
|
java.lang.String |
getStage() |
long |
getStateTimestamp()
Returns the last state change timestamp.
|
TriadOwner |
getTriadOwner()
Returns the pod owner
|
void |
init()
Initialize
|
boolean |
isActiveRemote()
Returns true if the server is remote and active.
|
boolean |
isBackup() |
boolean |
isDynamic()
True for a dynamic server
|
boolean |
isHeartbeatActive()
Test if the server is active, i.e.
|
boolean |
isRemote() |
boolean |
isRemotePod() |
boolean |
isSelf()
Returns true for the self server
|
boolean |
isSSL() |
boolean |
isTriad()
Returns true if this server is a triad.
|
boolean |
notifyHeartbeatStart()
Notify that a start event has been received.
|
boolean |
notifyHeartbeatStop()
Notify that a stop event has been received.
|
void |
onHeartbeatTimeout() |
void |
setAcceptListenBacklog(ConfigProgram program)
Sets the socket's listen property
|
void |
setAcceptThreadMax(ConfigProgram program)
Sets the maximum spare listen.
|
void |
setAcceptThreadMin(ConfigProgram program)
Sets the minimum spare listen.
|
void |
setBackup(boolean isBackup)
Sets true for backups
|
void |
setClusterSocketTimeout(Period period) |
void |
setConnectionMax(ConfigProgram program)
Sets the maximum connections per port
|
void |
setKeepaliveConnectionTimeMax(ConfigProgram program)
Sets the keepalive connection timeout
|
void |
setKeepaliveMax(ConfigProgram program)
Sets the maximum keepalive
|
void |
setKeepaliveSelectEnable(ConfigProgram program)
Sets the select-based keepalive timeout
|
void |
setKeepaliveSelectMax(ConfigProgram program)
Sets the select-based keepalive timeout
|
void |
setKeepaliveSelectThreadTimeout(ConfigProgram program)
Sets the select-based keepalive timeout
|
void |
setKeepaliveTimeout(ConfigProgram program)
Sets the keepalive timeout
|
void |
setLoadBalanceBusyRecoverTime(Period period)
Sets the loadBalance busy-recover-time.
|
void |
setLoadBalanceConnectionMin(int min)
The minimum number of load balance connections for green load balancing.
|
void |
setLoadBalanceConnectTimeout(Period period)
Sets the loadBalance connection time.
|
void |
setLoadBalanceIdleTime(Period period)
Sets the loadBalance max-idle-time.
|
void |
setLoadBalanceRecoverTime(Period period)
Sets the loadBalance fail-recover-time.
|
void |
setLoadBalanceSocketTimeout(Period period)
Sets the loadBalance socket time.
|
void |
setLoadBalanceWarmupTime(Period period)
Sets the loadBalance warmup time
|
void |
setLoadBalanceWeight(int weight)
Sets the loadBalance weight
|
void |
setPort(int port) |
void |
setSocketTimeout(ConfigProgram program)
Sets the suspend timeout
|
void |
setStage(java.lang.String stage) |
void |
setSuspendTimeMax(ConfigProgram program)
Sets the suspend timeout
|
void |
stopServer()
Starts the server.
|
java.lang.String |
toString() |
void |
updateHeartbeatTimeout(long timeout) |
public static CloudServer getSelfServer()
public static java.lang.String getBamAdminName(CloudServer server)
public static ClusterServer getCurrent()
public java.lang.String getId()
public java.lang.String getDebugId()
public CloudServer getCloudServer()
public java.lang.String getServerClusterId()
public java.lang.String getServerDomainId()
public java.lang.String getBamAdminName()
public CloudCluster getCluster()
public CloudPod getCloudPod()
public boolean isTriad()
public TriadOwner getTriadOwner()
public int getIndex()
public java.lang.String getAddress()
public int getPort()
public void setPort(int port)
public boolean isSSL()
public void setBackup(boolean isBackup)
public boolean isBackup()
public boolean isDynamic()
public void setLoadBalanceConnectTimeout(Period period)
public long getLoadBalanceConnectTimeout()
@Configurable public void setLoadBalanceConnectionMin(int min)
public int getLoadBalanceConnectionMin()
public void setLoadBalanceSocketTimeout(Period period)
public long getLoadBalanceSocketTimeout()
public void setLoadBalanceIdleTime(Period period)
public long getLoadBalanceIdleTime()
public void setLoadBalanceRecoverTime(Period period)
public long getLoadBalanceRecoverTime()
public void setLoadBalanceBusyRecoverTime(Period period)
public long getLoadBalanceBusyRecoverTime()
public long getClusterIdleTime()
@Configurable public void setClusterSocketTimeout(Period period)
public long getClusterSocketTimeout()
@Configurable public TcpPort createHttp() throws ConfigException
ConfigException
public void addHttp(TcpPort listener)
@Configurable public TcpPort createProtocol()
@Configurable public TcpPort createListen()
public void addListen(TcpPort listener)
@Configurable public void add(ProtocolPort protocolPort)
public java.util.ArrayList<TcpPort> getListeners()
@Configurable public void addPortDefault(ContainerProgram program)
@Configurable public void addListenDefault(ConfigProgram program)
public void setAcceptListenBacklog(ConfigProgram program)
public void setAcceptThreadMin(ConfigProgram program) throws ConfigException
ConfigException
public void setAcceptThreadMax(ConfigProgram program) throws ConfigException
ConfigException
public void setConnectionMax(ConfigProgram program)
public void setKeepaliveMax(ConfigProgram program)
public void setKeepaliveTimeout(ConfigProgram program)
public void setKeepaliveConnectionTimeMax(ConfigProgram program)
public void setKeepaliveSelectEnable(ConfigProgram program)
public void setKeepaliveSelectMax(ConfigProgram program)
public void setKeepaliveSelectThreadTimeout(ConfigProgram program)
public void setSocketTimeout(ConfigProgram program)
public void setSuspendTimeMax(ConfigProgram program)
public void setStage(java.lang.String stage)
public java.lang.String getStage()
public void addPingUrl(java.lang.String url)
public java.util.ArrayList<java.lang.String> getPingUrlList()
public void setLoadBalanceWarmupTime(Period period)
public long getLoadBalanceWarmupTime()
public void setLoadBalanceWeight(int weight)
public int getLoadBalanceWeight()
public java.lang.String getIp()
public boolean isSelf()
public boolean isRemote()
public final ClientSocketFactory getClusterSocketPool()
public final ClientSocketFactory getLoadBalanceSocketPool()
public final boolean isActiveRemote()
@Configurable public void addContentProgram(ConfigProgram program)
public ConfigProgram getServerProgram()
public ConfigProgram getPortDefaults()
public void init()
public boolean isRemotePod()
public boolean isHeartbeatActive()
public long getStateTimestamp()
public long getLastHeartbeatTime()
public java.lang.String getHeartbeatState()
public boolean notifyHeartbeatStart()
public boolean notifyHeartbeatStop()
public void updateHeartbeatTimeout(long timeout)
public void onHeartbeatTimeout()
public void stopServer()
public void generateIdPrefix(java.lang.StringBuilder cb)
public ClusterServerMXBean getAdmin()
public void close()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String getServerAddress(int index, int podIndex)
public static int decode(int code)