public class DatabaseStorageManagerFactory extends StorageManagerFactory<DatabaseStorageManager>
| Modifier and Type | Field and Description |
|---|---|
protected String |
catalog
The catalog used by this storage.
|
protected DataSource |
dataSource
The datasource in use by this factory.
|
(package private) static long |
MS |
protected boolean |
supportsForeignKeys |
protected boolean |
supportsTransactions
Whether transactions and rollback are supported by this database
|
protected int |
transactionIsolation
The transaction isolation level available for this storage.
|
(package private) UtilReader.PropertiesMap<String> |
utilProperties |
attributes, changeManager, collationMappings, disallowedFields, getSurrogator, mmbase, queryHandler, queryHandlerClasses, setSurrogator, storageManagerClass, storeBinaryAsFileObjects, typeMappings| Constructor and Description |
|---|
DatabaseStorageManagerFactory() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkBinaryFileBasePath(File baseDir)
Tries to ensure that baseDir exists and is writable.
|
protected DataSource |
createDataSource(File binaryFileBasePath) |
File |
getBinaryFileBasePath()
As
getBinaryFileBasePath(boolean) with true |
protected File |
getBinaryFileBasePath(boolean check)
Returns the base path for 'binary file'
|
String |
getCatalog()
Returns the name of the catalog used by this storage (
null if no catalog is used). |
String |
getDatabaseName()
Doing some best effort to get a 'database name'.
|
DataSource |
getDataSource()
Returns the DataSource associated with this factory.
|
StorageReader |
getDocumentReader()
Locates and opens the storage configuration document, if available.
|
protected int |
getMaxKeyLength()
The maximal length an index in the database can have, or
Integer.MAX_VALUE. |
protected Throwable |
getTraceException() |
double |
getVersion()
Returns the version of this factory implementation.
|
protected Object |
instantiateBasicHandler(Class handlerClass)
Instantiate a basic handler object using the specified class.
|
protected Object |
instantiateChainedHandler(Class handlerClass,
Object handler)
Instantiate a chained handler object using the specified class.
|
protected SearchQueryHandler |
instantiateQueryHandler(Object data)
Instantiate a SearchQueryHandler object using the specified object.
|
protected void |
load()
Opens and reads the storage configuration document.
|
protected boolean |
logQuery(String query,
long duration) |
static void |
main(String[] args) |
boolean |
supportsTransactions()
Returns whether transactions, and specifically rollback, is supported in the storage layer.
|
beginTransaction, commit, createStorageManager, getAttribute, getAttributes, getChangeManager, getDisallowedFields, getGetSurrogator, getMappedCollation, getMMBase, getScheme, getScheme, getSearchQueryHandler, getSetSurrogator, getStorageIdentifier, getStorageIdentifier, getStorageManager, getStoreBinaryAsFileObjects, getTimeZoneOffset, getTypeMappings, hasOption, init, newInstance, newInstance, rollback, setAttribute, setAttributes, setDisallowedFields, setOption, setSchemeprotected String catalog
protected DataSource dataSource
protected int transactionIsolation
protected boolean supportsTransactions
protected boolean supportsForeignKeys
static final long MS
final UtilReader.PropertiesMap<String> utilProperties
public double getVersion()
StorageManagerFactorygetVersion in class StorageManagerFactory<DatabaseStorageManager>public boolean supportsTransactions()
StorageManagerFactorysupportsTransactions in class StorageManagerFactory<DatabaseStorageManager>true if trasnactions are supportedpublic String getCatalog()
StorageManagerFactorynull if no catalog is used).getCatalog in class StorageManagerFactory<DatabaseStorageManager>public String getDatabaseName()
public DataSource getDataSource()
protected DataSource createDataSource(File binaryFileBasePath)
binaryFileBasePath - For some datasource a file base path may be needed (some configurations of hsql).
It can be null during bootstrap. In lookup.xml an alternative URL
may be configured then which does not need the file base path.protected void load()
throws StorageException
load in class StorageManagerFactory<DatabaseStorageManager>StorageException - if the storage could not be accessed or necessary configuration data is missing or invalidpublic StorageReader getDocumentReader() throws StorageException
getDocumentReader in class StorageManagerFactory<DatabaseStorageManager>StorageException - if the storage could not be accessed while determining the database typepublic File getBinaryFileBasePath()
getBinaryFileBasePath(boolean) with trueprotected File getBinaryFileBasePath(boolean check)
check - If the path is only perhaps needed, you may want to provide 'false' here.public static boolean checkBinaryFileBasePath(File baseDir)
baseDir - a Directory nameprotected Object instantiateBasicHandler(Class handlerClass)
StorageManagerFactoryinstantiateBasicHandler in class StorageManagerFactory<DatabaseStorageManager>handlerClass - the class to instantuate teh object withprotected Object instantiateChainedHandler(Class handlerClass, Object handler)
StorageManagerFactoryinstantiateChainedHandler in class StorageManagerFactory<DatabaseStorageManager>handlerClass - the class to instantuate teh object withhandler - 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 SearchQueryHandler instantiateQueryHandler(Object data)
StorageManagerFactoryinstantiateQueryHandler in class StorageManagerFactory<DatabaseStorageManager>data - the object to instantuate a SearchQueryHandler object withprotected int getMaxKeyLength()
Integer.MAX_VALUE.protected Throwable getTraceException()
protected boolean logQuery(String query, long duration)
public static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}