Interface TopicMapStoreIF
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractTopicMapStore,InMemoryTopicMapStore,RDBMSTopicMapStore,RemoteTopicMapStore
A topic map store is opened either explicitly through the open() method or implicitly via the getTopicMap() method. If the store is transactional, a new transaction is created when the store is opened.
To make persistent changes in the topic map, use the commit method. To roll back any changes since the last commit (or open), call the abort method. (Note that this only works with transactional stores).
Make sure that you close the store when you are done in order to release resources held by the store. A closed store can be reopened. Closing a transactional store aborts the current transaction, so commit before you close.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPUBLIC: Constant that identifies the in-memory topic map implementation.static final intPUBLIC: Constant that identifies the rdbms topic map implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost.voidclose()PUBLIC: Closes the store and aborts the transaction if active.voidcommit()PUBLIC: Commits and deactivates the top-level transaction.voiddelete(boolean force) PUBLIC: Deletes the TopicMapIF from the data store.PUBLIC: Gets a locator of the topic map in the store.intPUBLIC: Returns the topic map implementation identifier.getProperty(String propertyName) PUBLIC: Returns the value of the specified topic map store property.INTERNAL: Returns a topic map reference for this store.PUBLIC: Gets the topic map that is accessible through the root transaction of the store.booleanisOpen()PUBLIC: Returns true if the store is open (because opening a transactional store starts a transaction, "true" also means a transaction is in progress).booleanPUBLIC: Returns true if the store is usable for read-only purposes only.booleanPUBLIC: Returns true if the store supports transactions.voidopen()PUBLIC: Opens the store, and starts a new transaction on a transactional store.voidsetBaseAddress(LocatorIF base_address) EXPERIMENTAL: Sets the persistent base address of the store.voidsetReference(TopicMapReferenceIF reference) INTERNAL: Sets the topic map reference for this store.
-
Field Details
-
IN_MEMORY_IMPLEMENTATION
static final int IN_MEMORY_IMPLEMENTATIONPUBLIC: Constant that identifies the in-memory topic map implementation. For use with the getImplementation() method.- See Also:
-
RDBMS_IMPLEMENTATION
static final int RDBMS_IMPLEMENTATIONPUBLIC: Constant that identifies the rdbms topic map implementation. For use with the getImplementation() method.- See Also:
-
-
Method Details
-
getImplementation
int getImplementation()PUBLIC: Returns the topic map implementation identifier.- Returns:
IN_MEMORY_IMPLEMENTATIONorRDBMS_IMPLEMENTATIONflags.- Since:
- 3.1
-
isTransactional
boolean isTransactional()PUBLIC: Returns true if the store supports transactions.- Returns:
- Boolean: true if transactional, false if not.
-
isOpen
boolean isOpen()PUBLIC: Returns true if the store is open (because opening a transactional store starts a transaction, "true" also means a transaction is in progress).- Returns:
- Boolean: true if open, false if not open (either not yet opened, or closed).
-
open
void open()PUBLIC: Opens the store, and starts a new transaction on a transactional store. -
close
void close()PUBLIC: Closes the store and aborts the transaction if active.- Specified by:
closein interfaceAutoCloseable
-
getBaseAddress
LocatorIF getBaseAddress()PUBLIC: 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.- Returns:
- A locator to the topic map in the store; an object implementing LocatorIF.
-
setBaseAddress
EXPERIMENTAL: Sets the persistent base address of the store.- Since:
- 3.2.4
-
getTopicMap
TopicMapIF getTopicMap()PUBLIC: Gets the topic map that is accessible through the root transaction of the store.- 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
void commit()PUBLIC: Commits and deactivates the top-level transaction. This method is a shorthand for getTransaction().commit(). -
abort
void abort()PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost. This method is a shorthand for getTransaction().abort(). -
delete
PUBLIC: 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.
- Throws:
NotRemovableException- Since:
- 1.3.4
-
isReadOnly
boolean isReadOnly()PUBLIC: Returns true if the store is usable for read-only purposes only.- Returns:
- True if the store is a read-only store, otherwise false.
-
getProperty
PUBLIC: Returns the value of the specified topic map store property.- Since:
- 3.2.3
-
getReference
TopicMapReferenceIF getReference()INTERNAL: Returns a topic map reference for this store. -
setReference
INTERNAL: Sets the topic map reference for this store. Warning: Intended for internal use only.
-