org.mycore.datamodel.common
Interface MCRXMLTableInterface

All Known Implementing Classes:
MCRHIBXMLStore, MCRObjectMetadataStoreIFS2

public interface MCRXMLTableInterface

This interface is designed to choose the Persistence for the XML tables.

Version:
$Revision: 15621 $ $Date: 2009-07-25 08:32:01 +0200 (Sat, 25 Jul 2009) $
Author:
Jens Kupferschmidt

Method Summary
 void create(String mcrid, byte[] xml, Date lastModified)
          The method create a new item in the datastore.
 void delete(String mcrid)
          The method remove a item for the MCRObjectID from the datastore.
 boolean exists(String mcrid)
          This method check that the MCRObjectID exist in this store.
 int getHighestStoredID()
          This method returns the highest stored ID number, or 0 if no object is stored for this type and project.
 void init(String type)
          The initializer for the class MCRSQLXMLStore.
 List<MCRObjectIDDate> listObjectDates(String type)
          lists objects of the specified type and their last modified date.
 InputStream retrieve(String mcrid)
          The method retrieve a dataset for the given MCRObjectID and returns the corresponding XML file as InputStream.
 List<String> retrieveAllIDs()
          The method return a Array list with all stored MCRObjectID's of the XML table.
 void update(String mcrid, byte[] xml, Date lastModified)
          The method update an item in the datastore.
 

Method Detail

init

void init(String type)
          throws MCRPersistenceException
The initializer for the class MCRSQLXMLStore. It reads the configuration and checks the table names and create the table if they does'n exist..

Parameters:
type - the type String of the MCRObjectID
Throws:
MCRPersistenceException - throws if the type is not correct

create

void create(String mcrid,
            byte[] xml,
            Date lastModified)
            throws MCRPersistenceException
The method create a new item in the datastore.

Parameters:
mcrid - a MCRObjectID
xml - a byte array with the XML file
Throws:
MCRPersistenceException - if the method arguments are not correct

delete

void delete(String mcrid)
            throws MCRPersistenceException
The method remove a item for the MCRObjectID from the datastore.

Parameters:
mcrid - a MCRObjectID
Throws:
MCRPersistenceException - if the method argument is not correct

update

void update(String mcrid,
            byte[] xml,
            Date lastModified)
            throws MCRPersistenceException
The method update an item in the datastore.

Parameters:
mcrid - a MCRObjectID
xml - a byte array with the XML file
Throws:
MCRPersistenceException - if the method arguments are not correct

retrieve

InputStream retrieve(String mcrid)
                     throws MCRPersistenceException
The method retrieve a dataset for the given MCRObjectID and returns the corresponding XML file as InputStream.

Parameters:
mcrid - a MCRObjectID
Throws:
MCRPersistenceException - if the method arguments are not correct

getHighestStoredID

int getHighestStoredID()
                       throws MCRPersistenceException
This method returns the highest stored ID number, or 0 if no object is stored for this type and project.

Returns:
the highest stored ID number as a String
Throws:
MCRPersistenceException - if a persistence problem is occured

exists

boolean exists(String mcrid)
This method check that the MCRObjectID exist in this store.

Parameters:
mcrid - a MCRObjectID
Returns:
true if the MCRObjectID exist, else return false

retrieveAllIDs

List<String> retrieveAllIDs()
The method return a Array list with all stored MCRObjectID's of the XML table.

Returns:
a ArrayList of MCRObjectID's

listObjectDates

List<MCRObjectIDDate> listObjectDates(String type)
lists objects of the specified type and their last modified date.

Parameters:
type - type of object
Returns: