|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.ifs.MCRContentStore
public abstract class MCRContentStore
Stores the content of MCRFiles in a persistent datastore. This can be a filesystem, IBM Content Manager, video streaming servers like IBM VideoCharger or Real Server, depending on the class that implements this interface. The MCRContentStore provides methods to store, delete and retrieve content. It uses a storage ID and the store ID to identify the place where the content of a file is stored.
| Field Summary | |
|---|---|
protected static DateFormat |
formatter
DateFormat used to construct new unique IDs based on timecode |
protected static String |
lastTimestamp
The last timestamp that was constructed |
protected String |
prefix
The prefix of all properties in mycore.properties for this store |
protected int |
slotDirDepth
The depth of slot subdirectories to build |
protected String |
storeID
The unique store ID for this MCRContentStore implementation |
| Constructor Summary | |
|---|---|
MCRContentStore()
Default constructor * |
|
| Method Summary | |
|---|---|
protected static String |
buildNextID(MCRFileReader file)
Constructs a new unique ID for storing content |
protected static String |
buildNextTimestamp()
Helper method for constructing a unique storage ID from a timestamp. |
protected String[] |
buildSlotPath()
Some content store implementations store the file's content in a hierarchical directory structure of the server's filesystem. |
void |
deleteContent(String storageID)
Deletes the content of an MCRFile object that is stored under the given Storage ID in this store instance. |
protected abstract void |
doDeleteContent(String storageID)
Deletes the content of an MCRFile object that is stored under the given Storage ID in this store instance. |
protected abstract InputStream |
doRetrieveContent(MCRFileReader file)
Retrieves the content of an MCRFile. |
protected abstract void |
doRetrieveContent(MCRFileReader file,
OutputStream target)
Deprecated. use doRetrieveContent(MCRFileReader file) instead |
protected abstract String |
doStoreContent(MCRFileReader file,
MCRContentInputStream source)
Stores the content of an MCRFile by reading from an MCRContentInputStream. |
String |
getID()
Returns the unique store ID that was set for this store instance |
void |
init(String storeID)
Initializes the store and sets its unique store ID. |
InputStream |
retrieveContent(MCRFileReader file)
Retrieves the content of an MCRFile as an InputStream. |
void |
retrieveContent(MCRFileReader file,
OutputStream target)
Deprecated. use doRetrieveContent(MCRFileReader file) instead |
String |
storeContent(MCRFileReader file,
MCRContentInputStream source)
Stores the content of an MCRFile by reading from an MCRContentInputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String storeID
protected String prefix
protected int slotDirDepth
protected static DateFormat formatter
protected static String lastTimestamp
| Constructor Detail |
|---|
public MCRContentStore()
| Method Detail |
|---|
public void init(String storeID)
storeID - the non-null unique store ID for this store instancepublic String getID()
public String storeContent(MCRFileReader file,
MCRContentInputStream source)
throws MCRPersistenceException
file - the MCRFile thats content is to be storedsource - the ContentInputStream where the file content is read from
MCRPersistenceException
protected abstract String doStoreContent(MCRFileReader file,
MCRContentInputStream source)
throws Exception
file - the MCRFile thats content is to be storedsource - the ContentInputStream where the file content is read from
Exception
public void deleteContent(String storageID)
throws MCRException
storageID - the storage ID of the MCRFile object
MCRException
protected abstract void doDeleteContent(String storageID)
throws Exception
storageID - the storage ID of the MCRFile object
Exception
public void retrieveContent(MCRFileReader file,
OutputStream target)
throws MCRException
file - the MCRFile thats content should be retrievedtarget - the OutputStream to write the file content to
MCRException
protected abstract void doRetrieveContent(MCRFileReader file,
OutputStream target)
throws Exception
file - the MCRFile thats content should be retrievedtarget - the OutputStream to write the file content to
Exception
protected abstract InputStream doRetrieveContent(MCRFileReader file)
throws Exception
file - the MCRFile thats content should be retrieved
Exception
public InputStream retrieveContent(MCRFileReader file)
throws MCRException
file - the MCRFile thats content should be retrieved
MCRExceptionprotected static String buildNextID(MCRFileReader file)
protected static String buildNextTimestamp()
protected String[] buildSlotPath()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||