com.caucho.cloud.topology
Class CloudServer

java.lang.Object
  extended by com.caucho.cloud.topology.CloudServer
Direct Known Subclasses:
TriadServer

public class CloudServer
extends java.lang.Object

Defines a cloud server, a single Resin instance. Each server has the following:

Servers are organized into pods of up to 64 servers, contained in a cluster. All the clusters are contained in a domain.


Nested Class Summary
static class CloudServer.ServerType
           
 
Constructor Summary
CloudServer(java.lang.String id, CloudPod pod, int index, java.lang.String address, int port, boolean isSSL, CloudServer.ServerType isStatic)
           
 
Method Summary
static int decode(int code)
           
 void disable()
           
 void disableSoft()
           
 void enable()
           
 java.lang.String getAddress()
          Gets the address
 CloudCluster getCluster()
          Returns the cluster.
<T> T
getData(java.lang.Class<T> cl)
           
 java.lang.String getDebugId()
           
 java.lang.String getId()
          Gets the unique server identifier.
 java.lang.String getIdWithinCluster()
          Returns the server's id within the cluster
 java.lang.String getIdWithinDomain()
          Returns the server's id within all Resin clusters
 int getIndex()
          Returns the index within the pod.
 CloudPod getPod()
          Returns the pod
 int getPort()
          Gets the port
 CloudServerState getState()
          Returns the servers current state.
 CloudSystem getSystem()
          Returns the system.
 TriadOwner getTriadOwner()
          Returns the pod owner
 boolean isExternal()
          True for external-address configured servers.
 boolean isSelf()
          True for the active server
 boolean isSSL()
           
 boolean isStatic()
          True for statically configured servers.
 boolean isTriad()
          True if this server is a triad.
 void onHeartbeatStart()
           
 void onHeartbeatStop()
           
 void overrideState(CloudServerState state)
           
 void putData(java.lang.Object value)
           
<T> T
putDataIfAbsent(T value)
           
<T> T
removeData(java.lang.Class<T> cl)
           
 void setSelf(boolean isSelf)
          Sets true for the active server.
 void setState(CloudServerState state)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CloudServer

public CloudServer(java.lang.String id,
                   CloudPod pod,
                   int index,
                   java.lang.String address,
                   int port,
                   boolean isSSL,
                   CloudServer.ServerType isStatic)
Method Detail

getId

public final java.lang.String getId()
Gets the unique server identifier.


getDebugId

public final java.lang.String getDebugId()

getIndex

public final int getIndex()
Returns the index within the pod.


getIdWithinCluster

public final java.lang.String getIdWithinCluster()
Returns the server's id within the cluster


getIdWithinDomain

public final java.lang.String getIdWithinDomain()
Returns the server's id within all Resin clusters


isTriad

public boolean isTriad()
True if this server is a triad.


isStatic

public boolean isStatic()
True for statically configured servers.


isExternal

public boolean isExternal()
True for external-address configured servers.


isSelf

public boolean isSelf()
True for the active server


setSelf

public void setSelf(boolean isSelf)
Sets true for the active server.


getState

public CloudServerState getState()
Returns the servers current state.


getPod

public CloudPod getPod()
Returns the pod


getCluster

public CloudCluster getCluster()
Returns the cluster.


getSystem

public CloudSystem getSystem()
Returns the system.


getTriadOwner

public TriadOwner getTriadOwner()
Returns the pod owner


getAddress

public final java.lang.String getAddress()
Gets the address


getPort

public final int getPort()
Gets the port


isSSL

public boolean isSSL()

onHeartbeatStart

public void onHeartbeatStart()

onHeartbeatStop

public void onHeartbeatStop()

setState

public void setState(CloudServerState state)

overrideState

public void overrideState(CloudServerState state)

disable

public void disable()

disableSoft

public void disableSoft()

enable

public void enable()

putData

public void putData(java.lang.Object value)

putDataIfAbsent

public <T> T putDataIfAbsent(T value)

getData

public <T> T getData(java.lang.Class<T> cl)

removeData

public <T> T removeData(java.lang.Class<T> cl)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

decode

public static int decode(int code)