KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > StoreManager


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: StoreManager.java,v 1.9 2003/08/12 15:11:10 leomekenkamp Exp $
8

9 package org.ozoneDB.core;
10
11 import java.io.*;
12 import org.ozoneDB.DxLib.*;
13 import org.ozoneDB.*;
14
15
16 /**
17  * Together with the {@link ObjectContainer} interface this is the StoreManager
18  * back-end API.<p>
19  *
20  *
21  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
22  * @version $Revision: 1.9 $Date: 2003/08/12 15:11:10 $
23  */

24 public interface StoreManager {
25
26
27     /**
28      * Aid constructor, because a store is instantiated with 'newInstance',
29      * where we've got no arguments.
30      */

31     public void init( Env env );
32
33
34     public void startup() throws Exception JavaDoc;
35
36
37     public void shutdown() throws Exception JavaDoc;
38
39
40     /**
41      * Creates a new object container and initializes it with the specified
42      * target object. The new container is immediatly accessible from the calling
43      * transaction via containerByID but it is not joined to this transaction.
44      * It needs to be joined and commited afterwards.
45      *
46      * Iff this method returns normally, the returned container is pinned and thus has to be unpinned.
47      * Iff this method returns normally, the returned container is locked with the given lock level.
48      *
49      * @param ta
50      * @param target
51      * @param objID
52      * @param permissions
53      * @param lockLevel
54      * @return An container-proxy for the created container.
55      */

56     public ObjectContainer newContainerAndLock( Transaction ta, OzoneCompatible target, ObjectID objID,
57             Permissions permissions,int lockLevel) throws Exception JavaDoc;
58
59
60     /**
61      * Update lock level of the given container according to the leve of the
62      * containers lock object.
63      */

64     public void updateLockLevel( Transaction ta, ObjectContainer container ) throws IOException;
65
66     /**
67      * Prepare the specified transaction for commit. All operations that may
68      * fail during the commit process should be done here. However, this method
69      * must not change any global data structures such as the idTable that
70      * are used by other transactions too.<p>
71      *
72      * The {@link TransactionManager} let this method run exclusivly. However,
73      * {@link #prepareCommitTransaction} and {@link #commitTransaction} are not
74      * an atomar operation.
75      *
76      *
77      * @param ta Transaction that will be commited.
78      */

79     public void prepareCommitTransaction( Transaction ta ) throws IOException,ClassNotFoundException JavaDoc;
80
81
82     public void commitTransaction( Transaction ta ) throws IOException,ClassNotFoundException JavaDoc;
83
84
85     /**
86      * @param ta ID of the comitting transaction.
87      */

88     public void abortTransaction( Transaction ta ) throws IOException,ClassNotFoundException JavaDoc;
89
90     /**
91      * @param ta the running transaction
92      * @return a String array of the all object names defined
93      */

94     public DxSet objectNames(Transaction ta);
95
96
97     public ObjectContainer containerForID( Transaction ta, ObjectID id ) throws ObjectNotFoundException,IOException,ClassNotFoundException JavaDoc;
98
99
100     /**
101      * @param name The object name to search for.
102      * @param ta
103      * @return The object container for the name or null.
104      */

105     public ObjectContainer containerForName( Transaction ta, String JavaDoc name ) throws Exception JavaDoc;
106
107
108     /**
109      * @param ta
110      * @param container
111      * @param name
112      */

113     public void nameContainer( Transaction ta, ObjectContainer container, String JavaDoc name ) throws PermissionDeniedException;
114
115
116     /**
117      * Force the Store to make a guess which objects are used together with the
118      * container with the specified id.
119      * @param id The ObjectID if the container.
120      */

121     public DxBag clusterOfID( ObjectID id ) throws Exception JavaDoc;
122
123
124     public DxIterator objectIDIterator();
125
126     /**
127         Tells this StoreManager to report every named object to the garbage collector.
128     */

129     public void reportNamedObjectsToGarbageCollector();
130     
131     /**
132      * Factory method for creating a new <code>Transaction</code>.
133      */

134     public Transaction createTransaction(Env env, User user);
135 }
136
Popular Tags