org.mycore.datamodel.ifs2
Class MCRObjectMetadataStoreIFS2

java.lang.Object
  extended by org.mycore.datamodel.ifs2.MCRObjectMetadataStoreIFS2
All Implemented Interfaces:
MCRXMLTableInterface

public class MCRObjectMetadataStoreIFS2
extends Object
implements MCRXMLTableInterface

Stores XML metadata of MCRObject in IFS2


Nested Class Summary
(package private)  class MCRObjectMetadataStoreIFS2.MyMCRObjectIDDate
           
 
Constructor Summary
MCRObjectMetadataStoreIFS2()
           
 
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)
          Reads the configuration and initializes the store.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRObjectMetadataStoreIFS2

public MCRObjectMetadataStoreIFS2()
Method Detail

init

public void init(String type)
Reads the configuration and initializes the store. MCR.IFS2.Store.{type}.Class=org.mycore.datamodel.ifs2.MCRVersioningMetadataStore MCR.IFS2.Store.{type}.BaseDir={/path/to/store/directory/} MCR.IFS2.Store.{type}.SlotLayout=4-2-2 MCR.IFS2.Store.{type}.SVNRepositoryURL=file:///{where/the/svn/store/should/be/created/}

Specified by:
init in interface MCRXMLTableInterface
Parameters:
type - the MCRObjectID type

create

public void create(String mcrid,
                   byte[] xml,
                   Date lastModified)
Description copied from interface: MCRXMLTableInterface
The method create a new item in the datastore.

Specified by:
create in interface MCRXMLTableInterface
Parameters:
mcrid - a MCRObjectID
xml - a byte array with the XML file

delete

public void delete(String mcrid)
Description copied from interface: MCRXMLTableInterface
The method remove a item for the MCRObjectID from the datastore.

Specified by:
delete in interface MCRXMLTableInterface
Parameters:
mcrid - a MCRObjectID

update

public void update(String mcrid,
                   byte[] xml,
                   Date lastModified)
Description copied from interface: MCRXMLTableInterface
The method update an item in the datastore.

Specified by:
update in interface MCRXMLTableInterface
Parameters:
mcrid - a MCRObjectID
xml - a byte array with the XML file

retrieve

public InputStream retrieve(String mcrid)
Description copied from interface: MCRXMLTableInterface
The method retrieve a dataset for the given MCRObjectID and returns the corresponding XML file as InputStream.

Specified by:
retrieve in interface MCRXMLTableInterface
Parameters:
mcrid - a MCRObjectID

getHighestStoredID

public int getHighestStoredID()
Description copied from interface: MCRXMLTableInterface
This method returns the highest stored ID number, or 0 if no object is stored for this type and project.

Specified by:
getHighestStoredID in interface MCRXMLTableInterface
Returns:
the highest stored ID number as a String

exists

public boolean exists(String mcrid)
Description copied from interface: MCRXMLTableInterface
This method check that the MCRObjectID exist in this store.

Specified by:
exists in interface MCRXMLTableInterface
Parameters:
mcrid - a MCRObjectID
Returns:
true if the MCRObjectID exist, else return false

retrieveAllIDs

public List<String> retrieveAllIDs()
Description copied from interface: MCRXMLTableInterface
The method return a Array list with all stored MCRObjectID's of the XML table.

Specified by:
retrieveAllIDs in interface MCRXMLTableInterface
Returns:
a ArrayList of MCRObjectID's

listObjectDates

public List<MCRObjectIDDate> listObjectDates(String type)
Description copied from interface: MCRXMLTableInterface
lists objects of the specified type and their last modified date.

Specified by:
listObjectDates in interface MCRXMLTableInterface
Parameters:
type - type of object
Returns: