com.caucho.cloud.topology
Class CloudPod

java.lang.Object
  extended by com.caucho.cloud.topology.CloudPod

public class CloudPod
extends java.lang.Object

The CloudPod controls up to 64 CloudServers. The first three servers are the triad servers.


Constructor Summary
CloudPod(CloudCluster cluster, java.lang.String id, int index)
          Creates a new triad for the cluster.
 
Method Summary
 void addServerListener(CloudServerListener listener)
          Adds a listener to detect server add and removed.
 CloudServer createDynamicServer(int index, java.lang.String id, java.lang.String address, int port, boolean isSecure)
          Creates a new dynamic server
 CloudServer createDynamicServer(java.lang.String id, java.lang.String address, int port, boolean isSecure)
          Creates a new dynamic server
 CloudServer createExternalStaticServer(java.lang.String id, java.lang.String address, int port, boolean isSecure)
          Creates a new externa static server
 CloudServer createStaticServer(java.lang.String id, java.lang.String address, int port, boolean isSecure)
          Creates a new static server
 CloudServer findServer(int index)
          Returns the pod with the given index.
 CloudServer findServer(java.lang.String id)
          Finds the first server with the given server-id.
 CloudServer findServer(java.lang.String address, int port)
          Finds the first server with the given address and port.
 CloudServer findServerByUniqueClusterId(java.lang.String id)
          Finds the first server with the given cluster id, the three-digit base-64 identifier.
 CloudCluster getCluster()
          Returns the pod's cluster
<T> T
getData(java.lang.Class<T> cl)
           
 java.lang.String getId()
          Returns the pod id.
 int getIndex()
          Returns the pod index.
 CloudServer getServer(int index)
           
 int getServerLength()
           
 CloudServer[] getServerList()
           
 CloudSystem getSystem()
          Returns the pod's system
 TriadDispatcher<CloudServer> getTriadServerDispatcher()
          Returns the triad server dispatcher
 boolean isSelf()
           
 void putData(java.lang.Object value)
           
<T> T
putDataIfAbsent(T value)
           
 CloudServer removeDynamicServer(int index)
           
 CloudServer removeDynamicServer(java.lang.String name)
           
 void removeServerListener(CloudServerListener listener)
          Removes a listener to detect server add and removed.
 java.lang.String toString()
           
 void updateServerState(CloudServer scalingServer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CloudPod

public CloudPod(CloudCluster cluster,
                java.lang.String id,
                int index)
Creates a new triad for the cluster.

Parameters:
cluster - the owning cluster
index - the triad index
Method Detail

getId

public final java.lang.String getId()
Returns the pod id.


getIndex

public final int getIndex()
Returns the pod index.


getCluster

public final CloudCluster getCluster()
Returns the pod's cluster


getSystem

public final CloudSystem getSystem()
Returns the pod's system


isSelf

public final boolean isSelf()

getServer

public CloudServer getServer(int index)

getServerList

public CloudServer[] getServerList()

getServerLength

public int getServerLength()

findServer

public CloudServer findServer(java.lang.String id)
Finds the first server with the given server-id.


findServerByUniqueClusterId

public CloudServer findServerByUniqueClusterId(java.lang.String id)
Finds the first server with the given cluster id, the three-digit base-64 identifier.


findServer

public CloudServer findServer(int index)
Returns the pod with the given index.


findServer

public CloudServer findServer(java.lang.String address,
                              int port)
Finds the first server with the given address and port.


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)

addServerListener

public void addServerListener(CloudServerListener listener)
Adds a listener to detect server add and removed.


removeServerListener

public void removeServerListener(CloudServerListener listener)
Removes a listener to detect server add and removed.


createStaticServer

public CloudServer createStaticServer(java.lang.String id,
                                      java.lang.String address,
                                      int port,
                                      boolean isSecure)
Creates a new static server


createExternalStaticServer

public CloudServer createExternalStaticServer(java.lang.String id,
                                              java.lang.String address,
                                              int port,
                                              boolean isSecure)
Creates a new externa static server


createDynamicServer

public CloudServer createDynamicServer(int index,
                                       java.lang.String id,
                                       java.lang.String address,
                                       int port,
                                       boolean isSecure)
Creates a new dynamic server


createDynamicServer

public CloudServer createDynamicServer(java.lang.String id,
                                       java.lang.String address,
                                       int port,
                                       boolean isSecure)
Creates a new dynamic server


removeDynamicServer

public CloudServer removeDynamicServer(java.lang.String name)

removeDynamicServer

public CloudServer removeDynamicServer(int index)

updateServerState

public void updateServerState(CloudServer scalingServer)

getTriadServerDispatcher

public TriadDispatcher<CloudServer> getTriadServerDispatcher()
Returns the triad server dispatcher


toString

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