ozone core API

org.ozoneDB.core
Interface StoreManager

All Known Implementing Classes:
ClassicStore, GammaStore, MagicStore, WizardStore

public interface StoreManager

Together with the ObjectContainer interface this is the StoreManager back-end API.

Version:
$Revision: 1.9 $Date: 2003/08/12 15:11:10 $
Author:
SMB

Method Summary
 void abortTransaction(Transaction ta)
           
 DxBag clusterOfID(ObjectID id)
          Force the Store to make a guess which objects are used together with the container with the specified id.
 void commitTransaction(Transaction ta)
           
 ObjectContainer containerForID(Transaction ta, ObjectID id)
           
 ObjectContainer containerForName(Transaction ta, java.lang.String name)
           
 Transaction createTransaction(Env env, User user)
          Factory method for creating a new Transaction.
 void init(Env env)
          Aid constructor, because a store is instantiated with 'newInstance', where we've got no arguments.
 void nameContainer(Transaction ta, ObjectContainer container, java.lang.String name)
           
 ObjectContainer newContainerAndLock(Transaction ta, org.ozoneDB.OzoneCompatible target, ObjectID objID, Permissions permissions, int lockLevel)
          Creates a new object container and initializes it with the specified target object.
 DxIterator objectIDIterator()
           
 DxSet objectNames(Transaction ta)
           
 void prepareCommitTransaction(Transaction ta)
          Prepare the specified transaction for commit.
 void reportNamedObjectsToGarbageCollector()
          Tells this StoreManager to report every named object to the garbage collector.
 void shutdown()
           
 void startup()
           
 void updateLockLevel(Transaction ta, ObjectContainer container)
          Update lock level of the given container according to the leve of the containers lock object.
 

Method Detail

init

public void init(Env env)
Aid constructor, because a store is instantiated with 'newInstance', where we've got no arguments.


startup

public void startup()
             throws java.lang.Exception
Throws:
java.lang.Exception

shutdown

public void shutdown()
              throws java.lang.Exception
Throws:
java.lang.Exception

newContainerAndLock

public ObjectContainer newContainerAndLock(Transaction ta,
                                           org.ozoneDB.OzoneCompatible target,
                                           ObjectID objID,
                                           Permissions permissions,
                                           int lockLevel)
                                    throws java.lang.Exception
Creates a new object container and initializes it with the specified target object. The new container is immediatly accessible from the calling transaction via containerByID but it is not joined to this transaction. It needs to be joined and commited afterwards. Iff this method returns normally, the returned container is pinned and thus has to be unpinned. Iff this method returns normally, the returned container is locked with the given lock level.

Parameters:
ta -
target -
objID -
permissions -
lockLevel -
Returns:
An container-proxy for the created container.
Throws:
java.lang.Exception

updateLockLevel

public void updateLockLevel(Transaction ta,
                            ObjectContainer container)
                     throws java.io.IOException
Update lock level of the given container according to the leve of the containers lock object.

Throws:
java.io.IOException

prepareCommitTransaction

public void prepareCommitTransaction(Transaction ta)
                              throws java.io.IOException,
                                     java.lang.ClassNotFoundException
Prepare the specified transaction for commit. All operations that may fail during the commit process should be done here. However, this method must not change any global data structures such as the idTable that are used by other transactions too.

The TransactionManager let this method run exclusivly. However, prepareCommitTransaction(org.ozoneDB.core.Transaction) and commitTransaction(org.ozoneDB.core.Transaction) are not an atomar operation.

Parameters:
ta - Transaction that will be commited.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

commitTransaction

public void commitTransaction(Transaction ta)
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

abortTransaction

public void abortTransaction(Transaction ta)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Parameters:
ta - ID of the comitting transaction.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

objectNames

public DxSet objectNames(Transaction ta)
Parameters:
ta - the running transaction
Returns:
a String array of the all object names defined

containerForID

public ObjectContainer containerForID(Transaction ta,
                                      ObjectID id)
                               throws org.ozoneDB.ObjectNotFoundException,
                                      java.io.IOException,
                                      java.lang.ClassNotFoundException
Throws:
org.ozoneDB.ObjectNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

containerForName

public ObjectContainer containerForName(Transaction ta,
                                        java.lang.String name)
                                 throws java.lang.Exception
Parameters:
name - The object name to search for.
ta -
Returns:
The object container for the name or null.
Throws:
java.lang.Exception

nameContainer

public void nameContainer(Transaction ta,
                          ObjectContainer container,
                          java.lang.String name)
                   throws org.ozoneDB.PermissionDeniedException
Parameters:
ta -
container -
name -
Throws:
org.ozoneDB.PermissionDeniedException

clusterOfID

public DxBag clusterOfID(ObjectID id)
                  throws java.lang.Exception
Force the Store to make a guess which objects are used together with the container with the specified id.

Parameters:
id - The ObjectID if the container.
Throws:
java.lang.Exception

objectIDIterator

public DxIterator objectIDIterator()

reportNamedObjectsToGarbageCollector

public void reportNamedObjectsToGarbageCollector()
Tells this StoreManager to report every named object to the garbage collector.


createTransaction

public Transaction createTransaction(Env env,
                                     User user)
Factory method for creating a new Transaction.


ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.