Package net.ontopia.persistence.proxy
Class RDBMSStorage
- java.lang.Object
-
- net.ontopia.persistence.proxy.RDBMSStorage
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTIES_ROOT
protected 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 void
clearCache()
void
clearCache(IdentityIF namespace)
void
close()
INTERNAL: Closes the storage definition, which allows it to free its resources.StorageAccessIF
createAccess(boolean readonly)
QueryIF
createQuery(String name, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar)
QueryIF
createQuery(JDOQuery jdoquery, RDBMSAccess access, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)
TransactionIF
createTransaction(boolean readonly)
INTERNAL: Creates a new storage access instance.IdentityIF
generateIdentity(Class<?> type)
int
getActiveTransactionCount()
ConnectionFactoryIF
getConnectionFactory(boolean readonly)
String
getDatabase()
INTERNAL: Returns the database type.EvictableIF
getHelperObject(int identifier, IdentityIF namespace)
INTERNAL: Returns the shared caches.protected InputStream
getInputStream(String property, String filename)
RDBMSMapping
getMapping()
INTERNAL: Returns the optimized object relational mapping declaration.RDBMSMetricsIF
getMetrics()
PUBLIC: provides proxy access to aRDBMSMetricsIF
object that provides access to the metrics regarding this storage.protected Connection
getNonTransactionalReadConnection()
int
getNonTransactionalReadConnectionCount()
String[]
getPlatforms()
INTERNAL: Returns the database platforms.Map<String,String>
getProperties()
INTERNAL: Gets the properties held by the storage.String
getProperty(String property)
INTERNAL: Gets the value of the specified storage property.String
getProperty(String property, String default_value)
QueryDeclarations
getQueryDeclarations()
protected QueryDescriptor
getQueryDescriptor(String name)
String
getQueryString(String name)
SQLGeneratorIF
getSQLGenerator()
StorageCacheIF
getStorageCache()
INTERNAL: Returns the shared storage cache, if any.Set<AbstractTransaction>
getTransactions()
INTERNAL: exposes the set of active transactions.protected void
init(Map<String,String> properties)
INTERNAL: Method shared by constructors to properly initialize members.boolean
isSharedCache()
INTERNAL: Returns true if shared cache is enabled.void
notifyCluster()
INTERNAL: Notify cluster that transaction has been committed, so that batched cluster events can be broadcasted.void
objectMerged(IdentityIF source, IdentityIF target, AbstractTransaction cause)
INTERNAL: Propagates committed merges to other active transactions.protected void
touch(Connection connection)
protected void
transactionClosed(AbstractTransaction transaction)
void
writeReport(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 IOException
INTERNAL: 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:StorageIF
INTERNAL: Returns the optimized object relational mapping declaration.- Specified by:
getMapping
in interfaceStorageIF
-
getQueryDeclarations
public QueryDeclarations getQueryDeclarations()
-
generateIdentity
public IdentityIF generateIdentity(Class<?> type)
-
getProperties
public Map<String,String> getProperties()
Description copied from interface:StorageIF
INTERNAL: Gets the properties held by the storage.- Specified by:
getProperties
in interfaceStorageIF
-
getProperty
public String getProperty(String property)
Description copied from interface:StorageIF
INTERNAL: Gets the value of the specified storage property.- Specified by:
getProperty
in interfaceStorageIF
-
createAccess
public StorageAccessIF createAccess(boolean readonly)
-
createTransaction
public TransactionIF createTransaction(boolean readonly)
Description copied from interface:StorageIF
INTERNAL: Creates a new storage access instance.- Specified by:
createTransaction
in interfaceStorageIF
-
isSharedCache
public boolean isSharedCache()
Description copied from interface:StorageIF
INTERNAL: Returns true if shared cache is enabled.- Specified by:
isSharedCache
in interfaceStorageIF
-
getStorageCache
public StorageCacheIF getStorageCache()
Description copied from interface:StorageIF
INTERNAL: Returns the shared storage cache, if any.- Specified by:
getStorageCache
in 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:StorageIF
INTERNAL: Closes the storage definition, which allows it to free its resources.
-
notifyCluster
public void notifyCluster()
Description copied from interface:StorageIF
INTERNAL: Notify cluster that transaction has been committed, so that batched cluster events can be broadcasted.- Specified by:
notifyCluster
in interfaceStorageIF
-
getHelperObject
public EvictableIF getHelperObject(int identifier, IdentityIF namespace)
Description copied from interface:StorageIF
INTERNAL: Returns the shared caches.- Specified by:
getHelperObject
in 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 aRDBMSMetricsIF
object that provides access to the metrics regarding this storage.- Returns:
- A
RDBMSMetricsIF
object
-
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()
-
-