edu.indiana.dde.mylead.common
Class MyLeadCollData

java.lang.Object
  extended byedu.indiana.dde.mylead.common.MyLeadData
      extended byedu.indiana.dde.mylead.common.MyLeadCollData
Direct Known Subclasses:
MyLeadExpData, MyLeadProjData

public class MyLeadCollData
extends MyLeadData

The MyLeadCollData class is an extension of the abstract MyLeadData class and is used to define a collection to be added to a myLEAD metadata catalog. This class is used for adding collections and as the base class for any higher levels in the hierarchy as define in the lead_type_definition table. If an instance of this class is passed to the LeadClient create method without setting the leadType, then it will be treated as a collection. The types of collections for the myLEAD hierarchy as defined in the lead_type_definition table are also defined in the LeadConstants class.

See Also:
LeadConstants

Constructor Summary
MyLeadCollData()
          The default constructor for MyLeadCollData first calls the constructor for the MyLeadData class it inherits from and then sets a blank string as the default for the leadType, which will be treated as a collection by default when added to a myLEAD metadata catalog.
 
Method Summary
 void addCollection(MyLeadCollData leadColl)
          This method allows a collection to be added as a member of this collection.
 void addFile(MyLeadFileData leadFile)
          This method allows an instance of MyLeadFileData to be added as a member of this collection.
 java.util.Date getDate()
          This method returns the logical date for the collection.
 java.lang.String getType()
          This method returns the lead type as previously set using the setType method.
 void setDate(java.util.Date myDate)
          This method allows a logical date to be set for the collection seperate from the date the collection is added to the catalog.
 void setType(java.lang.String myType)
          This method allows the type of the collection in the myLEAD hierarchy to be set.
 java.lang.String wrapParameters()
          Wraps up the collection parameters in a string that can then be used in an OGSA-DAI perform document to add the collection to the myLEAD metadata catalog.
 
Methods inherited from class edu.indiana.dde.mylead.common.MyLeadData
addAttribute, getDesc, getGUID, getName, setDesc, setGUID, setName, wrapData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadCollData

public MyLeadCollData()
The default constructor for MyLeadCollData first calls the constructor for the MyLeadData class it inherits from and then sets a blank string as the default for the leadType, which will be treated as a collection by default when added to a myLEAD metadata catalog. The constructor also creates the array lists used to store the files and collections included in this collection. The list for attributes is created in the constructor for the MyLeadData parent class.

Method Detail

setDate

public void setDate(java.util.Date myDate)
This method allows a logical date to be set for the collection seperate from the date the collection is added to the catalog. The date the collection is added to the catalog is automatically tracked as a seperate attribute of the collection.

Parameters:
myDate - logical Date for this collection.

getDate

public java.util.Date getDate()
This method returns the logical date for the collection. If the date has not previously been set, it will return the default null value for the logical date.

Returns:
Date containing the logical date for the collection, which could be null.

setType

public void setType(java.lang.String myType)
This method allows the type of the collection in the myLEAD hierarchy to be set. The string passed as a parameter must match one of the types other than FILE in the Type_name field of the lead_type_definition table or it will not validate when included in a call to the LeadClient's create method.
Generally this method would not be called by user code unless new levels are added in the lead_type_definition table. This method is called by classes that extend this class so that the level can be set, which by default is the collection level.

Parameters:
myType - String with a collection type which must match a type defined in the lead_type_definition table.

getType

public java.lang.String getType()
This method returns the lead type as previously set using the setType method. If the type has not been set, then the default empty string is returned.

Returns:
String with the type previously set or the default empty String.

addCollection

public void addCollection(MyLeadCollData leadColl)
This method allows a collection to be added as a member of this collection. When adding a collection to a collection, it must be at the same level or a lower level in the myLEAD hierarchy as defined in the lead_type_definition table. Even though a higher level would validate against the leadActivity schema, it would be rejected before being added to the myLEAD metadata catalog.
The collection being added should not be this collection - a collection cannot be added to itself.

Parameters:
leadColl - instance of this class added as a collection within this collection.

addFile

public void addFile(MyLeadFileData leadFile)
This method allows an instance of MyLeadFileData to be added as a member of this collection.

Parameters:
leadFile - instance of MyLeadFileData to be added as a member of this collection.

wrapParameters

public java.lang.String wrapParameters()
Wraps up the collection parameters in a string that can then be used in an OGSA-DAI perform document to add the collection to the myLEAD metadata catalog.

Overrides:
wrapParameters in class MyLeadData
Returns:
String containing the parameters for this collection.