/**
 * Elastic Grid
 * Copyright (C) 2008-2009 Elastic Grid, LLC.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.elasticgrid.model;

import java.io.Serializable;
import java.util.Set;

/**
 * @author Jerome Bernard
 */
public interface Cluster<N extends Node> extends Serializable {
    String getName();
    Cluster<N> name(String name);
    boolean isRunning();
    Set<N> getNodes();
    Set<N> getMonitorNodes();
    Set<N> getAgentNodes();
    Cluster<N> addNodes(Set<N> nodes);
    Set<Application> getApplications();
    Application application(String name);
    Cluster<N> addApplications(Set<Application> applications);

    enum Status {
        RUNNING, STOPPED
    }
}

@@ -832,381 +832,2502 @@
 %0A * 
-@author Jerome Bernard%0A */%0Apublic interface Cluster%3CN extends Node%3E extends Serializable %7B%0A    String getName();%0A    Cluster%3CN%3E name(String name);%0A    boolean isRunning();%0A    Set%3CN%3E getNodes();%0A    Set%3CN%3E getMonitorNodes();%0A    Set%3CN%3E getAgentNodes();%0A    Cluster%3CN%3E addNodes(Set%3CN%3E nodes);%0A    Set%3CApplication%3E getApplications();%0A    Application application(String name);
+A cluster is a set of %7B@link Node%7Ds that are linked together%0A * and can be used by one or more monitor in order to deploy%0A * applications.%0A * @author Jerome Bernard%0A */%0Apublic interface Cluster%3CN extends Node%3E extends Serializable %7B%0A    /**%0A     * Get the name of the cluster.%0A     * @return the name of the cluster%0A     */%0A    String getName();%0A%0A    /**%0A     * Set the name of the cluster.%0A     * @param name the name of the cluster%0A     * @return the cluster%0A     */%0A    Cluster%3CN%3E name(String name);%0A%0A    /**%0A     * Give the running status of the cluster.%0A     * TODO: this method should be enhanced so that we can running different statuses like %22pending%22 or so.%0A     * @return true if the cluster is running%0A     */%0A    boolean isRunning();%0A%0A    /**%0A     * Return the set of %7B@link Node%7Ds which are members of this cluster.%0A     * @return the nodes%0A     */%0A    Set%3CN%3E getNodes();%0A%0A    /**%0A     * Return the set of %7B@link Node%7Ds which are members of this cluster and%0A     * are of %7B@link NodeProfile#MONITOR%7D or %7B@link NodeProfile#MONITOR_AND_AGENT%7D.%0A     * @return the monitors nodes%0A     */%0A    Set%3CN%3E getMonitorNodes();%0A%0A    /**%0A     * Return the set of %7B@link Node%7Ds which are members of this cluster and%0A     * are of %7B@link NodeProfile#AGENT%7D or %7B@link NodeProfile#MONITOR_AND_AGENT%7D.%0A     * @return the agents nodes%0A     */%0A    Set%3CN%3E getAgentNodes();%0A%0A    /**%0A     * Add nodes into the cluster.%0A     * Note: this method does NOT start nodes, it only modifies the list of nodes in the cluster;%0A     * it should not be called most of the time.%0A     * @param nodes the list of nodes to add to the cluster%0A     * @return the cluster%0A     */%0A    Cluster%3CN%3E addNodes(Set%3CN%3E nodes);%0A%0A    /**%0A     * Return the set of applications deployed within the cluster.%0A     * @return the set of applications%0A     */%0A    Set%3CApplication%3E getApplications();%0A%0A    /**%0A     * Add application into the cluster.%0A     * Note: this method does NOT deploy applications, it only modifies the list of applications in the cluster;%0A     * it should not be called most of the time.%0A     * @param name the name of the new application%0A     * @return the application created%0A     */%0A    Application application(String name);%0A%0A    /**%0A     * Add applications into the cluster.%0A     * Note: this method does NOT deploy applications, it only modifies the list of applications in the cluster;%0A     * it should not be called most of the time.%0A     * @param applications the applications%0A     * @return the cluster%0A     */
 %0A   
@@ -3383,24 +3383,70 @@
 ications);%0A%0A
+    /**%0A     * Status of the cluster.%0A     */%0A
     enum Sta

Javadoc.