Interface TopicMapStoreIF
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractTopicMapStore
,InMemoryTopicMapStore
,RDBMSTopicMapStore
,RemoteTopicMapStore
public interface TopicMapStoreIF extends AutoCloseable
PUBLIC: A topic map store is used to represent the connection between one topic map and a repository where the data instantiating that topic map is held (in an implementation-specific form). This interface is used to retrieve a topic map from such a repository and to save changes back to the repository. Implementations can be made for different kinds of repositories. The interface supports a simple transaction model.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
Fields Modifier and Type Field Description static int
IN_MEMORY_IMPLEMENTATION
PUBLIC: Constant that identifies the in-memory topic map implementation.static int
RDBMS_IMPLEMENTATION
PUBLIC: Constant that identifies the rdbms topic map implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abort()
PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost.void
close()
PUBLIC: Closes the store and aborts the transaction if active.void
commit()
PUBLIC: Commits and deactivates the top-level transaction.void
delete(boolean force)
PUBLIC: Deletes the TopicMapIF from the data store.LocatorIF
getBaseAddress()
PUBLIC: Gets a locator of the topic map in the store.int
getImplementation()
PUBLIC: Returns the topic map implementation identifier.String
getProperty(String propertyName)
PUBLIC: Returns the value of the specified topic map store property.TopicMapReferenceIF
getReference()
INTERNAL: Returns a topic map reference for this store.TopicMapIF
getTopicMap()
PUBLIC: Gets the topic map that is accessible through the root transaction of the store.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).boolean
isReadOnly()
PUBLIC: Returns true if the store is usable for read-only purposes only.boolean
isTransactional()
PUBLIC: Returns true if the store supports transactions.void
open()
PUBLIC: Opens the store, and starts a new transaction on a transactional store.void
setBaseAddress(LocatorIF base_address)
EXPERIMENTAL: Sets the persistent base address of the store.void
setReference(TopicMapReferenceIF reference)
INTERNAL: Sets the topic map reference for this store.
-
-
-
Field Detail
-
IN_MEMORY_IMPLEMENTATION
static final int IN_MEMORY_IMPLEMENTATION
PUBLIC: Constant that identifies the in-memory topic map implementation. For use with the getImplementation() method.- See Also:
- Constant Field Values
-
RDBMS_IMPLEMENTATION
static final int RDBMS_IMPLEMENTATION
PUBLIC: Constant that identifies the rdbms topic map implementation. For use with the getImplementation() method.- See Also:
- Constant Field Values
-
-
Method Detail
-
getImplementation
int getImplementation()
PUBLIC: Returns the topic map implementation identifier.- Returns:
IN_MEMORY_IMPLEMENTATION
orRDBMS_IMPLEMENTATION
flags.- 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:
close
in 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
void setBaseAddress(LocatorIF base_address)
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
void delete(boolean force) throws NotRemovableException
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
String getProperty(String propertyName)
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
void setReference(TopicMapReferenceIF reference)
INTERNAL: Sets the topic map reference for this store. Warning: Intended for internal use only.
-
-