org.mycore.datamodel.ifs
Class MCRSimpleContentStoreSelector

java.lang.Object
  extended by org.mycore.datamodel.ifs.MCRSimpleContentStoreSelector
All Implemented Interfaces:
MCRContentStoreSelector

public class MCRSimpleContentStoreSelector
extends Object
implements MCRContentStoreSelector

Decides which MCRContentStore implementation should be used to store the content of a given file, based on the content type of the file.

Version:
$Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
Author:
Frank Lützenkirchen, Thomas Scheffler (yagee)

Field Summary
protected  String defaultID
          the default content store to use if no other rule matches
protected  String[] storeIDs
          list of all storeIDs *
protected  Hashtable table
          store lookup table where keys are file content type IDs, values are content store IDs
 
Constructor Summary
MCRSimpleContentStoreSelector()
           
 
Method Summary
 String[] getAvailableStoreIDs()
          Returns the IDs of all ContentStores available to MyCoRe
 String selectStore(MCRFile file)
          Returns the ID of the file content store to be used to store the content of the given file.
 String selectStore(MCRFileContentType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultID

protected String defaultID
the default content store to use if no other rule matches


table

protected Hashtable table
store lookup table where keys are file content type IDs, values are content store IDs


storeIDs

protected String[] storeIDs
list of all storeIDs *

Constructor Detail

MCRSimpleContentStoreSelector

public MCRSimpleContentStoreSelector()
Method Detail

selectStore

public String selectStore(MCRFile file)
                   throws MCRException
Description copied from interface: MCRContentStoreSelector
Returns the ID of the file content store to be used to store the content of the given file. The store selector can make the decision based on the properties of the given file or based on system configuration.

Specified by:
selectStore in interface MCRContentStoreSelector
Throws:
MCRException

selectStore

public String selectStore(MCRFileContentType type)

getAvailableStoreIDs

public String[] getAvailableStoreIDs()
Description copied from interface: MCRContentStoreSelector
Returns the IDs of all ContentStores available to MyCoRe

Specified by:
getAvailableStoreIDs in interface MCRContentStoreSelector
Returns:
Array of StoreIDs