jpl.eda.archive.server
Class MetadataElementList

java.lang.Object
  extended byjpl.eda.archive.server.MetadataElementList

public class MetadataElementList
extends java.lang.Object

This class builds a list of metadata element name/value pairs. Once the list is complete the class will update the associated product metadata table with the value information. Only non-core elements are allowed to be updated.

Version:
$Revision: 1.4 $
Author:
D. Crichton, S. Hardman

Constructor Summary
MetadataElementList(jpl.eda.util.JDBC_DB db, Dataset dataset, int productId)
          Constructor given a database connection, dataset information and a product indentifier.
 
Method Summary
 void addElement(java.lang.String name, java.lang.String value)
          Add a metadata element name/value pair to the list.
 void addElements(java.util.HashMap map)
          Add the metadata element name/value pairs contained in the given map to the list.
 void addToDatabase()
          Add the metadata element values to the associated product metadata table.
 int getCount()
          Get the number of metadata element name/value pairs in the list.
 java.lang.String getName(int index)
          Get the name of the metadata element.
 java.lang.String getValue(int index)
          Get the value associated with the metadata element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataElementList

public MetadataElementList(jpl.eda.util.JDBC_DB db,
                           Dataset dataset,
                           int productId)
Constructor given a database connection, dataset information and a product indentifier.

Parameters:
db - The database connection.
dataset - The dataset information.
productId - The product identifier.
Method Detail

addElement

public void addElement(java.lang.String name,
                       java.lang.String value)
Add a metadata element name/value pair to the list. Only valid non-core elements for the current dataset will be added to the list.

Parameters:
name - The name of the data element.
value - The value associated with the data element.

addElements

public void addElements(java.util.HashMap map)
Add the metadata element name/value pairs contained in the given map to the list. The keys and values in the map must be String objects. Only valid non-core elements for the current dataset will be added to the list.

Parameters:
map - A hash map of element/value pairs.

getCount

public int getCount()
Get the number of metadata element name/value pairs in the list. This ought to be called size to match the rest of Java, but instead it matches the rest of OODT.

Returns:
The number of name/value pairs.

getName

public java.lang.String getName(int index)
Get the name of the metadata element.

Parameters:
index - The index of the metadata element representing its location in the array.
Returns:
The name or null if the index is out of bounds.

getValue

public java.lang.String getValue(int index)
Get the value associated with the metadata element.

Parameters:
index - The index of the metadata element representing its location in the array.
Returns:
The value or null if the index is out of bounds.

addToDatabase

public void addToDatabase()
                   throws MetadataElementListException
Add the metadata element values to the associated product metadata table.

Throws:
MetadataElementListException - If an error occurs accessing the database.


Copyright © 1999-2005 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.