Java Doc for StorageManagerFactory.java in  » Database-ORM » MMBase » org » mmbase » storage » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.storage 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.storage.StorageManagerFactory

StorageManagerFactory
abstract public class StorageManagerFactory (Code)
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 StorageManagerFactory.newInstance() or StorageManagerFactory.newInstance(MMBase) methods to obtain a factory class.
author:
   Pierre van Rooden
since:
   MMBase-1.7
version:
   $Id: StorageManagerFactory.java,v 1.33 2008/02/22 12:28:19 michiel Exp $


Field Summary
protected  Map<String, Object>attributes
    
protected  ChangeManagerchangeManager
     The ChangeManager object, used to register/broadcast changes to a node or set of nodes.
final protected  SortedMap<String, String>disallowedFields
    
protected  CharTransformergetSurrogator
    
protected  MMBasemmbase
    
protected  SearchQueryHandlerqueryHandler
     The query handler to use with this factory.
protected  List<Class<?>>queryHandlerClasses
     The query handler classes.
protected  CharTransformersetSurrogator
    
protected  Class<SM>storageManagerClass
     The class used to instantiate storage managers.
protected  List<String>storeBinaryAsFileObjects
    
protected  List<TypeMapping>typeMappings
    


Method Summary
public  ObjectgetAttribute(String key)
     Obtain an attribute from this factory.
public  MapgetAttributes()
     Retrieve a map of attributes for this factory.
public  StringgetCatalog()
     Returns the name of the catalog used by this storage (null if no catalog is used).
public  ChangeManagergetChangeManager()
     Returns the ChangeManager utility instance, used to register and broadcast changes to nodes in the storage layer.
protected  StringgetDataDir()
    
public  Map<String, String>getDisallowedFields()
     Returns a map of disallowed field names and their possible alternate values.
public  StorageReader<SM>getDocumentReader()
     Locates and opens the storage configuration document, if available.
public  CharTransformergetGetSurrogator()
     Returns a filter which can be used to filter strings taken from storage or null if none defined.
public  MMBasegetMMBase()
    
public  SchemegetScheme(String key)
     Obtain a scheme from this factory.
public  SchemegetScheme(String key, String defaultPattern)
     Obtain a scheme from this factory.
public  SearchQueryHandlergetSearchQueryHandler()
     Obtains a SearchQueryHandler from the factory.
public  CharTransformergetSetSurrogator()
     Returns a filter which can be used to filter strings which are to be set into storage or null if none defined.
public  ObjectgetStorageIdentifier()
     Obtains the identifier for the basic storage element.
public  ObjectgetStorageIdentifier(Object mmobject)
     Obtains a identifier for an MMBase object.
public  SMgetStorageManager()
     Obtains a StorageManager from the factory.
public  List<String>getStoreBinaryAsFileObjects()
     Returns a list of objects of which binary data should be stored in a file.
public  intgetTimeZoneOffset(long time)
     Returns the offset which must be used in the database.
public  List<TypeMapping>getTypeMappings()
     Returns a sorted list of type mappings for this storage.
abstract public  doublegetVersion()
     Returns the version of this factory implementation.
public  booleanhasOption(String key)
     Check whether an option was set.
final protected  voidinit(MMBase mmbase)
     Initialize the StorageManagerFactory.
abstract protected  ObjectinstantiateBasicHandler(Class handlerClass)
     Instantiate a basic handler object using the specified class.
abstract protected  ObjectinstantiateChainedHandler(Class handlerClass, Object previousHandler)
     Instantiate a chained handler object using the specified class. A chained handler can be any type of class and is dependent on the factory implementation. For instance, the database factory expects an org.mmbase.storage.search.implentation.database.ChainedSQLHandler class.
Parameters:
  handlerClass - the class to instantuate teh object with
Parameters:
  previousHandler - a handler thatw a sinstantiated previously.this handler should be passed to the new handler class during orafter constrcution, so the ne whandler can 'chain' any events it cannothandle to this class.
