Package net.ontopia.topicmaps.impl.utils
Class AbstractTopicMapStore
java.lang.Object
net.ontopia.topicmaps.impl.utils.AbstractTopicMapStore
- All Implemented Interfaces:
AutoCloseable,TopicMapStoreIF
- Direct Known Subclasses:
InMemoryTopicMapStore,RDBMSTopicMapStore
INTERNAL: An abstract TopicMapStoreIF implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LocatorIFprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected TopicMapReferenceIFFields inherited from interface net.ontopia.topicmaps.core.TopicMapStoreIF
IN_MEMORY_IMPLEMENTATION, RDBMS_IMPLEMENTATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost.abstract voidclose(boolean returnToPool) 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.abstract EventManagerIFINTERNAL: Returns a topic map reference for this store.PUBLIC: Gets the topic map that is accessible through the root transaction of the store.abstract TopicMapTransactionIFbooleanisOpen()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.voidopen()PUBLIC: Opens the store, and starts a new transaction on a transactional store.voidsetReadOnly(boolean readonly) voidsetReference(TopicMapReferenceIF reference) INTERNAL: Sets the topic map reference for this store.voidsetTopicListeners(TopicMapListenerIF[] listeners) booleanvalidate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ontopia.topicmaps.core.TopicMapStoreIF
close, getImplementation, getProperty, isTransactional, setBaseAddress
-
Field Details
-
base_address
-
open
protected boolean open -
closed
protected boolean closed -
deleted
protected boolean deleted -
readonly
protected boolean readonly -
readonlySet
protected boolean readonlySet -
reference
-
topic_listeners
-
-
Constructor Details
-
AbstractTopicMapStore
public AbstractTopicMapStore()
-
-
Method Details
-
isOpen
public boolean isOpen()Description copied from interface:TopicMapStoreIFPUBLIC: Returns true if the store is open (because opening a transactional store starts a transaction, "true" also means a transaction is in progress).- Specified by:
isOpenin interfaceTopicMapStoreIF- Returns:
- Boolean: true if open, false if not open (either not yet opened, or closed).
-
open
public void open()Description copied from interface:TopicMapStoreIFPUBLIC: Opens the store, and starts a new transaction on a transactional store.- Specified by:
openin interfaceTopicMapStoreIF
-
getTransaction
-
getTopicMap
Description copied from interface:TopicMapStoreIFPUBLIC: Gets the topic map that is accessible through the root transaction of the store.- Specified by:
getTopicMapin interfaceTopicMapStoreIF- 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.
-
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- Returns:
- A locator to the topic map in the store; an object implementing LocatorIF.
-
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
-
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
-
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- Throws:
NotRemovableException
-
isReadOnly
public boolean isReadOnly()Description copied from interface:TopicMapStoreIFPUBLIC: Returns true if the store is usable for read-only purposes only.- Specified by:
isReadOnlyin interfaceTopicMapStoreIF- Returns:
- True if the store is a read-only store, otherwise false.
-
setReadOnly
public void setReadOnly(boolean readonly) -
getReference
Description copied from interface:TopicMapStoreIFINTERNAL: Returns a topic map reference for this store.- Specified by:
getReferencein interfaceTopicMapStoreIF
-
setReference
Description copied from interface:TopicMapStoreIFINTERNAL: Sets the topic map reference for this store. Warning: Intended for internal use only.- Specified by:
setReferencein interfaceTopicMapStoreIF
-
validate
public boolean validate() -
close
public abstract void close(boolean returnToPool) -
setTopicListeners
-
getEventManager
-