org.mycore.backend.hibernate
Class MCRHIBCStore

java.lang.Object
  extended by org.mycore.datamodel.ifs.MCRContentStore
      extended by org.mycore.backend.hibernate.MCRHIBCStore

public class MCRHIBCStore
extends MCRContentStore

This class implements the MCRContentStore interface.


Field Summary
(package private) static Logger logger
           
 
Fields inherited from class org.mycore.datamodel.ifs.MCRContentStore
formatter, lastTimestamp, prefix, slotDirDepth, storeID
 
Constructor Summary
MCRHIBCStore()
           
 
Method Summary
protected  void doDeleteContent(String ID)
          Deletes the content of an MCRFile object that is stored under the given Storage ID in this store instance.
protected  InputStream doRetrieveContent(MCRFileReader file)
          Retrieves the content of an MCRFile.
protected  void doRetrieveContent(MCRFileReader file, OutputStream target)
          Retrieves the content of an MCRFile to an OutputStream.
protected  String doStoreContent(MCRFileReader file, MCRContentInputStream source)
          Stores the content of an MCRFile by reading from an MCRContentInputStream.
 void init(String storeID)
          Initializes the store and sets its unique store ID.
 
Methods inherited from class org.mycore.datamodel.ifs.MCRContentStore
buildNextID, buildNextTimestamp, buildSlotPath, deleteContent, getID, retrieveContent, retrieveContent, storeContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static Logger logger
Constructor Detail

MCRHIBCStore

public MCRHIBCStore()
Method Detail

init

public void init(String storeID)
Description copied from class: MCRContentStore
Initializes the store and sets its unique store ID. MCRFiles must remember this ID to indentify the store that holds their file content. The store ID is set by MCRContentStoreFactory when a new store instance is built. Subclasses should override this method.

Overrides:
init in class MCRContentStore
Parameters:
storeID - the non-null unique store ID for this store instance

doStoreContent

protected String doStoreContent(MCRFileReader file,
                                MCRContentInputStream source)
                         throws Exception
Description copied from class: MCRContentStore
Stores the content of an MCRFile by reading from an MCRContentInputStream. Returns a StorageID to indentify the place where the content was stored.

Specified by:
doStoreContent in class MCRContentStore
Parameters:
file - the MCRFile thats content is to be stored
source - the ContentInputStream where the file content is read from
Returns:
an ID that indentifies the place where the content was stored
Throws:
Exception

doDeleteContent

protected void doDeleteContent(String ID)
                        throws Exception
Description copied from class: MCRContentStore
Deletes the content of an MCRFile object that is stored under the given Storage ID in this store instance.

Specified by:
doDeleteContent in class MCRContentStore
Parameters:
ID - the storage ID of the MCRFile object
Throws:
Exception

doRetrieveContent

protected void doRetrieveContent(MCRFileReader file,
                                 OutputStream target)
                          throws Exception
Description copied from class: MCRContentStore
Retrieves the content of an MCRFile to an OutputStream. Uses the StorageID to indentify the place where the file content was stored in this store instance.

Specified by:
doRetrieveContent in class MCRContentStore
Parameters:
file - the MCRFile thats content should be retrieved
target - the OutputStream to write the file content to
Throws:
Exception

doRetrieveContent

protected InputStream doRetrieveContent(MCRFileReader file)
                                 throws Exception
Description copied from class: MCRContentStore
Retrieves the content of an MCRFile. Uses the StorageID to indentify the place where the file content was stored in this store instance.

Specified by:
doRetrieveContent in class MCRContentStore
Parameters:
file - the MCRFile thats content should be retrieved
Throws:
Exception