org.mmbase.storage.util
Class StorageReader<SM extends StorageManager>

java.lang.Object
  extended by org.mmbase.util.xml.DocumentReader
      extended by org.mmbase.storage.util.StorageReader<SM>

public class StorageReader<SM extends StorageManager>
extends DocumentReader

Since:
MMBase-1.7
Version:
$Id: StorageReader.java 36284 2009-06-22 20:58:09Z michiel $
Author:
Pierre van Rooden
Javadoc:

Field Summary
static String DTD_STORAGE
          DTD resource filename of the most Database DTD
static String DTD_STORAGE_1_0
          DTD resource filename of the Database DTD version 1.0
protected  StorageManagerFactory factory
          The factory for which the reader reads the document.
static String PUBLIC_ID_STORAGE
          Public ID of the most recent Database DTD
static String PUBLIC_ID_STORAGE_1_0
          Public ID of the Storage DTD version 1.0
 
Fields inherited from class org.mmbase.util.xml.DocumentReader
document, DTD_ERROR, DTD_ERROR_1_0, FILENOTFOUND, PUBLIC_ID_ERROR, PUBLIC_ID_ERROR_1_0
 
Constructor Summary
StorageReader(StorageManagerFactory factory, InputSource source)
          Constructor.
 
Method Summary
 Map<String,Object> getAttributes()
          Reads all attributes from the reader and returns them as a map.
 Map<String,String> getCollationMappings()
           
 Map<String,String> getDisallowedFields()
          Returns all disallowed fields and their possible alternate values.
 List<Class<?>> getSearchQueryHandlerClasses()
          Attempt to obtain a list of SearchQueryHandler classes, using the classname as given in the configuration.
 Class<SM> getStorageManagerClass()
          Attempt to load a StorageManager class, using the classname as given in the configuration.
 List<String> getStoreBinaryAsFileObjects()
           
 List<TypeMapping> getTypeMappings()
          Returns all type mappings.
 
Methods inherited from class org.mmbase.util.xml.DocumentReader
appendChild, getAttribute, getChildElements, getChildElements, getChildElements, getChildElements, getDocument, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getElementAttributeValue, getElementAttributeValue, getElementByPath, getElementByPath, getElementName, getElementValue, getElementValue, getNodeTextValue, getNodeTextValue, getRootElement, getSystemId, hasAttribute, main, registerPublicIDs, setNodeTextValue, setPrefix, setSystemId, toDocument, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_ID_STORAGE_1_0

public static final String PUBLIC_ID_STORAGE_1_0
Public ID of the Storage DTD version 1.0

See Also:
Constant Field Values

DTD_STORAGE_1_0

public static final String DTD_STORAGE_1_0
DTD resource filename of the Database DTD version 1.0

See Also:
Constant Field Values

PUBLIC_ID_STORAGE

public static final String PUBLIC_ID_STORAGE
Public ID of the most recent Database DTD

See Also:
Constant Field Values

DTD_STORAGE

public static final String DTD_STORAGE
DTD resource filename of the most Database DTD

See Also:
Constant Field Values

factory

protected StorageManagerFactory factory
The factory for which the reader reads the document. The factory is used to verify whether the document is compatible, and is used to instantiate objects that depend on factory information (such as schemes)

Constructor Detail

StorageReader

public StorageReader(StorageManagerFactory factory,
                     InputSource source)
Constructor.

Parameters:
factory - the factory for which to read the storage configuration
source - to the xml document.
Since:
MMBase-1.7
Method Detail

getStorageManagerClass

public Class<SM> getStorageManagerClass()
                                                        throws StorageConfigurationException
Attempt to load a StorageManager class, using the classname as given in the configuration. The method verifies whether the instantiated class is of the correct version.

Returns:
the storage manager Class, or null if none was configured
Throws:
StorageConfigurationException - if the factory version did not match, or the class configured is invalid

getSearchQueryHandlerClasses

public List<Class<?>> getSearchQueryHandlerClasses()
                                            throws StorageConfigurationException
Attempt to obtain a list of SearchQueryHandler classes, using the classname as given in the configuration.

Returns:
A List of Class objects, each being the SearchQueryHandler class, or an empty list if none was configured
Throws:
StorageConfigurationException - if the class configured is invalid

getAttributes

public Map<String,Object> getAttributes()
Reads all attributes from the reader and returns them as a map. This include options, as well as the following special attributes:

Returns:
attributes as a map

getDisallowedFields

public Map<String,String> getDisallowedFields()
Returns all disallowed fields and their possible alternate values. The fields are returned as name-value pairs, where the disallowedfieldname is the key, and the alternate name is the value (null if no name is given).

Returns:
disallowed fields as a map

getTypeMappings

public List<TypeMapping> getTypeMappings()
Returns all type mappings. The mappings are returned in the order that they were given in the reader. Calling code should sort this list if they want to use TypoMapping fuzzy matching.

Returns:
a List of TypeMapping objects

getStoreBinaryAsFileObjects

public List<String> getStoreBinaryAsFileObjects()
Since:
MMBase-1.8.5

getCollationMappings

public Map<String,String> getCollationMappings()
Since:
MMBase-1.9.2


MMBase 2.0-SNAPSHOT - null