Package net.ontopia.persistence.proxy
Class RDBMSStorage
- java.lang.Object
-
- net.ontopia.persistence.proxy.RDBMSStorage
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTIES_ROOTprotected Map<IdentityIF,Map<String,EvictableIF>>qcmap
-
Constructor Summary
Constructors Constructor Description RDBMSStorage()INTERNAL: Creates a storage definition which gets its settings from system variables.RDBMSStorage(String propfile)INTERNAL: Creates a storage definition that reads its settings from the specified property file.RDBMSStorage(Map<String,String> properties)INTERNAL: Creates a storage definition that reads its settings from the specified properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()voidclearCache(IdentityIF namespace)voidclose()INTERNAL: Closes the storage definition, which allows it to free its resources.StorageAccessIFcreateAccess(boolean readonly)QueryIFcreateQuery(String name, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar)QueryIFcreateQuery(JDOQuery jdoquery, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)TransactionIFcreateTransaction(boolean readonly)INTERNAL: Creates a new storage access instance.IdentityIFgenerateIdentity(Class<?> type)intgetActiveTransactionCount()ConnectionFactoryIFgetConnectionFactory(boolean readonly)StringgetDatabase()INTERNAL: Returns the database type.EvictableIFgetHelperObject(int identifier, IdentityIF namespace)INTERNAL: Returns the shared caches.protected InputStreamgetInputStream(String property, String filename)RDBMSMappinggetMapping()INTERNAL: Returns the optimized object relational mapping declaration.RDBMSMetricsIFgetMetrics()PUBLIC: provides proxy access to aRDBMSMetricsIFobject that provides access to the metrics regarding this storage.protected ConnectiongetNonTransactionalReadConnection()intgetNonTransactionalReadConnectionCount()String[]getPlatforms()INTERNAL: Returns the database platforms.Map<String,String>getProperties()INTERNAL: Gets the properties held by the storage.StringgetProperty(String property)INTERNAL: Gets the value of the specified storage property.StringgetProperty(String property, String default_value)QueryDeclarationsgetQueryDeclarations()protected QueryDescriptorgetQueryDescriptor(String name)StringgetQueryString(String name)SQLGeneratorIFgetSQLGenerator()StorageCacheIFgetStorageCache()INTERNAL: Returns the shared storage cache, if any.Set<AbstractTransaction>getTransactions()INTERNAL: exposes the set of active transactions.protected voidinit(Map<String,String> properties)INTERNAL: Method shared by constructors to properly initialize members.booleanisSharedCache()INTERNAL: Returns true if shared cache is enabled.voidnotifyCluster()INTERNAL: Notify cluster that transaction has been committed, so that batched cluster events can be broadcasted.voidobjectMerged(IdentityIF source, IdentityIF target, AbstractTransaction cause)INTERNAL: Propagates committed merges to other active transactions.protected voidtouch(Connection connection)protected voidtransactionClosed(AbstractTransaction transaction)voidwriteReport(Writer out, TopicMapReferenceIF reference, IdentityIF namespace, boolean dumpCaches)
-
-
-
Field Detail
-
PROPERTIES_ROOT
public static final String PROPERTIES_ROOT
- See Also:
- Constant Field Values
-
qcmap
protected Map<IdentityIF,Map<String,EvictableIF>> qcmap
-
-
Constructor Detail
-
RDBMSStorage
public RDBMSStorage() throws IOExceptionINTERNAL: Creates a storage definition which gets its settings from system variables.- Throws:
IOException
-
RDBMSStorage
public RDBMSStorage(String propfile) throws IOException
INTERNAL: Creates a storage definition that reads its settings from the specified property file.- Throws:
IOException
-
RDBMSStorage
public RDBMSStorage(Map<String,String> properties) throws IOException
INTERNAL: Creates a storage definition that reads its settings from the specified properties.- Throws:
IOException- Since:
- 1.2.4
-
-
Method Detail
-
getInputStream
protected InputStream getInputStream(String property, String filename) throws IOException
- Throws:
IOException
-
init
protected void init(Map<String,String> properties) throws IOException
INTERNAL: Method shared by constructors to properly initialize members.- Throws:
IOException
-
getMapping
public RDBMSMapping getMapping()
Description copied from interface:StorageIFINTERNAL: Returns the optimized object relational mapping declaration.- Specified by:
getMappingin interfaceStorageIF
-
getQueryDeclarations
public QueryDeclarations getQueryDeclarations()
-
generateIdentity
public IdentityIF generateIdentity(Class<?> type)
-
getProperties
public Map<String,String> getProperties()
Description copied from interface:StorageIFINTERNAL: Gets the properties held by the storage.- Specified by:
getPropertiesin interfaceStorageIF
-
getProperty
public String getProperty(String property)
Description copied from interface:StorageIFINTERNAL: Gets the value of the specified storage property.- Specified by:
getPropertyin interfaceStorageIF
-
createAccess
public StorageAccessIF createAccess(boolean readonly)
-
createTransaction
public TransactionIF createTransaction(boolean readonly)
Description copied from interface:StorageIFINTERNAL: Creates a new storage access instance.- Specified by:
createTransactionin interfaceStorageIF
-
isSharedCache
public boolean isSharedCache()
Description copied from interface:StorageIFINTERNAL: Returns true if shared cache is enabled.- Specified by:
isSharedCachein interfaceStorageIF
-
getStorageCache
public StorageCacheIF getStorageCache()
Description copied from interface:StorageIFINTERNAL: Returns the shared storage cache, if any.- Specified by:
getStorageCachein interfaceStorageIF
-
getDatabase
public String getDatabase()
INTERNAL: Returns the database type.
-
getPlatforms
public String[] getPlatforms()
INTERNAL: Returns the database platforms.
-
close
public void close()
Description copied from interface:StorageIFINTERNAL: Closes the storage definition, which allows it to free its resources.
-
notifyCluster
public void notifyCluster()
Description copied from interface:StorageIFINTERNAL: Notify cluster that transaction has been committed, so that batched cluster events can be broadcasted.- Specified by:
notifyClusterin interfaceStorageIF
-
getHelperObject
public EvictableIF getHelperObject(int identifier, IdentityIF namespace)
Description copied from interface:StorageIFINTERNAL: Returns the shared caches.- Specified by:
getHelperObjectin interfaceStorageIF
-
getQueryDescriptor
protected QueryDescriptor getQueryDescriptor(String name)
-
createQuery
public QueryIF createQuery(String name, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar)
-
createQuery
public QueryIF createQuery(JDOQuery jdoquery, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)
-
getSQLGenerator
public SQLGeneratorIF getSQLGenerator()
-
getConnectionFactory
public ConnectionFactoryIF getConnectionFactory(boolean readonly)
-
clearCache
public void clearCache()
-
clearCache
public void clearCache(IdentityIF namespace)
-
getMetrics
public RDBMSMetricsIF getMetrics()
PUBLIC: provides proxy access to aRDBMSMetricsIFobject that provides access to the metrics regarding this storage.- Returns:
- A
RDBMSMetricsIFobject
-
writeReport
public void writeReport(Writer out, TopicMapReferenceIF reference, IdentityIF namespace, boolean dumpCaches) throws IOException
- Throws:
IOException
-
objectMerged
public void objectMerged(IdentityIF source, IdentityIF target, AbstractTransaction cause)
INTERNAL: Propagates committed merges to other active transactions.- Parameters:
source- Identity of the merge source objecttarget- Identity of the merge target objectcause- The transaction that committed the merge- Since:
- 5.4.0
-
getActiveTransactionCount
public int getActiveTransactionCount()
-
transactionClosed
protected void transactionClosed(AbstractTransaction transaction)
-
getTransactions
public Set<AbstractTransaction> getTransactions()
INTERNAL: exposes the set of active transactions.- Since:
- 5.4.0
-
getNonTransactionalReadConnection
protected Connection getNonTransactionalReadConnection()
-
touch
protected void touch(Connection connection)
-
getNonTransactionalReadConnectionCount
public int getNonTransactionalReadConnectionCount()
-
-