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