g-Eclipse
Release 1.0.0

eu.geclipse.core.model
Interface IGridContainer

All Superinterfaces:
IGridElement
All Known Subinterfaces:
IConnectionManager, IDefaultGridElementManager, IGridBatchQueueDescription, IGridConnection, IGridConnectionElement, IGridElementManager, IGridJob, IGridJobDescription, IGridJobManager, IGridProject, IGridResourceContainer, IGridRoot, IGridSiteConfig, IGridVisualisation, IGridWorkflowDescription, IServiceJobManager, IStorableElementManager, IVirtualOrganization, IVoManager
All Known Implementing Classes:
AbstractGridContainer, AbstractGridVisualisationResource, AbstractVirtualOrganization, BatchConnectionInfo, BatchQueueDescription, GenericVirtualOrganization, GridGlueComputing, GridJob, GridWorkflow, JSDLJobDescription, JSDLJobDescriptionModel, RemoteFilesContainer, ResourceGridContainer

public interface IGridContainer
extends IGridElement

An IGridContainer is an IGridElement that is able to contain other Grid elements as children.


Method Summary
 boolean canContain(IGridElement element)
          Determines if this may contain the specified element.
 boolean contains(IGridElement element)
          Determines if this container holds the specified element as child.
 IGridElement create(IGridElementCreator creator)
          Create a new Grid element from the specified IGridElementCreator and add the newly created element to the list of children.
 void delete(IGridElement child)
          Delete the specified child.
 void deleteAll()
          Delete all children from this container.
 IGridElement findChild(java.lang.String name)
          Search for a child with the specified name and return it.
 IGridElement findChildWithResource(java.lang.String resourceName)
          Search for a child that has an IResource with the specified name.
 int getChildCount()
          Get the number of children currently contained in this container.
 IGridElement[] getChildren(IProgressMonitor monitor)
          Get the children that are currently contained in this container.
 boolean hasChildren()
          Determine if this container contains any children.
 boolean isDirty()
          Returns if this container is dirty.
 boolean isLazy()
          Determines if this container is using a lazy loading mechanism to manage its children.
 void refresh(IProgressMonitor monitor)
          Refresh the content of this container.
 void setDirty()
          Mark this container as dirty.
 
Methods inherited from interface eu.geclipse.core.model.IGridElement
dispose, getFileStore, getName, getParent, getPath, getProject, getResource, isHidden, isLocal, isVirtual
 

Method Detail

canContain

boolean canContain(IGridElement element)
Determines if this may contain the specified element. This method works type specific, i.e. a container may or may not contain elements of a specified type.

Parameters:
element - The element that may be contained in this container.
Returns:
If this container may contain the specified element.

contains

boolean contains(IGridElement element)
Determines if this container holds the specified element as child.

Parameters:
element - The element to be checked if it is contained in this container.
Returns:
True if the specified element is defined as a child of this container.

create

IGridElement create(IGridElementCreator creator)
                    throws ProblemException
Create a new Grid element from the specified IGridElementCreator and add the newly created element to the list of children. If a child with the same name already exists this old child is replaced by the new child. Note that this is the only way to add children to an IGridContainer.

Parameters:
creator - The IGridElementCreator from which to create the new element.
Returns:
The element itself or the old element if the specified element is null and there was such an old element found. null in all other cases.
Throws:
ProblemException

delete

void delete(IGridElement child)
            throws ProblemException
Delete the specified child. Deletion in the terms of an means removing the specified element from the list of children and calling the element's dispose method.

Parameters:
child - The element to be deleted.
Throws:
ProblemException - If a problem occurs during the deletion.
See Also:
IGridElement.dispose()

deleteAll

void deleteAll()
               throws ProblemException
Delete all children from this container. Subsequent model notifications are cached and delivered in one bunch.

Throws:
ProblemException - If a problem occurs during the deletion.
See Also:
delete(IGridElement)

findChild

IGridElement findChild(java.lang.String name)
Search for a child with the specified name and return it. Returns null if no such element was found.

Parameters:
name - The name of the element to be searched for.
Returns:
The element with the specified name or null.

findChildWithResource

IGridElement findChildWithResource(java.lang.String resourceName)
Search for a child that has an IResource with the specified name. If the child is not virtual this method is equivalent to findChild(String).

Parameters:
resourceName - The name of the corresponding resource of the child.
Returns:
The child containing a corresponding resource with the specified name or null.

getChildCount

int getChildCount()
Get the number of children currently contained in this container.

Returns:
The number of children in this container.

getChildren

IGridElement[] getChildren(IProgressMonitor monitor)
                           throws ProblemException
Get the children that are currently contained in this container.

Parameters:
monitor - A progress monitor that is used to indicate progress for lazy containers. May be null.
Returns:
This container's children.
Throws:
ProblemException - If this is a lazy container it may be possible that an exception occurs while the children are fetched.

hasChildren

boolean hasChildren()
Determine if this container contains any children.

Returns:
True if this container is not empty and contains at least one child.

isDirty

boolean isDirty()
Returns if this container is dirty. This has no meaning if this is not a lazy container. For lazy containers it means that the list of children will be reloaded the next time when getChildren(IProgressMonitor monitor) is called. To avoid confusions non-lazy containers should always return true here.

Returns:
True if the container is dirty. Does not have a meaning for non-lazy containers.

isLazy

boolean isLazy()
Determines if this container is using a lazy loading mechanism to manage its children. In that case the children are not loaded when the container is constructed but when the getChildren(IProgressMonitor monitor) methode is called the first time. On subsequent calls of getChildren(IProgressMonitor monitor) the formerly loaded children are returned unless the setDirty() method was called. In that case a call to getChildren(IProgressMonitor monitor) will cause a reload of this containers children. Lazy containers always have to return true if they are asked if they contain any children with hasChildren().

Returns:
True if this container uses lazy loading.

refresh

void refresh(IProgressMonitor monitor)
             throws ProblemException
Refresh the content of this container. This method re-fetches the children of this container even if it is a non-lazy container.

Parameters:
monitor - A progress monitor used to give the caller feedback about the progress of the operation.
Throws:
ProblemException - If a problem occurs during the refresh operation.

setDirty

void setDirty()
Mark this container as dirty. A dirty and lazy container will reload its children when getChildren(IProgressMonitor monitor) is called. This methods does not affect non-lazy containers.


g-Eclipse
Release 1.0.0