edu.sdsc.grid.io
Class MetaDataGroup

java.lang.Object
  extended by edu.sdsc.grid.io.MetaDataGroup
All Implemented Interfaces:
java.lang.Comparable

public class MetaDataGroup
extends java.lang.Object
implements java.lang.Comparable

A "Meta data group" is a group of meta data fields. Each MetaDataGroup class includes documentation and introspection methods that describe the group as a whole, the list of fields in the group, a description for those fields, the data types for those fields, and the expected field values.

Each subclass has a constructor. None of the constructors are ever public. Leaf classes in the class tree have private constructors, while the rest are protected. The constructors are called by a static initializer method for each class and are strictly used to create a single object for the class that is passed to the MetaDataGroup parent class to register it in a master list. That object also should be saved by the child class and will be passed to constructors for condition and select objects (so that generic handlers of those objects can get back to the metadata group).

Each of the subclasses group together meta data for a specific purpose. All of the SRB meta data groups are subclassed off of SRBMetaData. The subclasses may add methods, but most will only implement the required methods.

Some meta groups are standard regardless of implementation. To handle standard metadata, we defined interfaces that are implemented by protocol-specific metadata groups. The GeneralMetaData interface contract is that the implementor supports metadata we might find for any file system, such as:

An implementation specific group, such as the general SRB metadata group must support these fields, but also may support further general metadata fields, such as:


Field Summary
protected  java.lang.String description
           
protected  java.util.HashMap fields
           
protected  java.lang.String groupName
           
 
Constructor Summary
MetaDataGroup(java.lang.String groupName, java.lang.String description)
          Construct a metadata group and register the group in a master list of groups maintained by the MetaDataSet class.
 
Method Summary
 void add(MetaDataField field)
          Load the group's fields.
 int compareTo(java.lang.Object obj)
           
 java.lang.String getDescription()
          This string may be displayed by a GUI.
 MetaDataField getField(java.lang.String fieldName)
          Returns an object describing this field in the group.
 int getFieldCount()
          Returns the number of fields known by the group.
 MetaDataField[] getFields()
          Returns all the fields in the group.
 MetaDataField[] getFields(boolean sort)
           
 java.lang.String getName()
          Returns a short name string for this metadata group.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fields

protected java.util.HashMap fields

groupName

protected java.lang.String groupName

description

protected java.lang.String description
Constructor Detail

MetaDataGroup

public MetaDataGroup(java.lang.String groupName,
                     java.lang.String description)
Construct a metadata group and register the group in a master list of groups maintained by the MetaDataSet class.

Method Detail

add

public void add(MetaDataField field)
Load the group's fields.


getName

public java.lang.String getName()
Returns a short name string for this metadata group.


getDescription

public java.lang.String getDescription()
This string may be displayed by a GUI. It has no embedded carriage returns, so the application is expected to insert line breaks to wrap the text appropriately for its way of displaying it.

Returns:
A description string of the meta data group.

getFieldCount

public int getFieldCount()
Returns the number of fields known by the group.


getField

public MetaDataField getField(java.lang.String fieldName)
Returns an object describing this field in the group.


getFields

public MetaDataField[] getFields()
Returns all the fields in the group.


getFields

public MetaDataField[] getFields(boolean sort)
Parameters:
sort - if true, sort alphabetically by name.
Returns:
all the fields in the group.
See Also:
MetaDataField.compareTo( Object )

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object