edu.uky.rch.ept.data
Interface IDTDAccessMethods

All Known Subinterfaces:
IDataAccessMethods, IDataSourceDriver
All Known Implementing Classes:
DataFactory, DataSourceDriver, Project, Repository

public interface IDTDAccessMethods

This interface defines all the DTD access methods. All the methods throw the following exceptions:

DTD Identifiers are of the form: 'root of project' + IDataConstants.SEP_MAJOR + 'ID'

For example: file:///home/ept/BEOWULF/cotlib.damage where "file:///home/ept/BEOWULF" is the root of the project and "cotlib.damage" is the specific identifier of the DTD.

Author:
Sandeep Bodapati

Method Summary
 String getDTD(String ID)
          Retrieves the specified DTD
 boolean storeDTD(String ID, String content, boolean force)
          Creates a new DTD resource with the given content.
 

Method Detail

getDTD

public String getDTD(String ID)
              throws MalformedAddressException,
                     ResourceNotFoundException,
                     IOException
Retrieves the specified DTD

Parameters:
ID - identifier of the DTD
Returns:
a String object containing the DTD contents from the resource
Throws:
ResourceNotFoundException - if the resource doesnt exist
MalformedAddressException
IOException

storeDTD

public boolean storeDTD(String ID,
                        String content,
                        boolean force)
                 throws MalformedAddressException,
                        IOException
Creates a new DTD resource with the given content. All DTDs are to be stored in a collection named 'DTDs' which should be in the root of the project structure. For example is the ID is 'cotlib.damage', then the corresponding resource should be created at and named as in "DTDs/cotlib.damage.dtd" from the project's root.

Parameters:
ID - the identifier for the DTD
content - DTD content
force - if true, then the resource is overwritten if it already exists
Returns:
true if the resource did not exist and was created successfully, false otherwise
Throws:
MalformedAddressException
IOException