edu.indiana.dde.mylead.common
Class MyLeadAttribute

java.lang.Object
  extended by edu.indiana.dde.mylead.common.MyLeadAttribute

public class MyLeadAttribute
extends java.lang.Object

This class is used to hold the criteria for an attribute in a myLEAD query. This would be included in a file or collection when defining a myLEAD query.


Constructor Summary
MyLeadAttribute()
          Default constructor for an instance of MyLeadAttribute.
MyLeadAttribute(java.lang.String attrName)
          This version of the MyLeadAttribute constructor takes a String as a parameter which is the name used for the attribute when included in the query.
MyLeadAttribute(java.lang.String attrName, java.lang.String attrSrc)
          This version of the MyLeadAttribute constructor takes both name and source parameters.
 
Method Summary
 void addAttribute(MyLeadAttribute leadAttribute)
          This method is used to add an instance of this class as a subattribute.
 void addElement(MyLeadElement leadElement)
          This method is used to add an instance of MyLeadElement as an element of the attribute in a query.
 java.lang.String getName()
          This method returns the attribute name currently set for this attribute.
 java.lang.String getSource()
          This method returns the attribute source currently set for this attribute.
 void setName(java.lang.String attrName)
          Sets the attribute name for an existing instance of MyLeadAttribute.
 void setSource(java.lang.String attrSrc)
          Sets the attribute source for an existing instance of MyLeadAttribute.
 java.lang.String wrapAttribute()
          This routine wraps up an attribute and returns a string that can then be used in a myLEAD query definition to create an OGSA-DAI perform document for the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadAttribute

public MyLeadAttribute()
Default constructor for an instance of MyLeadAttribute. This method calls the private initialize method with an empty string to be used as the attribute name. The name of the attribute must be set for it to be used in a myLEAD query.


MyLeadAttribute

public MyLeadAttribute(java.lang.String attrName)
This version of the MyLeadAttribute constructor takes a String as a parameter which is the name used for the attribute when included in the query. The source is left blank and must still be set.

Parameters:
attrName - String with the name of the attribute.

MyLeadAttribute

public MyLeadAttribute(java.lang.String attrName,
                       java.lang.String attrSrc)
This version of the MyLeadAttribute constructor takes both name and source parameters. Both are needed to identify an attribute.

Parameters:
attrName - String with the name of the attribute.
attrSrc - String with the source of the attribute definition.
Method Detail

setName

public void setName(java.lang.String attrName)
Sets the attribute name for an existing instance of MyLeadAttribute. The string passed as the name can be a blank String.

Parameters:
attrName - String with the attribute name.

getName

public java.lang.String getName()
This method returns the attribute name currently set for this attribute.

Returns:
String with the attribute name, which could be a blank string.

setSource

public void setSource(java.lang.String attrSrc)
Sets the attribute source for an existing instance of MyLeadAttribute. The string passed as the source can be a blank String.

Parameters:
attrSrc - String with the attribute source.

getSource

public java.lang.String getSource()
This method returns the attribute source currently set for this attribute.

Returns:
String with the attribute source, which could be a blank string.

addAttribute

public void addAttribute(MyLeadAttribute leadAttribute)
This method is used to add an instance of this class as a subattribute. However, this instance of the MyLeadAttribute class should never be passed to it as its own subattribute. Any attribute added as a subattribute in a query must be defined as a subattribute of this attribute in the lead_attribute_definition table.

Parameters:
leadAttribute - Instance of this class that is a subattribute.

addElement

public void addElement(MyLeadElement leadElement)
This method is used to add an instance of MyLeadElement as an element of the attribute in a query. Any element added using this method must already be defined in the lead_element_definition table. If this is not a valid element for the attribute, it will be discarded as a condition of the query.

Parameters:
leadElement - The instance of MyLeadElement to be added as a query condition.

wrapAttribute

public java.lang.String wrapAttribute()
This routine wraps up an attribute and returns a string that can then be used in a myLEAD query definition to create an OGSA-DAI perform document for the query. Any sub attributes are nested.

Returns:
String that wraps the elements in this attribute and any sub-attributes.