org.springframework.yarn.am.grid.ProjectedGrid Maven / Gradle / Ivy
package org.springframework.yarn.am.grid;
import java.util.Collection;
import org.springframework.yarn.am.grid.listener.ProjectedGridListener;
/**
* ProjectedGrid
*
* @author Janne Valkealahti
* @see Grid
*/
public interface ProjectedGrid {
/**
* Adds a new grid projection.
*
* If a projected grid refuses to add a particular grid projection for any reason
* other than that it already contains the grid projection, it must throw
* an exception (rather than returning false). This preserves
* the invariant that a projected grid always contains the specified grid projection
* after this call returns.
*
* @param projection the grid projection
* @return true if this projected grid changed as a result of the call
*/
boolean addProjection(GridProjection projection);
/**
* Removes a grid projection.
*
* Removes a single instance of the specified grid projection from this
* projected grid, if it is present.
*
* @param projection the grid projection
* @return true if a grid projection was removed as a result of this call
*/
boolean removeProjection(GridProjection projection);
/**
* Gets a collection of grid projections or empty collection of there
* are no projections defined.
*
* @return the collection of grid projections
*/
Collection getProjections();
/**
* Adds a listener to be notified of projected grid events.
*
* @param listener the projected grid listener
*/
void addProjectedGridListener(ProjectedGridListener listener);
}