|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.storage.StorageManagerFactory
This class contains functionality for retrieving StorageManager instances, which give access to the storage device.
It also provides functionality for setting and retrieving configuration data.
This is an abstract class. You cannot instantiate it. Use the static newInstance() or newInstance(MMBase)
methods to obtain a factory class.
| Field Summary | |
protected java.util.Map |
attributes
The map with configuration data |
protected ChangeManager |
changeManager
The ChangeManager object, used to register/broadcast changes to a node or set of nodes. |
protected java.util.SortedMap |
disallowedFields
The map with disallowed fieldnames and (if given) alternates |
protected CharTransformer |
getSurrogator
|
protected MMBase |
mmbase
A reference to the MMBase module |
protected SearchQueryHandler |
queryHandler
The query handler to use with this factory. |
protected java.util.List |
queryHandlerClasses
The query handler classes. |
protected CharTransformer |
setSurrogator
|
protected java.lang.Class |
storageManagerClass
The class used to instantiate storage managers. |
protected java.util.List |
typeMappings
The list with type mappings |
| Constructor Summary | |
StorageManagerFactory()
|
|
| Method Summary | |
java.lang.Object |
getAttribute(java.lang.Object key)
Obtain an attribute from this factory. |
java.util.Map |
getAttributes()
Retrieve a map of attributes for this factory. |
java.lang.String |
getCatalog()
Returns the name of the catalog used by this storage ( null if no catalog is used). |
ChangeManager |
getChangeManager()
Returns the ChangeManager utility instance, used to register and broadcast changes to nodes in the storage layer. |
java.util.Map |
getDisallowedFields()
Returns a map of disallowed field names and their possible alternate values. |
StorageReader |
getDocumentReader()
Locates and opens the storage configuration document, if available. |
CharTransformer |
getGetSurrogator()
Returns a filter which can be used to filter strings taken from storage or null if none defined. |
MMBase |
getMMBase()
Return the MMBase module for which the factory was instantiated |
Scheme |
getScheme(java.lang.Object key)
Obtain a scheme from this factory. |
Scheme |
getScheme(java.lang.Object key,
java.lang.String defaultPattern)
Obtain a scheme from this factory. |
SearchQueryHandler |
getSearchQueryHandler()
Obtains a SearchQueryHandler from the factory. |
CharTransformer |
getSetSurrogator()
Returns a filter which can be used to filter strings which are to be set into storage or null if none defined. |
java.lang.Object |
getStorageIdentifier()
Obtains the identifier for the basic storage element. |
java.lang.Object |
getStorageIdentifier(java.lang.Object mmobject)
Obtains a identifier for an MMBase object. |
StorageManager |
getStorageManager()
Obtains a StorageManager from the factory. |
java.util.List |
getTypeMappings()
Returns a sorted list of type mappings for this storage. |
abstract double |
getVersion()
Returns the version of this factory implementation. |
boolean |
hasOption(java.lang.Object key)
Check whether an option was set. |
protected void |
init(MMBase mmbase)
Initialize the StorageManagerFactory. |
protected abstract java.lang.Object |
instantiateBasicHandler(java.lang.Class handlerClass)
Instantiate a basic handler object using the specified class. |
protected abstract java.lang.Object |
instantiateChainedHandler(java.lang.Class handlerClass,
java.lang.Object previousHandler)
Instantiate a chained handler object using the specified class. |
protected abstract SearchQueryHandler |
instantiateQueryHandler(java.lang.Object data)
Instantiate a SearchQueryHandler object using the specified object. |
protected void |
load()
Opens and reads the storage configuration document. |
static StorageManagerFactory |
newInstance()
Obtain the storage manager factory belonging to the default MMBase module. |
static StorageManagerFactory |
newInstance(MMBase mmbase)
Obtain the StorageManagerFactory belonging to the indicated MMBase module. |
void |
setAttribute(java.lang.Object key,
java.lang.Object value)
Set an attribute of this factory. |
void |
setAttributes(java.util.Map attributes)
Add a map of attributes for this factory. |
protected void |
setDisallowedFields(java.util.Map disallowedFields)
Sets the map of disallowed Fields. |
void |
setOption(java.lang.Object key,
boolean value)
Set an option to true or false. |
void |
setScheme(java.lang.Object key,
java.lang.String pattern)
Set a scheme of this factory, using a string pattern to base the Scheme on. |
abstract boolean |
supportsTransactions()
Returns whether transactions, and specifically rollback, is supported in the storage layer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected MMBase mmbase
protected java.lang.Class storageManagerClass
protected java.util.Map attributes
protected java.util.List typeMappings
protected ChangeManager changeManager
protected java.util.SortedMap disallowedFields
protected SearchQueryHandler queryHandler
protected java.util.List queryHandlerClasses
protected CharTransformer setSurrogator
getSetSurrogator()protected CharTransformer getSurrogator
getGetSurrogator()| Constructor Detail |
public StorageManagerFactory()
| Method Detail |
public static StorageManagerFactory newInstance(MMBase mmbase)
throws StorageException
mmbase - The MMBase module for which to retrieve the storagefactory
StorageException - if the StorageManagerFactory class cannot be located, accessed, or instantiated,
or when something went wrong during configuration of the factory
public static StorageManagerFactory newInstance()
throws StorageException
StorageException - if the StorageManagerFactory class cannot be located, accessed, or instantiated,
or when something went wrong during configuration of the factory
protected final void init(MMBase mmbase)
throws StorageError
newInstance() and newInstance(MMBase).
mmbase - the MMBase instance to which this factory belongs
StorageError - when something went wrong during configuration of the factory, or when the storage cannot be accessedpublic MMBase getMMBase()
protected abstract java.lang.Object instantiateBasicHandler(java.lang.Class handlerClass)
handlerClass - the class to instantuate teh object with
protected abstract java.lang.Object instantiateChainedHandler(java.lang.Class handlerClass,
java.lang.Object previousHandler)
handlerClass - the class to instantuate teh object withpreviousHandler - a handler thatw a sinstantiated previously.
this handler should be passed to the new handler class during or
after constrcution, so the ne whandler can 'chain' any events it cannot
handle to this class.
protected abstract SearchQueryHandler instantiateQueryHandler(java.lang.Object data)
protected void load()
throws StorageException
StorageException - if the storage could not be accessed or necessary configuration data is missing or invalid
public StorageManager getStorageManager()
throws StorageException
StorageException - when the storagemanager cannot be created
public SearchQueryHandler getSearchQueryHandler()
throws StorageException
StorageException - when the handler cannot be created
public StorageReader getDocumentReader()
throws StorageException
StorageException - if something went wrong while obtaining the document readerpublic java.util.Map getAttributes()
public void setAttributes(java.util.Map attributes)
attributes - the map of attributes to addpublic java.lang.Object getAttribute(java.lang.Object key)
key - the key of the attribute
public void setAttribute(java.lang.Object key,
java.lang.Object value)
null value.
key - the key of the attributevalue - the value of the attributepublic Scheme getScheme(java.lang.Object key)
key - the key of the attribute
public Scheme getScheme(java.lang.Object key,
java.lang.String defaultPattern)
key - the key of the attributedefaultPattern - the pattern to use for the default scheme, null if there is no default
null if there is no scheme
public void setScheme(java.lang.Object key,
java.lang.String pattern)
key - the key of the schemepattern - the pattern to use for the schemepublic boolean hasOption(java.lang.Object key)
key - the key of the option
true if the option was set
public void setOption(java.lang.Object key,
boolean value)
key - the key of the optionvalue - the value of the option (true or false)public java.util.List getTypeMappings()
public java.util.Map getDisallowedFields()
protected void setDisallowedFields(java.util.Map disallowedFields)
public java.lang.Object getStorageIdentifier()
throws StorageException
StorageException - if the object cannot be given a valid identifier
public java.lang.Object getStorageIdentifier(java.lang.Object mmobject)
throws StorageException
mmobject - the MMBase objecty
StorageException - if the object cannot be given a valid identifierStorablepublic ChangeManager getChangeManager()
public java.lang.String getCatalog()
null if no catalog is used).
public abstract double getVersion()
public abstract boolean supportsTransactions()
true if trasnactions are supportedpublic CharTransformer getGetSurrogator()
null if none defined.
public CharTransformer getSetSurrogator()
null if none defined.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||