org.mmbase.storage.util
Class StorageReader

java.lang.Object
  extended byorg.mmbase.util.xml.DocumentReader
      extended byorg.mmbase.storage.util.StorageReader

public class StorageReader
extends DocumentReader

Version:
$Id: StorageReader.java,v 1.5 2004/03/05 14:52:15 pierre Exp $
Author:
Pierre van Rooden

Field Summary
static java.lang.String DTD_STORAGE
          DTD resource filename of the most Database DTD
static java.lang.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 java.lang.String PUBLIC_ID_STORAGE
          Public ID of the most recent Database DTD
static java.lang.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, org.xml.sax.InputSource source)
          Constructor.
 
Method Summary
 java.util.Map getAttributes()
          Reads all attributes from the reader and returns them as a map.
 java.util.Map getDisallowedFields()
          Returns all disallowed fields and their possible alternate values.
 java.util.List getSearchQueryHandlerClasses()
          Attempt to obtain a list of SearchQueryHandler classes, using the classname as given in the configuration.
 java.lang.Class getStorageManagerClass()
          Attempt to load a StorageManager class, using the classname as given in the configuration.
 java.util.List getTypeMappings()
          Returns all type mappings.
static void registerPublicIDs()
          Register the Public Ids for DTDs used by StorageReader This method is called by XMLEntityResolver.
 
Methods inherited from class org.mmbase.util.xml.DocumentReader
getDocumentBuilder, getDocumentBuilder, getFileName, getNodeTextValue, 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 java.lang.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 java.lang.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 java.lang.String PUBLIC_ID_STORAGE
Public ID of the most recent Database DTD

See Also:
Constant Field Values

DTD_STORAGE

public static final java.lang.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,
                     org.xml.sax.InputSource source)
Constructor.

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

registerPublicIDs

public static void registerPublicIDs()
Register the Public Ids for DTDs used by StorageReader This method is called by XMLEntityResolver.


getStorageManagerClass

public java.lang.Class 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 java.util.List 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 java.util.Map 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 java.util.Map 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 java.util.List 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


MMBase build 1.7.1.20041002