uk.org.ogsadai.client.toolkit.activity
Class Composite

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Composite
Direct Known Subclasses:
Flow, Sequence

public abstract class Composite
extends RequestComponent

An abstract class that maintains an ordered list of activities. It is the building block of complex requests where activities are to be explicitly executed in sequence or parallel.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.util.List mChildren
          List of child components of this composite.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
Composite()
          Constructs an empty composite component.
Composite(RequestComponent[] components)
          Constructs a composite from an array of request components.
 
Method Summary
 void addChild(RequestComponent child)
          Adds a RequestComponent, which can be an activity or a flow or sequence component, to this composite.
protected  void addOutputs(java.util.Map allOutputs)
          Add the outputs of each activity in the composite to the given map.
protected  RequestComponent getChild(int index)
          Returns the request component at the specified index.
protected  int getSize()
          Returns the number of direct children of this composite component.
protected  void insertChild(int index, RequestComponent child)
          Inserts a request component into the composite.
protected  RequestComponent removeChild(int index)
          Removes the request component at the specified index from the composite.
protected  boolean removeChild(RequestComponent child)
          Removes the specified request component from the list of children.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
generateXML, getDataResourceID, getDataService, getName, getSession, setDataResourceID, setDataService, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mChildren

private java.util.List mChildren
List of child components of this composite.

Constructor Detail

Composite

public Composite()
Constructs an empty composite component.


Composite

public Composite(RequestComponent[] components)
Constructs a composite from an array of request components.

Parameters:
components - Request components.
Method Detail

addChild

public void addChild(RequestComponent child)
Adds a RequestComponent, which can be an activity or a flow or sequence component, to this composite.

Parameters:
child - Request component

insertChild

protected void insertChild(int index,
                           RequestComponent child)
Inserts a request component into the composite.

Parameters:
index - Insertion position of the new child component.
child - Request component to insert.

removeChild

protected RequestComponent removeChild(int index)
Removes the request component at the specified index from the composite.

Parameters:
index - Position of component to be removed.
Returns:
the removed request component.

removeChild

protected boolean removeChild(RequestComponent child)
Removes the specified request component from the list of children.

Parameters:
child - Request component to remove
Returns:
true if the removal was successful, false otherwise.

getChild

protected RequestComponent getChild(int index)
Returns the request component at the specified index.

Parameters:
index - Position of the request component.
Returns:
the request component.

getSize

protected int getSize()
Returns the number of direct children of this composite component.

Returns:
number of children

addOutputs

protected void addOutputs(java.util.Map allOutputs)
Add the outputs of each activity in the composite to the given map. The map is assumed to map java.lang.String to uk.org.ogsadai.client.toolkit.activity.ActivityOutput.

Specified by:
addOutputs in class RequestComponent
Parameters:
allOutputs - Map from strings to activity outputs.