Class AbstractTopicMapStore

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

public abstract class AbstractTopicMapStore extends Object implements TopicMapStoreIF
INTERNAL: An abstract TopicMapStoreIF implementation.
  • Field Details

    • 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 Details

    • AbstractTopicMapStore

      public AbstractTopicMapStore()
  • Method Details

    • 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()