abstract protected  SearchQueryHandlerinstantiateQueryHandler(Object data)
     Instantiate a SearchQueryHandler object using the specified object.
protected  voidload()
     Opens and reads the storage configuration document.
public static  StorageManagerFactorynewInstance(MMBase mmbase)
     Obtain the StorageManagerFactory belonging to the indicated MMBase module.
public static  StorageManagerFactorynewInstance()
     Obtain the storage manager factory belonging to the default MMBase module.
public  voidsetAttribute(String key, Object value)
     Set an attribute of this factory.
public  voidsetAttributes(Map<String, Object> attributes)
     Add a map of attributes for this factory.
protected  voidsetDisallowedFields(Map disallowedFields)
     Sets the map of disallowed Fields.
public  voidsetOption(String key, boolean value)
     Set an option to true or false.
public  voidsetScheme(String key, String pattern)
     Set a scheme of this factory, using a string pattern to base the Scheme on.
abstract public  booleansupportsTransactions()
     Returns whether transactions, and specifically rollback, is supported in the storage layer.

Field Detail
attributes
protected Map<String, Object> attributes(Code)
The map with configuration data



changeManager
protected ChangeManager changeManager(Code)
The ChangeManager object, used to register/broadcast changes to a node or set of nodes.



disallowedFields
final protected SortedMap<String, String> disallowedFields(Code)
The map with disallowed fieldnames and (if given) alternates



getSurrogator
protected CharTransformer getSurrogator(Code)

See Also:   StorageManagerFactory.getGetSurrogator()



mmbase
protected MMBase mmbase(Code)
A reference to the MMBase module



queryHandler
protected SearchQueryHandler queryHandler(Code)
The query handler to use with this factory. Note: the current handler makes use of the JDBC2NodeInterface and is not optimized for storage: using it means you call getNodeManager() TWICE. Have to look into how this should work together.



queryHandlerClasses
protected List<Class<?>> queryHandlerClasses(Code)
The query handler classes. Assign a value to this class if you want to set a default query handler.



setSurrogator
protected CharTransformer setSurrogator(Code)

See Also:   StorageManagerFactory.getSetSurrogator()



storageManagerClass
protected Class<SM> storageManagerClass(Code)
The class used to instantiate storage managers. The classname is retrieved from the storage configuration file



storeBinaryAsFileObjects
protected List<String> storeBinaryAsFileObjects(Code)
The list with objects of which binary data should not be stored in database



typeMappings
protected List<TypeMapping> typeMappings(Code)
The list with type mappings





Method Detail
getAttribute
public Object getAttribute(String key)(Code)
Obtain an attribute from this factory. Attributes are the configuration parameters for the storagefactory.
Parameters:
  key - the key of the attribute the attribute value, or null if it is unknown



getAttributes
public Map getAttributes()(Code)
Retrieve a map of attributes for this factory. The attributes are the configuration parameters for the factory. You cannot change this map, though you can change the attributes themselves. an unmodifiable Map



getCatalog
public String getCatalog()(Code)
Returns the name of the catalog used by this storage (null if no catalog is used).



getChangeManager
public ChangeManager getChangeManager()(Code)
Returns the ChangeManager utility instance, used to register and broadcast changes to nodes in the storage layer. This method is for use by the StorageManager



getDataDir
protected String getDataDir()(Code)



getDisallowedFields
public Map<String, String> getDisallowedFields()(Code)
Returns a map of disallowed field names and their possible alternate values. A Map of disallowed field names



getDocumentReader
public StorageReader<SM> getDocumentReader() throws StorageException(Code)
Locates and opens the storage configuration document, if available. The configuration document to open can be set in mmbasereoot (using the storage property). The property should point to a resource which is to be present in the MMBase classpath. Overriding factories may provide ways to auto-detect the location of a configuration file.
throws:
  StorageException - if something went wrong while obtaining the document reader a StorageReader instance, or null if no reader has been configured



getGetSurrogator
public CharTransformer getGetSurrogator()(Code)
Returns a filter which can be used to filter strings taken from storage or null if none defined.
since:
   MMBase-1.7.4



