01: ///////////////////////////////////////////////////////////////////////////////
02: //
03: // Copyright (C) 2003-@year@ by Thomas M. Hazel, MyOODB (www.myoodb.org)
04: //
05: // All Rights Reserved
06: //
07: // This program is free software; you can redistribute it and/or modify
08: // it under the terms of the GNU General Public License and GNU Library
09: // General Public License as published by the Free Software Foundation;
10: // either version 2, or (at your option) any later version.
11: //
12: // This program is distributed in the hope that it will be useful,
13: // but WITHOUT ANY WARRANTY; without even the implied warranty of
14: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: // GNU General Public License and GNU Library General Public License
16: // for more details.
17: //
18: // You should have received a copy of the GNU General Public License
19: // and GNU Library General Public License along with this program; if
20: // not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
21: // MA 02139, USA.
22: //
23: ///////////////////////////////////////////////////////////////////////////////
24: package org.myoodb.core;
25:
26: import java.io.*;
27: import java.util.*;
28:
29: import org.myoodb.exception.*;
30:
31: public abstract interface AbstractStorage {
32: public void startup() throws Exception;
33:
34: public void shutdown() throws Exception;
35:
36: public boolean isVerifyingDatabase();
37:
38: public boolean isDefraggingDatabase();
39:
40: public boolean isBackingUpDatabase();
41:
42: public boolean isRestoringDatabase();
43:
44: public boolean performingDatabaseMaintenance();
45:
46: public void verifyDatabase() throws Exception;
47:
48: public void defragDatabase() throws Exception;
49:
50: public void backupDatabase(String location) throws Exception;
51:
52: public void restoreDatabase(String location) throws Exception;
53:
54: public HashMap getDefraggedContainerIdentifierMap();
55:
56: public LinkedList getContainerIdentifiers(boolean finishTransactions)
57: throws Exception;
58:
59: public AbstractObjectContainer getContainer(String rootName,
60: Identifier id) throws IOException, ClassNotFoundException,
61: ObjectNotFoundException;
62:
63: public AbstractObjectContainer createContainer(
64: AbstractTransaction tx, Identifier id, String rootName)
65: throws IOException, ClassNotFoundException;
66:
67: public AbstractTransaction createTransaction(User user);
68:
69: public void setAssociatedTransaction(AbstractTransaction tx,
70: AbstractObjectContainer container) throws IOException;
71:
72: public void prepareTransaction(AbstractTransaction tx)
73: throws IOException, ClassNotFoundException;
74:
75: public void commitTransaction(AbstractTransaction tx)
76: throws IOException, ClassNotFoundException,
77: InterruptedException;
78:
79: public void abortTransaction(AbstractTransaction tx)
80: throws IOException, ClassNotFoundException,
81: InterruptedException;
82:
83: public void setStoreAsXmlFlag(boolean flag);
84:
85: public boolean getStoreAsXmlFlag();
86:
87: public void staleMemoryCheck() throws InterruptedException;
88:
89: public void emptyMemoryCache();
90: }
|