01: /*
02: Copyright (C) 2007 Mobixess Inc. http://www.java-objects-database.com
03:
04: This file is part of the JODB (Java Objects Database) open source project.
05:
06: JODB is free software; you can redistribute it and/or modify it under
07: the terms of version 2 of the GNU General Public License as published
08: by the Free Software Foundation.
09:
10: JODB is distributed in the hope that it will be useful, but WITHOUT ANY
11: WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: for more details.
14:
15: You should have received a copy of the GNU General Public License along
16: with this program; if not, write to the Free Software Foundation, Inc.,
17: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package com.mobixess.jodb.core.io;
20:
21: import java.io.IOException;
22: import java.io.PrintStream;
23: import java.lang.reflect.Field;
24: import java.net.URI;
25: import java.util.concurrent.locks.ReentrantReadWriteLock;
26:
27: import com.mobixess.jodb.core.IDatabaseStatistics;
28: import com.mobixess.jodb.core.IPersistentObjectStatistics;
29: import com.mobixess.jodb.core.IllegalClassTypeException;
30: import com.mobixess.jodb.core.JodbIOException;
31: import com.mobixess.jodb.core.index.JODBIndexingRootAgent;
32: import com.mobixess.jodb.core.query.QueryNode;
33: import com.mobixess.jodb.core.transaction.JODBQueryList;
34: import com.mobixess.jodb.core.transaction.JODBSession;
35: import com.mobixess.jodb.core.transaction.TransactionContainer;
36:
37: public interface IOBase {
38: void close() throws IOException;
39:
40: boolean isNewDatabase();
41:
42: boolean isClosed() throws IOException;
43:
44: IDatabaseStatistics getDatabaseStatistics() throws IOException;
45:
46: long getFirstObjectOffset() throws IOException;
47:
48: long[] getForAllObjects(IOTicket ioTicket) throws IOException;
49:
50: void applyTransaction(TransactionContainer transactionContainer,
51: JODBSession session, IOTicket writeTicket,
52: JODBIndexingRootAgent indexingRootAgent) throws IOException;
53:
54: IPersistentObjectStatistics getPersistenceStatistics(long offset,
55: JODBSession session) throws IOException;
56:
57: int getClassTypeSubstitutionID(String classType)
58: throws JodbIOException;
59:
60: int getOrSetClassTypeSubstitutionID(Class clazz) throws IOException;
61:
62: int getOrSetClassTypeSubstitutionID(String classType)
63: throws IOException;
64:
65: int getOrSetFieldSubstitutionID(Field field);
66:
67: int getFieldSubstitutionID(Field field);
68:
69: String getFullFieldNameForID(int id) throws IOException;
70:
71: String getSimpleFieldNameForID(int id) throws IOException;
72:
73: String getClassTypeForID(int id) throws JodbIOException;
74:
75: String getPrefixForID(int id) throws IOException;
76:
77: IOTicket getIOTicket(boolean read, boolean write)
78: throws IOException;
79:
80: URI getDbIdentificator();
81:
82: void printFileMap(JODBSession session, PrintStream printStream)
83: throws IOException;
84:
85: ReentrantReadWriteLock getTransactionLock();
86:
87: JODBQueryList executeQuery(QueryNode query) throws IOException,
88: IllegalClassTypeException;
89:
90: //long getTransactionOffset();
91: }
|