Package net.ontopia.topicmaps.impl.rdbms
Class RDBMSTopicMapStore
java.lang.Object
net.ontopia.topicmaps.impl.utils.AbstractTopicMapStore
net.ontopia.topicmaps.impl.rdbms.RDBMSTopicMapStore
- All Implemented Interfaces:
AutoCloseable,TopicMapStoreIF
PUBLIC: The rdbms topic map store implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected RDBMSStorageprotected booleanprotected longprotected RDBMSTopicMapTransactionprotected static final Class[]Fields inherited from class net.ontopia.topicmaps.impl.utils.AbstractTopicMapStore
base_address, closed, deleted, open, readonly, readonlySet, reference, topic_listenersFields inherited from interface net.ontopia.topicmaps.core.TopicMapStoreIF
IN_MEMORY_IMPLEMENTATION, RDBMS_IMPLEMENTATION -
Constructor Summary
ConstructorsConstructorDescriptionPUBLIC: Creates a new topic map store without a specified database property file.RDBMSTopicMapStore(long topicmap_id) PUBLIC: Creates a new topic map store without a specified database property file.RDBMSTopicMapStore(String propfile) PUBLIC: Creates a new topic map store with the database property file set.RDBMSTopicMapStore(String propfile, long topicmap_id) PUBLIC: Creates a new topic map store with the database property file set.RDBMSTopicMapStore(Map<String, String> properties) PUBLIC: Creates a new topic map store with the specified database properties.RDBMSTopicMapStore(Map<String, String> properties, long topicmap_id) PUBLIC: Creates a new topic map store with the specified database properties.RDBMSTopicMapStore(StorageIF storage) INTERNAL:RDBMSTopicMapStore(StorageIF storage, long topicmap_id) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost.voidclear()voidINTERNAL: Empties the shared RDBMS caches.voidclose()PUBLIC: Closes the store and aborts the transaction if active.voidclose(boolean returnStore) voidcommit()PUBLIC: Commits and deactivates the top-level transaction.voiddelete(boolean force) PUBLIC: Deletes the TopicMapIF from the data store.protected booleanvoidevictObject(String object_id) INTERNAL: Evicts the given object from the shared RDBMS caches.protected voidfinalize()voidflush()PUBLIC: Gets a locator of the topic map in the store.getConnectionFactory(boolean readonly) protected IdentityIFgetIdentityForObjectId(TransactionIF txn, String object_id) intPUBLIC: Returns the topic map implementation identifier.longlonggetProperty(String name) INTERNAL: Gets the value of the specified store property.getQueryString(String name) INTERNAL: Returns the proxy storage implementation used by the topic map store.PUBLIC: Gets the topic map that is accessible through the root transaction of the store.booleanPUBLIC: Returns true if the store supports transactions.voidmerged(TMObjectIF source, TMObjectIF target) INTERNAL: Called by MergeUtils to notify transaction of a performed merge.booleanprefetch(int type, int[] fields, boolean[] traverse, Collection objects) booleanprefetch(int type, int field, boolean traverse, Collection objects) booleanprefetchFieldsById(Collection<String> object_ids, int field) booleanprefetchObjectsById(Collection<String> object_ids) voidprefetchRolesByType(Collection players, TopicIF rtype, TopicIF atype) voidsetBaseAddress(LocatorIF base_address) EXPERIMENTAL: Sets the persistent base address of the store.voidsetBaseAddressOverride(LocatorIF base_address) INTERNAL: Sets the apparent base address of the store.booleanvalidate()voidwriteIdentityMap(Writer out, boolean dump) EXPERIMENTAL: Dumps the identity map to the given writer.voidwriteReport(Writer out, boolean dumpCaches) EXPERIMENTAL: Writes a cache statistics report to the given writer.voidwriteReport(String filename, boolean dumpCaches) EXPERIMENTAL: Writes a cache statistics report to the given file.Methods inherited from class net.ontopia.topicmaps.impl.utils.AbstractTopicMapStore
getReference, isOpen, isReadOnly, open, setReadOnly, setReference, setTopicListeners
-
Field Details
-
types
-
topicmap_id
protected long topicmap_id -
storage
-
propfile
-
properties
-
transaction
-
storage_local
protected boolean storage_local
-
-
Constructor Details
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store without a specified database property file. A new topic map is created in the repository with this constructor at the time the topic map is accessed.- Throws:
IOException
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store without a specified database property file. The store references an existing topic map with the specified id.- Throws:
IOException
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store with the database property file set. A new topic map is created in the repository with this constructor at the time the topic map is accessed.- Parameters:
propfile- Path reference to a Java properties file.- Throws:
IOException
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store with the database property file set. The store references an existing topic map with the specified id.- Parameters:
propfile- Path reference to a Java properties file.topicmap_id- The ID of the topic map in the database.- Throws:
IOException
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store with the specified database properties. A new topic map is created in the repository with this constructor at the time the topic map is accessed.- Throws:
IOException- Since:
- 1.2.4
-
RDBMSTopicMapStore
PUBLIC: Creates a new topic map store with the specified database properties. The store references an existing topic map with the specified id.- Throws:
IOException- Since:
- 1.2.4
-
RDBMSTopicMapStore
INTERNAL: -
RDBMSTopicMapStore
INTERNAL:
-
-
Method Details
-
getStorage
INTERNAL: Returns the proxy storage implementation used by the topic map store. -
getImplementation
public int getImplementation()Description copied from interface:TopicMapStoreIFPUBLIC: Returns the topic map implementation identifier.- Returns:
TopicMapStoreIF.IN_MEMORY_IMPLEMENTATIONorTopicMapStoreIF.RDBMS_IMPLEMENTATIONflags.
-
isTransactional
public boolean isTransactional()Description copied from interface:TopicMapStoreIFPUBLIC: Returns true if the store supports transactions.- Returns:
- Boolean: true if transactional, false if not.
-
getBaseAddress
Description copied from interface:TopicMapStoreIFPUBLIC: Gets a locator of the topic map in the store. This can be used as a locator for the topic map as a whole. The locator can be resolved to a store that holds the topic map.- Specified by:
getBaseAddressin interfaceTopicMapStoreIF- Overrides:
getBaseAddressin classAbstractTopicMapStore- Returns:
- A locator to the topic map in the store; an object implementing LocatorIF.
-
setBaseAddress
Description copied from interface:TopicMapStoreIFEXPERIMENTAL: Sets the persistent base address of the store. -
setBaseAddressOverride
INTERNAL: Sets the apparent base address of the store. The value of this field is not considered persistent and may for that reason be transaction specific. -
getTransactionIF
-
getTransaction
- Specified by:
getTransactionin classAbstractTopicMapStore
-
getTopicMap
Description copied from interface:TopicMapStoreIFPUBLIC: Gets the topic map that is accessible through the root transaction of the store.- Specified by:
getTopicMapin interfaceTopicMapStoreIF- Overrides:
getTopicMapin classAbstractTopicMapStore- Returns:
- The topic map in the root transaction; an object implementing TopicMapIF. This method is a shorthand for getTransaction().getTopicMap(). If the store is not open when this method is called it will be opened automatically.
-
commit
public void commit()Description copied from interface:TopicMapStoreIFPUBLIC: Commits and deactivates the top-level transaction. This method is a shorthand for getTransaction().commit().- Specified by:
commitin interfaceTopicMapStoreIF- Overrides:
commitin classAbstractTopicMapStore
-
abort
public void abort()Description copied from interface:TopicMapStoreIFPUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost. This method is a shorthand for getTransaction().abort().- Specified by:
abortin interfaceTopicMapStoreIF- Overrides:
abortin classAbstractTopicMapStore
-
clear
public void clear() -
delete
-
delete
Description copied from interface:TopicMapStoreIFPUBLIC: Deletes the TopicMapIF from the data store. The store is closed after the topic map has been deleted. A deleted store cannot be reopened.If the force flag is false and the topic map contains any objects, i.e. topics and associations, a NotRemovableException will be thrown. The topic map will not be modified or closed if this is so.
If the force flag is true, the topic map will be deleted even if it contains any objects.
Note: if you're retrieved the store via a TopicMapReferenceIF then call delete(boolean) on the reference instead.
- Specified by:
deletein interfaceTopicMapStoreIF- Overrides:
deletein classAbstractTopicMapStore- Throws:
NotRemovableException
-
getProperty
INTERNAL: Gets the value of the specified store property. -
finalize
protected void finalize() -
close
public void close()Description copied from interface:TopicMapStoreIFPUBLIC: Closes the store and aborts the transaction if active. -
close
public void close(boolean returnStore) - Specified by:
closein classAbstractTopicMapStore
-
validate
public boolean validate()- Overrides:
validatein classAbstractTopicMapStore
-
evictObject
INTERNAL: Evicts the given object from the shared RDBMS caches.- Since:
- 3.3.0
-
clearCache
public void clearCache()INTERNAL: Empties the shared RDBMS caches.- Since:
- 2.2.1
-
writeReport
EXPERIMENTAL: Writes a cache statistics report to the given file.- Parameters:
filename- the name of the file to write the report todumpCaches- whether to include detailed cache dumps- Throws:
IOException- Since:
- 2.2.1
-
writeReport
EXPERIMENTAL: Writes a cache statistics report to the given writer.- Parameters:
out- the writer to write the report todumpCaches- whether to include detailed cache dumps- Throws:
IOException- Since:
- 2.2.1
-
writeIdentityMap
EXPERIMENTAL: Dumps the identity map to the given writer.- Parameters:
out- the writer to write the report to- Throws:
IOException- Since:
- 3.0
-
prefetchObjectsById
-
prefetchFieldsById
-
getIdentityForObjectId
-
prefetch
-
prefetch
-
prefetchRolesByType
-
getLongId
public long getLongId() -
getLongId
-
flush
public void flush() -
getConnection
-
getConnectionFactory
-
getQueryString
-
merged
INTERNAL: Called by MergeUtils to notify transaction of a performed merge.- Parameters:
source-target-
-
getEventManager
- Specified by:
getEventManagerin classAbstractTopicMapStore
-