getMMBase
public MMBase getMMBase()(Code)
Return the MMBase module for which the factory was instantiated the MMBase instance



getScheme
public Scheme getScheme(String key)(Code)
Obtain a scheme from this factory. Schemes are special attributes, consisting of patterned strings that can be expanded with arguments.
Parameters:
  key - the key of the attribute the scheme value, or null if it is unknown



getScheme
public Scheme getScheme(String key, String defaultPattern)(Code)
Obtain a scheme from this factory. Schemes are special attributes, consisting of patterned strings that can be expanded with arguments. If no scheme is present, the default pattern is used to create a scheme and add it to the factory.
Parameters:
  key - the key of the attribute
Parameters:
  defaultPattern - the pattern to use for the default scheme, null if there is no default the scheme value, null if there is no scheme



getSearchQueryHandler
public SearchQueryHandler getSearchQueryHandler() throws StorageException(Code)
Obtains a SearchQueryHandler from the factory. This provides ways to query for data using the SearchQuery interface. Note that cannot run the querys on a transaction (since SearchQuery does not support them). a SearchQueryHandler instance
throws:
  StorageException - when the handler cannot be created



getSetSurrogator
public CharTransformer getSetSurrogator()(Code)
Returns a filter which can be used to filter strings which are to be set into storage or null if none defined.
since:
   MMBase-1.7.4



getStorageIdentifier
public Object getStorageIdentifier() throws StorageException(Code)
Obtains the identifier for the basic storage element. the storage-specific identifier
throws:
  StorageException - if the object cannot be given a valid identifier



getStorageIdentifier
public Object getStorageIdentifier(Object mmobject) throws StorageException(Code)
Obtains a identifier for an MMBase object. The default implementation returns the following type of identifiers:
  • For StorageManager: the basename
  • For MMBase: the String '[basename]_object
  • For MMObjectBuilder: the String '[basename]_[builder name]'
  • For Indices: the String '[basename]_[builder name]_[index name]_idx'
  • For MMObjectNode: the object number as a Integer
  • For CoreField or String: the field name, or the replacement fieldfname (from the disallowedfields map)
Note that 'basename' is a property from the mmbase module, set in mmbaseroot.xml.
You can override this method if you intend to use different ids.
See Also:   Storable
Parameters:
  mmobject - the MMBase objecty the storage-specific identifier
throws:
  StorageException - if the object cannot be given a valid identifier



getStorageManager
public SM getStorageManager() throws StorageException(Code)
Obtains a StorageManager from the factory. The instance represents a temporary connection to the datasource - do not store the result of this call as a static or long-term member of a class. a StorageManager instance
throws:
  StorageException - when the storagemanager cannot be created



getStoreBinaryAsFileObjects
public List<String> getStoreBinaryAsFileObjects()(Code)
Returns a list of objects of which binary data should be stored in a file. the list of objects of which BLOB fields should not be stored in database.
since:
   MMBase-1.8.5



getTimeZoneOffset
public int getTimeZoneOffset(long time)(Code)
Returns the offset which must be used in the database. Currently this is based on the system's default time zone. It is imaginable that can have configuration or database specific details later.
Parameters:
  time - The time at which it is evaluated (summer time issues)
since:
   MMBase-1.8



getTypeMappings
public List<TypeMapping> getTypeMappings()(Code)
Returns a sorted list of type mappings for this storage. the list of TypeMapping objects



getVersion
abstract public double getVersion()(Code)
Returns the version of this factory implementation. The factory uses this number to verify whether it can handle storage configuration files that list version requirements. the version as an integer



hasOption
public boolean hasOption(String key)(Code)
Check whether an option was set. Options are attributes that return a boolean value.
Parameters:
  key - the key of the option true if the option was set



init
final protected void init(MMBase mmbase) throws StorageError(Code)
Initialize the StorageManagerFactory. This method should be called after instantiation of the factory class. It is called automatically by StorageManagerFactory.newInstance() and StorageManagerFactory.newInstance(MMBase) .
Parameters:
  mmbase - the MMBase instance to which this factory belongs
