and.Mapping
Class Cluster

java.lang.Object
  extended by and.Mapping.Cluster
All Implemented Interfaces:
java.io.Serializable

public class Cluster
extends java.lang.Object
implements java.io.Serializable

Class representing a computing nodes cluster

Author:
Sébastien Miquée
See Also:
Serialized Form

Constructor Summary
Cluster()
          Default constructor.
Cluster(int _nb)
          Constructor.
Cluster(int _nb, java.lang.String _name)
          Constructor.
 
Method Summary
 void addGNode(GNode _n)
          Adding a computing node to the cluster.
 java.util.ArrayList<GNode> getGNodes()
          Return the list of computing nodes which are in the cluster.
 java.lang.String getName()
          Return cluster's name.
 int getNbGNode()
          Return the amount of computing nodes in the cluster.
 java.lang.String getSite()
          Return the site's name in which the cluster is.
 void initIndice()
          Initialization of indice variable.
 boolean isIn(GNode _g)
          Test if a computing node is in the cluster.
 GNode nextGNode()
          Return the next computing node in the cluster, according to the indice variable.
 void removeGNode(GNode _dead)
          Remove a failed node from the cluster.
 void setName(java.lang.String _name)
          Set the name of the cluster.
 void setSite(java.lang.String _site)
          Set the site in which the cluster is.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cluster

public Cluster()
Default constructor.


Cluster

public Cluster(int _nb)
Constructor.

Parameters:
_nb - The amount of computing nodes in the cluster

Cluster

public Cluster(int _nb,
               java.lang.String _name)
Constructor.

Parameters:
_nb - The amount of computing nodes in the cluster
_name - Cluster's name
Method Detail

setName

public void setName(java.lang.String _name)
Set the name of the cluster.

Parameters:
_name - Cluster's name

addGNode

public void addGNode(GNode _n)
Adding a computing node to the cluster.

Parameters:
_n - Node to be add

getGNodes

public java.util.ArrayList<GNode> getGNodes()
Return the list of computing nodes which are in the cluster.

Returns:
The list of nodes

getName

public java.lang.String getName()
Return cluster's name.

Returns:
Cluster's name

getNbGNode

public int getNbGNode()
Return the amount of computing nodes in the cluster.

Returns:
The amount of nodes

setSite

public void setSite(java.lang.String _site)
Set the site in which the cluster is.

Parameters:
_site - Site's name

getSite

public java.lang.String getSite()
Return the site's name in which the cluster is.

Returns:
The site's name

isIn

public boolean isIn(GNode _g)
Test if a computing node is in the cluster.

Parameters:
_g - The node to be tested
Returns:
True is _g is in, False else

initIndice

public void initIndice()
Initialization of indice variable.


nextGNode

public GNode nextGNode()
Return the next computing node in the cluster, according to the indice variable.

Returns:
The next node in the cluster

removeGNode

public void removeGNode(GNode _dead)
Remove a failed node from the cluster.

Parameters:
_dead - The failed node