org.apache.oodt.cas.filemgr.validation
Class XMLValidationLayer

java.lang.Object
  extended by org.apache.oodt.cas.filemgr.validation.XMLValidationLayer
All Implemented Interfaces:
ValidationLayer

public class XMLValidationLayer
extends Object
implements ValidationLayer

Version:
$Revision: 13181 $

An XML ValidationLayer based on two xml files, elements.xml, and product-type-element-map.xml.

Author:
mattmann, bfoster

Constructor Summary
XMLValidationLayer(List<String> uris)
           
 
Method Summary
 void addElement(Element element)
           Adds the Element to the ValidationLayer.
 void addElementToProductType(ProductType type, Element element)
           Adds the specified element to the ProductType specified by its productTypeId.
 Element getElementById(String elementId)
          Gets an element by its String identifier.
 Element getElementByName(String elementName)
          Gets an element by its String name.
 List<Element> getElements()
           
 List<Element> getElements(ProductType type)
           Returns a List of Elements corresponding to the given ProductType.
 void modifyElement(Element element)
           Modifies an existing Element in the ValidationLayer.
 void removeElement(Element element)
           Removes a metadata Element from the ValidationLayer.
 void removeElementFromProductType(ProductType type, Element element)
           Removes a metadata Element from the specified productTypeId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLValidationLayer

public XMLValidationLayer(List<String> uris)
Method Detail

addElement

public void addElement(Element element)
                throws ValidationLayerException
Description copied from interface: ValidationLayer

Adds the Element to the ValidationLayer.

Specified by:
addElement in interface ValidationLayer
Parameters:
element - The element to add.
Throws:
ValidationLayerException - If any error occurs during the add.

modifyElement

public void modifyElement(Element element)
                   throws ValidationLayerException
Description copied from interface: ValidationLayer

Modifies an existing Element in the ValidationLayer.

Specified by:
modifyElement in interface ValidationLayer
Parameters:
element - The new Element data to update.
Throws:
ValidationLayerException - If any error occurs.

removeElement

public void removeElement(Element element)
                   throws ValidationLayerException
Description copied from interface: ValidationLayer

Removes a metadata Element from the ValidationLayer.

Specified by:
removeElement in interface ValidationLayer
Parameters:
element - The element to remove.
Throws:
ValidationLayerException - If any error occurs.

addElementToProductType

public void addElementToProductType(ProductType type,
                                    Element element)
                             throws ValidationLayerException
Description copied from interface: ValidationLayer

Adds the specified element to the ProductType specified by its productTypeId.

Specified by:
addElementToProductType in interface ValidationLayer
Parameters:
type - The ProductType to associate the metadata Element with.
element - The Element to associate with the ProductType.
Throws:
ValidationLayerException - If any error occurs.

removeElementFromProductType

public void removeElementFromProductType(ProductType type,
                                         Element element)
                                  throws ValidationLayerException
Description copied from interface: ValidationLayer

Removes a metadata Element from the specified productTypeId.

Specified by:
removeElementFromProductType in interface ValidationLayer
Parameters:
type - The ProductType to remove the association of the specified element with.
element - The element whose association will be removed from the specified ProductType.
Throws:
ValidationLayerException - If any error occurs.

getElements

public List<Element> getElements(ProductType type)
                          throws ValidationLayerException
Description copied from interface: ValidationLayer

Returns a List of Elements corresponding to the given ProductType.

Specified by:
getElements in interface ValidationLayer
Parameters:
type - The product type to retrieve the metadata Elements for.
Returns:
A List of Elements corresponding to the given ProductType.
Throws:
ValidationLayerException - If any error occurs.

getElements

public List<Element> getElements()
                          throws ValidationLayerException
Specified by:
getElements in interface ValidationLayer
Returns:
A List of all the metadata Elements in the ValidationLayer.
Throws:
ValidationLayerException - If any error occurs.

getElementById

public Element getElementById(String elementId)
                       throws ValidationLayerException
Description copied from interface: ValidationLayer
Gets an element by its String identifier.

Specified by:
getElementById in interface ValidationLayer
Parameters:
elementId - The String identifier of the Element to get.
Returns:
An Element by its String identifier.
Throws:
ValidationLayerException - If any error occurs.

getElementByName

public Element getElementByName(String elementName)
                         throws ValidationLayerException
Description copied from interface: ValidationLayer
Gets an element by its String name.

Specified by:
getElementByName in interface ValidationLayer
Parameters:
elementName - The String name of the Element to get.
Returns:
An Element by its String name.
Throws:
ValidationLayerException - If any error occurs.


Copyright © 1999-2011 Apache OODT. All Rights Reserved.