net.ontopia.topicmaps.impl.utils
Class AbstractTopicMapStore

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.AbstractTopicMapStore
All Implemented Interfaces:
TopicMapStoreIF
Direct Known Subclasses:
InMemoryTopicMapStore, RDBMSTopicMapStore

public abstract class AbstractTopicMapStore
extends java.lang.Object
implements TopicMapStoreIF

INTERNAL: An abstract TopicMapStoreIF implementation.


Field Summary
protected  LocatorIF base_address
           
protected  boolean closed
           
protected  boolean deleted
           
protected  boolean open
           
protected  boolean readonly
           
protected  boolean readonlySet
           
protected  TopicMapReferenceIF reference
           
 TopicMapListenerIF[] topic_listeners
           
 
Fields inherited from interface net.ontopia.topicmaps.core.TopicMapStoreIF
IN_MEMORY_IMPLEMENTATION, RDBMS_IMPLEMENTATION
 
Constructor Summary
AbstractTopicMapStore()
           
 
Method Summary
 void abort()
          PUBLIC: Aborts and deactivates the top-level transaction; all changes made inside the root transaction are lost.
abstract  void close(boolean returnToPool)
           
 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.
abstract  EventManagerIF getEventManager()
           
 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.
abstract  TopicMapTransactionIF getTransaction()
           
 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.
 void open()
          PUBLIC: Opens the store, and starts a new transaction on a transactional store.
 void setReadOnly(boolean readonly)
           
 void setReference(TopicMapReferenceIF reference)
          INTERNAL: Sets the topic map reference for this store.
 void setTopicListeners(TopicMapListenerIF[] listeners)
           
 boolean validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.ontopia.topicmaps.core.TopicMapStoreIF
close, getImplementation, getProperty, isTransactional, setBaseAddress
 

Field Detail

base_address

protected LocatorIF base_address

open

protected boolean open

closed

protected boolean closed

deleted

protected boolean deleted

readonly

protected boolean readonly

readonlySet

protected boolean readonlySet

reference

protected TopicMapReferenceIF reference

topic_listeners

public TopicMapListenerIF[] topic_listeners
Constructor Detail

AbstractTopicMapStore

public AbstractTopicMapStore()
Method Detail

isOpen

public boolean isOpen()
Description copied from interface: TopicMapStoreIF
PUBLIC: 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:
isOpen in interface TopicMapStoreIF
Returns:
Boolean: true if open, false if not open (either not yet opened, or closed).

open

public void open()
Description copied from interface: TopicMapStoreIF
PUBLIC: Opens the store, and starts a new transaction on a transactional store.

Specified by:
open in interface TopicMapStoreIF

getTransaction

public abstract TopicMapTransactionIF getTransaction()

getTopicMap

public TopicMapIF getTopicMap()
Description copied from interface: TopicMapStoreIF
PUBLIC: Gets the topic map that is accessible through the root transaction of the store.

Specified by:
getTopicMap in interface TopicMapStoreIF
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

public LocatorIF getBaseAddress()
Description copied from interface: TopicMapStoreIF
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.

Specified by:
getBaseAddress in interface TopicMapStoreIF
Returns:
A locator to the topic map in the store; an object implementing LocatorIF.

commit

public void commit()
Description copied from interface: TopicMapStoreIF
PUBLIC: Commits and deactivates the top-level transaction. This method is a shorthand for getTransaction().commit().

Specified by:
commit in interface TopicMapStoreIF

abort

public void abort()
Description copied from interface: TopicMapStoreIF
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().

Specified by:
abort in interface TopicMapStoreIF

delete

public void delete(boolean force)
            throws NotRemovableException
Description copied from interface: TopicMapStoreIF
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.

Specified by:
delete in interface TopicMapStoreIF
Throws:
NotRemovableException

isReadOnly

public boolean isReadOnly()
Description copied from interface: TopicMapStoreIF
PUBLIC: Returns true if the store is usable for read-only purposes only.

Specified by:
isReadOnly in interface TopicMapStoreIF
Returns:
True if the store is a read-only store, otherwise false.

setReadOnly

public void setReadOnly(boolean readonly)

getReference

public TopicMapReferenceIF getReference()
Description copied from interface: TopicMapStoreIF
INTERNAL: Returns a topic map reference for this store.

Specified by:
getReference in interface TopicMapStoreIF

setReference

public void setReference(TopicMapReferenceIF reference)
Description copied from interface: TopicMapStoreIF
INTERNAL: Sets the topic map reference for this store. Warning: Intended for internal use only.

Specified by:
setReference in interface TopicMapStoreIF

validate

public boolean validate()

close

public abstract void close(boolean returnToPool)

setTopicListeners

public void setTopicListeners(TopicMapListenerIF[] listeners)

getEventManager

public abstract EventManagerIF getEventManager()


Copyright © 2000-2012 Ontopia.