|
||||||||||
| 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 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 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 List |
queryHandlerClasses
The query handler classes. |
protected CharTransformer |
setSurrogator
|
protected Class |
storageManagerClass
The class used to instantiate storage managers. |
protected List |
typeMappings
The list with type mappings |
| Constructor Summary | |
StorageManagerFactory()
|
|
| Method Summary | |
Object |
getAttribute(Object key)
Obtain an attribute from this factory. |
Map |
getAttributes()
Retrieve a map of attributes for this factory. |
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. |
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(Object key)
Obtain a scheme from this factory. |
Scheme |
getScheme(Object key,
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. |
Object |
getStorageIdentifier()
Obtains the identifier for the basic storage element. |
Object |
getStorageIdentifier(Object mmobject)
Obtains a identifier for an MMBase object. |
StorageManager |
getStorageManager()
Obtains a StorageManager from the factory. |
int |
getTimeZoneOffset(long time)
Returns the offset which must be used in the database. |
List |
getTypeMappings()
Returns a sorted list of type mappings for this storage. |
abstract double |
getVersion()
Returns the version of this factory implementation. |
boolean |
hasOption(Object key)
Check whether an option was set. |
protected void |
init(MMBase mmbase)
Initialize the StorageManagerFactory. |
protected abstract Object |
instantiateBasicHandler(Class handlerClass)
Instantiate a basic handler object using the specified class. |
protected abstract Object |
instantiateChainedHandler(Class handlerClass,
Object previousHandler)
Instantiate a chained handler object using the specified class. |
protected abstract SearchQueryHandler |
instantiateQueryHandler(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(Object key,
Object value)
Set an attribute of this factory. |
void |
setAttributes(Map attributes)
Add a map of attributes for this factory. |
protected void |
setDisallowedFields(Map disallowedFields)
Sets the map of disallowed Fields. |
void |
setOption(Object key,
boolean value)
Set an option to true or false. |
void |
setScheme(Object key,
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 Class storageManagerClass
protected Map attributes
protected List typeMappings
protected ChangeManager changeManager
protected final SortedMap disallowedFields
protected SearchQueryHandler queryHandler
protected 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 Object instantiateBasicHandler(Class handlerClass)
handlerClass - the class to instantuate teh object with
protected abstract Object instantiateChainedHandler(Class handlerClass,
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(Object data)
data - the object to instantuate a SearchQueryHandler object with
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 Map getAttributes()
public void setAttributes(Map attributes)
attributes - the map of attributes to addpublic Object getAttribute(Object key)
key - the key of the attribute
public void setAttribute(Object key,
Object value)
null value.
key - the key of the attributevalue - the value of the attributepublic Scheme getScheme(Object key)
key - the key of the attribute
public Scheme getScheme(Object key,
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(Object key,
String pattern)
key - the key of the schemepattern - the pattern to use for the schemepublic boolean hasOption(Object key)
key - the key of the option
true if the option was set
public void setOption(Object key,
boolean value)
key - the key of the optionvalue - the value of the option (true or false)public List getTypeMappings()
public Map getDisallowedFields()
protected void setDisallowedFields(Map disallowedFields)
public Object getStorageIdentifier()
throws StorageException
StorageException - if the object cannot be given a valid identifier
public Object getStorageIdentifier(Object mmobject)
throws StorageException
mmobject - the MMBase objecty
StorageException - if the object cannot be given a valid identifierStorablepublic ChangeManager getChangeManager()
public 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.
public int getTimeZoneOffset(long time)
time - The time at which it is evaluated (summer time issues)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||