throws:
  StorageError - when something went wrong during configuration of the factory, or when the storage cannot be accessed



instantiateBasicHandler
abstract protected Object instantiateBasicHandler(Class handlerClass)(Code)
Instantiate a basic handler object using the specified class. A basic handler can be any type of class and is dependent on the factory implementation. For instance, the database factory expects an org.mmbase.storage.search.implentation.database.SQLHandler class.
Parameters:
  handlerClass - the class to instantuate teh object with the new handler class



instantiateChainedHandler
abstract protected Object instantiateChainedHandler(Class handlerClass, Object previousHandler)(Code)
Instantiate a chained handler object using the specified class. A chained handler can be any type of class and is dependent on the factory implementation. For instance, the database factory expects an org.mmbase.storage.search.implentation.database.ChainedSQLHandler class.
Parameters:
  handlerClass - the class to instantuate teh object with
Parameters:
  previousHandler - a handler thatw a sinstantiated previously.this handler should be passed to the new handler class during orafter constrcution, so the ne whandler can 'chain' any events it cannothandle to this class. the new handler class



instantiateQueryHandler
abstract protected SearchQueryHandler instantiateQueryHandler(Object data)(Code)
Instantiate a SearchQueryHandler object using the specified object. The specified parameter may be an actual SearchQueryHandler object, or it may be a utility class. For instance, the database factory expects an org.mmbase.storage.search.implentation.database.SQLHandler object, which is used as a parameter in the construction of the actual SearchQueryHandler class.
Parameters:
  data - the object to instantuate a SearchQueryHandler object with



load
protected void load() throws StorageException(Code)
Opens and reads the storage configuration document. Override this method to add additional configuration code before or after the configuration document is read.
throws:
  StorageException - if the storage could not be accessed or necessary configuration data is missing or invalid



newInstance
public static StorageManagerFactory newInstance(MMBase mmbase) throws StorageException(Code)
Obtain the StorageManagerFactory belonging to the indicated MMBase module.
Parameters:
  mmbase - The MMBase module for which to retrieve the storagefactory The StorageManagerFactory
throws:
  StorageException - if the StorageManagerFactory class cannot be located, accessed, or instantiated,or when something went wrong during configuration of the factory



newInstance
public static StorageManagerFactory newInstance() throws StorageException(Code)
Obtain the storage manager factory belonging to the default MMBase module. The StoragemanagerFactory
throws:
  StorageException - if the StorageManagerFactory class cannot be located, accessed, or instantiated,or when something went wrong during configuration of the factory



setAttribute
public void setAttribute(String key, Object value)(Code)
Set an attribute of this factory. Attributes are the configuration parameters for the factory. The actual content the factory expects is dependent on the implementation. To invalidate an attribute, you can pass the null value.
Parameters:
  key - the key of the attribute
Parameters:
  value - the value of the attribute



setAttributes
public void setAttributes(Map<String, Object> attributes)(Code)
Add a map of attributes for this factory. The attributes are the configuration parameters for the factory. The actual content the factory expects is dependent on the implementation. The attributes are added to any attributes already knwon to the factory.
Parameters:
  attributes - the map of attributes to add



setDisallowedFields
protected void setDisallowedFields(Map disallowedFields)(Code)
Sets the map of disallowed Fields. Unlike setAttributes(), this actually replaces the existing disallowed fields map.



setOption
public void setOption(String key, boolean value)(Code)
Set an option to true or false.
Parameters:
  key - the key of the option
Parameters:
  value - the value of the option (true or false)



setScheme
public void setScheme(String key, String pattern)(Code)
Set a scheme of this factory, using a string pattern to base the Scheme on. Schemes are special attributes, consisting of patterned strings that can be expanded with arguments.
Parameters:
  key - the key of the scheme
Parameters:
  pattern - the pattern to use for the scheme



supportsTransactions
abstract public boolean supportsTransactions()(Code)
Returns whether transactions, and specifically rollback, is supported in the storage layer. true if trasnactions are supported



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.