diff options
author | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
---|---|---|
committer | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
commit | 8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 (patch) | |
tree | bd328a4dd4f92d32202241b5e3a7f36177792c5f /java/org | |
download | rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.gz rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.xz rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.zip |
Initial commitv8.0
Diffstat (limited to 'java/org')
61 files changed, 2090 insertions, 0 deletions
diff --git a/java/org/odmg/ClassNotPersistenceCapableException.java b/java/org/odmg/ClassNotPersistenceCapableException.java new file mode 100644 index 0000000..4fe7110 --- /dev/null +++ b/java/org/odmg/ClassNotPersistenceCapableException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ + +package org.odmg; + +/** +* This exception is thrown when the implementation cannot make an object persistent because of the type of the object. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class ClassNotPersistenceCapableException extends ODMGRuntimeException +{ + +/** +* Construct an instance of the exception. +*/ + public ClassNotPersistenceCapableException() + { + super(); + } + +/** +* Construct an instance of the exception. +* @param msg A string providing a description of the exception. +*/ + public ClassNotPersistenceCapableException(String msg) + { + super(msg); + } +} diff --git a/java/org/odmg/DArray.class b/java/org/odmg/DArray.class Binary files differnew file mode 100644 index 0000000..ea7e037 --- /dev/null +++ b/java/org/odmg/DArray.class diff --git a/java/org/odmg/DArray.java b/java/org/odmg/DArray.java new file mode 100644 index 0000000..de03894 --- /dev/null +++ b/java/org/odmg/DArray.java @@ -0,0 +1,49 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; +import java.util.List; + +/** +* The interface that defines the operations of an ODMG array, +* <BR><I> not yet available in RasDaMan. </BR></I> +* Nearly all of its operations are defined by the JavaSoft <code>List</code> interface. +* All of the operations defined by the JavaSoft <code>List</code> +* interface are supported by an ODMG implementation of <code>DArray</code>, +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>List</code> methods. +* An instance of a class implementing this interface can be obtained +* by calling the method <code>Implementation.newDArray</code>. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// @see java.lang.UnsupportedOperationException + +public interface DArray extends org.odmg.DCollection, java.util.List +{ +/** +* Resize the array to have <code>newSize</code> elements. +* @param newSize The new size of the array. +*/ + public void resize(int newSize); +} + diff --git a/java/org/odmg/DBag.class b/java/org/odmg/DBag.class Binary files differnew file mode 100644 index 0000000..53ec907 --- /dev/null +++ b/java/org/odmg/DBag.class diff --git a/java/org/odmg/DBag.java b/java/org/odmg/DBag.java new file mode 100644 index 0000000..5812c32 --- /dev/null +++ b/java/org/odmg/DBag.java @@ -0,0 +1,85 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This interface defines the operations associated with an ODMG bag collection. +* All of the operations defined by the JavaSoft <code>Collection</code> +* interface are supported by an ODMG implementation of <code>DBag</code>, +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>Collection</code> methods. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// * @see java.lang.UnsupportedOperationException + +public interface DBag extends DCollection +{ +/** +* A new <code>DBag</code> instance is created that is the union of this object +* and <code>otherBag</code>. +* This method is similar to the <code>addAll</code> method in <code>Collection</code>, +* except that this method creates a new collection and <code>addAll</code> +* modifies the object to contain the result. +* @param otherBag The other bag to use in the union operation. +* @return A <code>DBag</code> instance that contains the union of this object +* and <code>otherBag</code>. +*/ +// * @see com.sun.java.util.collections.Collection#addAll + public DBag union(DBag otherBag); + +/** +* A new <code>DBag</code> instance is created that contains the intersection of +* this object and the <code>DBag</code> referenced by <code>otherBag</code>. +* This method is similar to the <code>retainAll</code> method in <code>Collection</code>, +* except that this method creates a new collection and <code>retainAll</code> +* modifies the object to contain the result. +* @param otherBag The other bag to use in creating the intersection. +* @return A <code>DBag</code> instance that contains the intersection of this +* object and <code>otherBag</code>. +*/ +// @see com.sun.java.util.collections.Collection#retainAll + public DBag intersection(DBag otherBag); + +/** +* A new <code>DBag</code> instance is created that contains the difference of +* this object and the <code>DBag</code> instance referenced by <code>otherBag</code>. +* This method is similar to the <code>removeAll</code> method in <code>Collection</code>, +* except that this method creates a new collection and <code>removeAll</code> +* modifies the object to contain the result. +* @param otherBag The other bag to use in creating the difference. +* @return A <code>DBag</code> instance that contains the elements of this object +* minus the elements in <code>otherBag</code>. +*/ +// * @see com.sun.java.util.collections.Collection#removeAll + public DBag difference(DBag otherBag); + +/** +* This method returns the number of occurrences of the object <code>obj</code> +* in the <code>DBag</code> collection. +* @param obj The value that may have elements in the collection. +* @return The number of occurrences of <code>obj</code> in this collection. +*/ + public int occurrences(Object obj); +} + diff --git a/java/org/odmg/DCollection.class b/java/org/odmg/DCollection.class Binary files differnew file mode 100644 index 0000000..304df43 --- /dev/null +++ b/java/org/odmg/DCollection.class diff --git a/java/org/odmg/DCollection.java b/java/org/odmg/DCollection.java new file mode 100644 index 0000000..37cb173 --- /dev/null +++ b/java/org/odmg/DCollection.java @@ -0,0 +1,86 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The base interface for all ODMG collections. +* The ODMG collections are based on JavaSoft’s collection interfaces. +* All of the operations defined by the JavaSoft <code>Collection</code> +* interface are supported by an ODMG implementation of <code>DCollection</code>; +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>Collection</code> methods. +* <p> +* <code>DCollection</code> contains methods used to perform queries on the collection. +* The OQL query predicate is given as a string with the syntax of the +* <code>where</code> clause of OQL. The predefined OQL variable <code>this</code> +* is used inside the predicate to denote the current element of the collection. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// * @see com.sun.java.util.collections.UnsupportedOperationException + +public interface DCollection extends java.util.Collection +{ +/** +* Selects the single element of the collection for which the provided OQL query +* predicate is true, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param predicate An OQL boolean query predicate. +* @return The element that evaluates to true for the predicate. If no element +* evaluates to true, null is returned. +* @exception QueryInvalidException The query predicate is invalid. +*/ + public Object selectElement(String predicate) throws QueryInvalidException; + +/** +* Access all of the elements of the collection that evaluate to true for the +* provided query predicate, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param predicate An OQL boolean query predicate. +* @return An iterator used to iterate over the elements that evaluated true for the predicate. +* @exception QueryInvalidException The query predicate is invalid. +*/ + public java.util.Iterator select(String predicate) throws QueryInvalidException; + +/** +* Evaluate the boolean query predicate for each element of the collection and +* return a new collection that contains each element that evaluated to true, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param predicate An OQL boolean query predicate. +* @return A new collection containing the elements that evaluated true for the predicate. +* @exception QueryInvalidException The query predicate is invalid. +*/ + public DCollection query(String predicate) throws QueryInvalidException; + +/** +* Determines whether there is an element of the collection that evaluates to true +* for the predicate, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param predicate An OQL boolean query predicate. +* @return True if there is an element of the collection that evaluates to true +* for the predicate, otherwise false. +* @exception QueryInvalidException The query predicate is invalid. +*/ + public boolean existsElement(String predicate) throws QueryInvalidException; +} + diff --git a/java/org/odmg/DList.class b/java/org/odmg/DList.class Binary files differnew file mode 100644 index 0000000..b66b41b --- /dev/null +++ b/java/org/odmg/DList.class diff --git a/java/org/odmg/DList.java b/java/org/odmg/DList.java new file mode 100644 index 0000000..fbbc8b9 --- /dev/null +++ b/java/org/odmg/DList.java @@ -0,0 +1,55 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The ODMG List collection. +* A <code>DList</code> collection is an ordered collection that provides +* efficient insertion and removal of elements at arbitrary positions in the +* list, but it also supports indexed access. The beginning index value is 0. +* When an element is added at a given position in the list, the index of all +* subsequent elements is increased by 1. Similarly, when an element is removed +* from the list, the index of all subsequent elements is decreased by 1. +* <p> +* All of the operations defined by the JavaSoft <code>List</code> +* interface are supported by an ODMG implementation of <code>DList</code>, +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>List</code> methods. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// * @see com.sun.java.util.collections.UnsupportedOperationException + +public interface DList extends DCollection, java.util.List { +/** +* Creates a new <code>DList</code> object that contains the contents of this +* <code>DList</code> object concatenated +* with the contents of the <code>otherList</code> object. +* @param otherList The list whose elements are placed at the end of the list +* returned by this method. +* @return A new <code>DList</code> that is the concatenation of this list and +* the list referenced by <code>otherList</code>. +*/ + public DList concat(DList otherList); +} + diff --git a/java/org/odmg/DMap.class b/java/org/odmg/DMap.class Binary files differnew file mode 100644 index 0000000..a61fe58 --- /dev/null +++ b/java/org/odmg/DMap.class diff --git a/java/org/odmg/DMap.java b/java/org/odmg/DMap.java new file mode 100644 index 0000000..0e99017 --- /dev/null +++ b/java/org/odmg/DMap.java @@ -0,0 +1,40 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The ODMG Map collection interface, +* <BR><I> not yet available in RasDaMan. </BR></I> +* All of the operations defined by the JavaSoft <code>Map</code> +* interface are supported by an ODMG implementation of <code>DMap</code>, +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>Map</code> methods. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// * @see com.sun.java.util.collections.UnsupportedOperationException + +public interface DMap extends java.util.Map { + +} + diff --git a/java/org/odmg/DSet.class b/java/org/odmg/DSet.class Binary files differnew file mode 100644 index 0000000..8381da6 --- /dev/null +++ b/java/org/odmg/DSet.class diff --git a/java/org/odmg/DSet.java b/java/org/odmg/DSet.java new file mode 100644 index 0000000..bcad44c --- /dev/null +++ b/java/org/odmg/DSet.java @@ -0,0 +1,110 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The ODMG Set collection interface. +* A <code>DSet</code> object is an unordered collection that does not support +* multiple elements with the same value. An implementation typically is very +* efficient at determining whether the collection contains a particular value. +* <p> +* All of the operations defined by the JavaSoft <code>Set</code> +* interface are supported by an ODMG implementation of <code>DSet</code>, +* the exception <code>UnsupportedOperationException</code> is not thrown when a +* call is made to any of the <code>Set</code> methods. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ +// * @see java.lang.UnsupportedOperationException + +public interface DSet extends DCollection, java.util.Set +{ + +/** +* Create a new <code>DSet</code> object that is the set union of this +* <code>DSet</code> object and the set referenced by <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet The other set to be used in the union operation. +* @return A newly created <code>DSet</code> instance that contains the union of the two sets. +*/ + public DSet union(DSet otherSet); + +/** +* Create a new <code>DSet</code> object that is the set intersection of this +* <code>DSet</code> object and the set referenced by <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet The other set to be used in the intersection operation. +* @return A newly created <code>DSet</code> instance that contains the +* intersection of the two sets. +*/ + public DSet intersection(DSet otherSet); + +/** +* Create a new <code>DSet</code> object that contains the elements of this +* collection minus the elements in <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet A set containing elements that should not be in the result set. +* @return A newly created <code>DSet</code> instance that contains the elements +* of this set minus those elements in <code>otherSet</code>. +*/ + public DSet difference(DSet otherSet); + +/** +* Determine whether this set is a subset of the set referenced by <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet Another set. +* @return True if this set is a subset of the set referenced by <code>otherSet</code>, +* otherwise false. +*/ + public boolean subsetOf(DSet otherSet); + +/** +* Determine whether this set is a proper subset of the set referenced by +* <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet Another set. +* @return True if this set is a proper subset of the set referenced by +* <code>otherSet</code>, otherwise false. +*/ + public boolean properSubsetOf(DSet otherSet); + +/** +* Determine whether this set is a superset of the set referenced by <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet Another set. +* @return True if this set is a superset of the set referenced by <code>otherSet</code>, +* otherwise false. +*/ + public boolean supersetOf(DSet otherSet); + +/** +* Determine whether this set is a proper superset of the set referenced by +* <code>otherSet</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param otherSet Another set. +* @return True if this set is a proper superset of the set referenced by +* <code>otherSet</code>, otherwise false. +*/ + public boolean properSupersetOf(DSet otherSet); +} + diff --git a/java/org/odmg/Database.class b/java/org/odmg/Database.class Binary files differnew file mode 100644 index 0000000..e365844 --- /dev/null +++ b/java/org/odmg/Database.class diff --git a/java/org/odmg/Database.java b/java/org/odmg/Database.java new file mode 100644 index 0000000..6edd15c --- /dev/null +++ b/java/org/odmg/Database.java @@ -0,0 +1,150 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The interface for interacting with an ODMG database. +* Databases must be opened before starting any transactions that use the database +* and closed after ending these transactions. +* <P> +* A database application generally begins processing by accessing one or more +* critical objects and proceeding from there. These objects are root objects, +* because they lead to interconnected webs of other objects. +* The ability to name an object (using method <code>bind</code>) and +* retrieve it later by that name (using method <code>lookup</code> facilitates +* this start-up capability. A name is not explicitly defined as an attribute of +* an object. Naming an object also makes it persistent. +* <P> +* There is a single flat name scope per database; thus all names in a particular +* database are unique. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public interface Database { +/** +* The database is not open. +*/ + public static final int NOT_OPEN = 0; + +/** +* The database is opened for read-only access. +*/ + public static final int OPEN_READ_ONLY = 1; + +/** +* The database is opened for reading and writing. +*/ + public static final int OPEN_READ_WRITE = 2; + +/** +* The database is open for exclusive access. +*/ + public static final int OPEN_EXCLUSIVE = 3; + +/** +* Open the named database with the specified access mode. +* Attempts to open a database when it has already been opened will result in +* the throwing of the exception <code>DatabaseOpenException</code>. +* A <code>DatabaseNotFoundException</code> is thrown if the database does not exist. +* Some implementations may throw additional exceptions that are also derived from +* <code>ODMGException</code>. +* @param name The name of the database. +* @param accessMode The access mode, which should be one of the static fields: +* <code>OPEN_READ_ONLY</code>, <code>OPEN_READ_WRITE</code>, +* or <code>OPEN_EXCLUSIVE</code>. +* @exception ODMGException The database could not be opened. +*/ + public void open(String name, int accessMode) throws ODMGException; + +/** +* Close the database. +* After you have closed a database, further attempts to access objects in the +* database will cause the exception <code>DatabaseClosedException</code> to be thrown. +* Some implementations may throw additional exceptions that are also derived +* from <code>ODMGException</code>. +* @exception ODMGException Unable to close the database. +*/ + public void close() throws ODMGException; + +/** +* Associate a name with an object and make it persistent, +* <BR><I> not yet available in RasDaMan. </BR></I> +* An object instance may be bound to more than one name. +* Binding a previously transient object to a name makes that object persistent. +* @param object The object to be named. +* @param name The name to be given to the object. +* @exception org.odmg.ObjectNameNotUniqueException +* If an attempt is made to bind a name to an object and that name is already bound +* to an object. +*/ + public void bind(Object object, String name) throws ObjectNameNotUniqueException; + +/** +* Lookup an object via its name, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param name The name of an object. +* @return The object with that name. +* @exception ObjectNameNotFoundException There is no object with the specified name. +* @see ObjectNameNotFoundException +*/ + public Object lookup(String name) throws ObjectNameNotFoundException; + +/** +* Disassociate a name with an object, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param name The name of an object. +* @exception ObjectNameNotFoundException No object exists in the database with that name. +*/ + public void unbind(String name) throws ObjectNameNotFoundException; + +/** +* Make a transient object durable in the database, +* <BR><I> not yet available in RasDaMan. </BR></I> +* It must be executed in the context of an open transaction. +* If the transaction in which this method is executed commits, +* then the object is made durable. +* If the transaction aborts, +* then the makePersistent operation is considered not to have been executed, +* and the target object is again transient. +* ClassNotPersistenceCapableException is thrown if the implementation cannot make +* the object persistent because of the type of the object. +* @param object The object to make persistent. +*/ + public void makePersistent(Object object); + +/** +* Deletes an object from the database, +* <BR><I> not yet available in RasDaMan. </BR></I> +* It must be executed in the context of an open transaction. +* If the object is not persistent, then ObjectNotPersistent is thrown. +* If the transaction in which this method is executed commits, +* then the object is removed from the database. +* If the transaction aborts, +* then the deletePersistent operation is considered not to have been executed, +* and the target object is again in the database. +* @param object The object to delete. +*/ + public void deletePersistent(Object object); +} + diff --git a/java/org/odmg/DatabaseClosedException.class b/java/org/odmg/DatabaseClosedException.class Binary files differnew file mode 100644 index 0000000..11a3969 --- /dev/null +++ b/java/org/odmg/DatabaseClosedException.class diff --git a/java/org/odmg/DatabaseClosedException.java b/java/org/odmg/DatabaseClosedException.java new file mode 100644 index 0000000..134e53c --- /dev/null +++ b/java/org/odmg/DatabaseClosedException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when an attempt is made to call a method +* on a Database that has been closed or has not been opened. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database +*/ + +public class DatabaseClosedException extends ODMGRuntimeException +{ +/** +* Construct an instance of the exception without a message. +*/ + public DatabaseClosedException() + { + super(); + } +/** +* Construct an instance of the exception with the provided message. +* @param msg A message indicating why the exception occurred. +*/ + public DatabaseClosedException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/DatabaseIsReadOnlyException.class b/java/org/odmg/DatabaseIsReadOnlyException.class Binary files differnew file mode 100644 index 0000000..e56d554 --- /dev/null +++ b/java/org/odmg/DatabaseIsReadOnlyException.class diff --git a/java/org/odmg/DatabaseIsReadOnlyException.java b/java/org/odmg/DatabaseIsReadOnlyException.java new file mode 100644 index 0000000..4640372 --- /dev/null +++ b/java/org/odmg/DatabaseIsReadOnlyException.java @@ -0,0 +1,53 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when a call has been made that modifies +* a database that is open in read-only mode. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database +* @see org.odmg.ODMGRuntimeException +*/ + +public class DatabaseIsReadOnlyException extends ODMGRuntimeException +{ +/** +* Construct an instance of the exception without a message. +*/ + public DatabaseIsReadOnlyException() + { + super(); + } + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A message indicating why the exception occurred. +*/ + public DatabaseIsReadOnlyException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/DatabaseNotFoundException.class b/java/org/odmg/DatabaseNotFoundException.class Binary files differnew file mode 100644 index 0000000..87a8eb1 --- /dev/null +++ b/java/org/odmg/DatabaseNotFoundException.class diff --git a/java/org/odmg/DatabaseNotFoundException.java b/java/org/odmg/DatabaseNotFoundException.java new file mode 100644 index 0000000..0151685 --- /dev/null +++ b/java/org/odmg/DatabaseNotFoundException.java @@ -0,0 +1,53 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when attempting to open a database that does not exist. +* This could be caused by the name provided to <code>Database.open</code> being incorrect. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database#open +*/ + +public class DatabaseNotFoundException extends ODMGException +{ +/** +* Construct an instance of the exception. +*/ + public DatabaseNotFoundException() + { + super(); + } + + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A message indicating why the exception occurred. +*/ + public DatabaseNotFoundException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/DatabaseOpenException.class b/java/org/odmg/DatabaseOpenException.class Binary files differnew file mode 100644 index 0000000..d05e8b4 --- /dev/null +++ b/java/org/odmg/DatabaseOpenException.class diff --git a/java/org/odmg/DatabaseOpenException.java b/java/org/odmg/DatabaseOpenException.java new file mode 100644 index 0000000..f34238a --- /dev/null +++ b/java/org/odmg/DatabaseOpenException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when attempting to open a database that is already open. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database#open +*/ + +public class DatabaseOpenException extends ODMGException +{ +/** +* Construct an instance of the exception. +*/ + public DatabaseOpenException() + { + super(); + } + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A message indicating why the exception occurred. +*/ + public DatabaseOpenException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/Implementation.class b/java/org/odmg/Implementation.class Binary files differnew file mode 100644 index 0000000..07165c9 --- /dev/null +++ b/java/org/odmg/Implementation.class diff --git a/java/org/odmg/Implementation.java b/java/org/odmg/Implementation.java new file mode 100644 index 0000000..f2d2e6f --- /dev/null +++ b/java/org/odmg/Implementation.java @@ -0,0 +1,113 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The factory interface for a particular ODMG implementation. +* Each ODMG implementation will have a class that implements this interface. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public interface Implementation { +/** +* Create a <code>Transaction</code> object and associate it with the current thread. +* @return The newly created <code>Transaction</code> instance. +* @see org.odmg.Transaction +*/ + public Transaction newTransaction(); + +/** +* Get the current <code>Transaction</code> for the thread. +* @return The current <code>Transaction</code> object or null if there is none. +* @see org.odmg.Transaction +*/ + public Transaction currentTransaction(); + +/** +* Create a new <code>Database</code> object. +* @return The new <code>Database</code> object. +* @see org.odmg.Database +*/ + public Database newDatabase(); + +/** +* Create a new <code>OQLQuery</code> object. +* @return The new <code>OQLQuery</code> object. +* @see org.odmg.OQLQuery +*/ + public OQLQuery newOQLQuery(); + +/** +* Create a new <code>DList</code> object. +* @return The new <code>DList</code> object. +* @see org.odmg.DList +*/ + public DList newDList(); + +/** +* Create a new <code>DBag</code> object. +* @return The new <code>DBag</code> object. +* @see org.odmg.DBag +*/ + public DBag newDBag(); + +/** +* Create a new <code>DSet</code> object. +* @return The new <code>DSet</code> object. +* @see org.odmg.DSet +*/ + public DSet newDSet(); + +/** +* Create a new <code>DArray</code> object, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @return The new <code>DArray</code> object. +* @see org.odmg.DArray +*/ + public DArray newDArray(); + +/** +* Create a new <code>DMap</code> object, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @return The new <code>DMap</code> object. +* @see org.odmg.DMap +*/ + public DMap newDMap(); + +/** +* Get a <code>String</code> representation of the object's identifier. +* @param obj The object whose identifier is being accessed. +* @return The object's identifier in the form of a String +*/ + public String getObjectId(Object obj); + +/** +* Get the <code>Database</code> that contains the object <code>obj</code>, +* <BR><I> not yet available in RasDaMan. </BR></I> +* @param obj The object. +* @return The <code>Database</code> that contains the object. +*/ + public Database getDatabase(Object obj); +} + diff --git a/java/org/odmg/LockNotGrantedException.class b/java/org/odmg/LockNotGrantedException.class Binary files differnew file mode 100644 index 0000000..b5e7928 --- /dev/null +++ b/java/org/odmg/LockNotGrantedException.class diff --git a/java/org/odmg/LockNotGrantedException.java b/java/org/odmg/LockNotGrantedException.java new file mode 100644 index 0000000..4287d2c --- /dev/null +++ b/java/org/odmg/LockNotGrantedException.java @@ -0,0 +1,66 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown if a lock could not be granted on an object. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class LockNotGrantedException extends ODMGRuntimeException +{ +/** +* Construct an instance of the exception. +*/ + public LockNotGrantedException() + { + super(); + } + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A description of the exception. +*/ + public LockNotGrantedException(String msg) + { + super(msg); + } +/* + private Object o; + private int m; +* +* Construct an instance of the exception. +* @param obj The object that the application was trying to acquire a lock on. +* @param mode The lock mode that the application was attempting to acquire. +* @see org.odmg.Transaction#lock +* + public LockNotGrantedException(Object obj, int mode) + { + super(); + o = obj; + m = mode; + } +*/ +} + diff --git a/java/org/odmg/Makefile b/java/org/odmg/Makefile new file mode 100644 index 0000000..a50c9b4 --- /dev/null +++ b/java/org/odmg/Makefile @@ -0,0 +1,66 @@ +# -*-Makefile-*- (for Emacs) +# +# This file is part of rasdaman community. +# +# Rasdaman community is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Rasdaman community is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +# +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +# rasdaman GmbH. +# +# For more information please see <http://www.rasdaman.org> +# or contact Peter Baumann via <baumann@rasdaman.com>. # Top Level makefile. This points to the various modules that have to be build +# and/or deployed +# +# MAKEFILE FOR: +# package RasJ +# +# COMMENTS: +# +################################################################## +######################### Definitions ############################ + +# standard include with general options +include $(RMANBASE)/Makefile.inc + +# directory where HTML documentation is created +DOCDIR := $(DOCBASE)/java/org + +########################### Targets ############################## + +SRCS = DArray.java DatabaseOpenException.java ObjectNotPersistentException.java \ + DBag.java Implementation.java QueryException.java DCollection.java \ + LockNotGrantedException.java QueryInvalidException.java \ + DList.java NotImplementedException.java QueryParameterCountInvalidException.java \ + DMap.java ODMGException.java QueryParameterTypeInvalidException.java \ + DSet.java ODMGRuntimeException.java Transaction.java Database.java \ + OQLQuery.java TransactionAbortedException.java DatabaseClosedException.java \ + ObjectDeletedException.java TransactionInProgressException.java \ + DatabaseIsReadOnlyException.java DatabaseNotFoundException.java ObjectNameNotFoundException.java \ + TransactionNotInProgressException.java +OBJS = ${SRCS:%.java=%.class} +MISCCLEAN = *.class + +########################### Targets ############################## + +# compile everything +.PHONY : all +all: $(OBJS) + + +# delete all files +empty: + -rm -f $(SRCS) $(MISCCLEAN) + +# general rules +include $(RMANBASE)/Makefile.rel diff --git a/java/org/odmg/Makefile.dep b/java/org/odmg/Makefile.dep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/java/org/odmg/Makefile.dep diff --git a/java/org/odmg/NotImplementedException.class b/java/org/odmg/NotImplementedException.class Binary files differnew file mode 100644 index 0000000..31eef9e --- /dev/null +++ b/java/org/odmg/NotImplementedException.class diff --git a/java/org/odmg/NotImplementedException.java b/java/org/odmg/NotImplementedException.java new file mode 100644 index 0000000..db90b14 --- /dev/null +++ b/java/org/odmg/NotImplementedException.java @@ -0,0 +1,49 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ + +package org.odmg; +/** +* This exception is thrown when an implementation does not support an operation. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class NotImplementedException extends ODMGRuntimeException +{ +/** +* Construct an instance of the exception. +*/ + public NotImplementedException() + { + super(); + } + +/** +* Construct an instance of the exception. +* @param msg A string providing a description of the exception. +*/ + public NotImplementedException(String msg) + { + super(msg); + } +} diff --git a/java/org/odmg/ODMGException.class b/java/org/odmg/ODMGException.class Binary files differnew file mode 100644 index 0000000..1333641 --- /dev/null +++ b/java/org/odmg/ODMGException.class diff --git a/java/org/odmg/ODMGException.java b/java/org/odmg/ODMGException.java new file mode 100644 index 0000000..866bec5 --- /dev/null +++ b/java/org/odmg/ODMGException.java @@ -0,0 +1,49 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This is the base class for all exceptions thrown by an ODMG implementation. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class ODMGException extends Exception { +/** +* Construct an <code>ODMGException</code> object without an error message. +*/ + public ODMGException() + { + super(); + } +/** +* Construct an <code>ODMGException</code> object with an error message. +* @param msg The error message associated with this exception. +*/ + + public ODMGException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/ODMGRuntimeException.class b/java/org/odmg/ODMGRuntimeException.class Binary files differnew file mode 100644 index 0000000..d5182c6 --- /dev/null +++ b/java/org/odmg/ODMGRuntimeException.class diff --git a/java/org/odmg/ODMGRuntimeException.java b/java/org/odmg/ODMGRuntimeException.java new file mode 100644 index 0000000..c124d00 --- /dev/null +++ b/java/org/odmg/ODMGRuntimeException.java @@ -0,0 +1,50 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This is the base class for all RuntimeExceptions thrown by an ODMG implementation. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class ODMGRuntimeException extends RuntimeException { + +/** +* Construct an instance of the exception. +*/ + public ODMGRuntimeException() + { + super(); + } + +/** +* Construct an instance of the exception with the specified message. +* @param msg The message associated with the exception. +*/ + public ODMGRuntimeException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/OQLQuery.class b/java/org/odmg/OQLQuery.class Binary files differnew file mode 100644 index 0000000..5910baa --- /dev/null +++ b/java/org/odmg/OQLQuery.class diff --git a/java/org/odmg/OQLQuery.java b/java/org/odmg/OQLQuery.java new file mode 100644 index 0000000..9d09c4f --- /dev/null +++ b/java/org/odmg/OQLQuery.java @@ -0,0 +1,86 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* The interface to an OQL query object. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public interface OQLQuery { + +/** +* Create an OQL query from the string parameter. +* In order to execute a query, an <code>OQLQuery</code> object must be created +* by calling <code>Implementation.newOQLQuery</code>, then calling the +* <code>create</code> method with the query string. +* The <code>create</code> method might throw <code>QueryInvalidException</code> +* if the query could not be compiled properly. Some implementations may not want +* to compile the query before <code>execute</code> is called. In this case +* <code>QueryInvalidException</code> is thrown when <code>execute</code> is called. +* @param query An OQL query. +* @exception QueryInvalidException The query syntax is invalid. +*/ + public void create(String query) throws QueryInvalidException; + +/** +* Bind a parameter to the query. +* A parameter is denoted in the query string passed to <code>create</code> by <i>$i</i>, +* where <i>i</i> is the rank of the parameter, beginning with 1. +* The parameters are set consecutively by calling this method <code>bind</code>. +* The <i>ith</i> variable is set by the <i>ith</i> call to the <code>bind</code> method. +* If any of the <i>$i</i> are not set by a call to <code>bind</code> at the point +* <code>execute</code> is called, <code>QueryParameterCountInvalidException</code> is thrown. +* The parameters must be objects, and the result is an <code>Object</code>. +* Objects must be used instead of primitive types (<code>Integer</code> instead +* of <code>int</code>) for passing the parameters. +* <P> +* If the parameter is of the wrong type, +* <code>QueryParameterTypeInvalidException</code> is thrown. +* After executing a query, the parameter list is reset. +* @param parameter A value to be substituted for a query parameter. +* @exception QueryParameterCountInvalidException The number of calls to +* <code>bind</code> has exceeded the number of parameters in the query. +* @exception QueryParameterTypeInvalidException The type of the parameter does +* not correspond with the type of the parameter in the query. +*/ + public void bind(Object parameter) throws QueryParameterCountInvalidException, + QueryParameterTypeInvalidException; + +/** +* Execute the query. +* After executing a query, the parameter list is reset. +* Some implementations may throw additional exceptions that are also derived +* from <code>ODMGException</code>. +* @return The object that represents the result of the query. +* The returned data, whatever its OQL type, is encapsulated into an object. +* For instance, when OQL returns an integer, the result is put into an +* <code>Integer</code> object. When OQL returns a collection (literal or object), +* the result is always a Java collection object of the same kind +* (for instance, a <code>DList</code>). +* @exception QueryException An exception has occurred while executing the query. +*/ + public Object execute() throws QueryException; +} + diff --git a/java/org/odmg/ObjectDeletedException.class b/java/org/odmg/ObjectDeletedException.class Binary files differnew file mode 100644 index 0000000..962c25d --- /dev/null +++ b/java/org/odmg/ObjectDeletedException.class diff --git a/java/org/odmg/ObjectDeletedException.java b/java/org/odmg/ObjectDeletedException.java new file mode 100644 index 0000000..dfdcc6c --- /dev/null +++ b/java/org/odmg/ObjectDeletedException.java @@ -0,0 +1,50 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when accessing an object that was deleted. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class ObjectDeletedException extends ODMGRuntimeException +{ + +/** +* Construct an instance of the exception. +*/ + public ObjectDeletedException() + { + super(); + } + +/** +* Construct an instance of the exception. +* @param msg A string providing a description of the exception. +*/ + public ObjectDeletedException(String msg) + { + super(msg); + } +} diff --git a/java/org/odmg/ObjectNameNotFoundException.class b/java/org/odmg/ObjectNameNotFoundException.class Binary files differnew file mode 100644 index 0000000..fcc0b2b --- /dev/null +++ b/java/org/odmg/ObjectNameNotFoundException.class diff --git a/java/org/odmg/ObjectNameNotFoundException.java b/java/org/odmg/ObjectNameNotFoundException.java new file mode 100644 index 0000000..a0f4e01 --- /dev/null +++ b/java/org/odmg/ObjectNameNotFoundException.java @@ -0,0 +1,74 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* An attempt to get a object via its name using <code>Database.lookup</code> +* and the name is not associated with an object in the database. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database#lookup +*/ + +public class ObjectNameNotFoundException extends ODMGException +{ +/** +* Construct an instance of the exception. +*/ + public ObjectNameNotFoundException() + { + super(); + } + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A message describing the exception. +*/ + public ObjectNameNotFoundException(String msg) + { + super(msg); + } +/* + private String n; + +* Construct an instance of the exception. +* @param name The name passed to Database.lookup that is not associated with +* any object in the database. + + public ObjectNameNotFoundException(String name) + { + super(); + n = name; + } + + +* Access the name that is not bound to any object in the database. +* @return The name that was passed to Database.lookup. + + public String getName() + { + return n; + } +*/ +} + diff --git a/java/org/odmg/ObjectNameNotUniqueException.class b/java/org/odmg/ObjectNameNotUniqueException.class Binary files differnew file mode 100644 index 0000000..99573a6 --- /dev/null +++ b/java/org/odmg/ObjectNameNotUniqueException.class diff --git a/java/org/odmg/ObjectNameNotUniqueException.java b/java/org/odmg/ObjectNameNotUniqueException.java new file mode 100644 index 0000000..8d18ae7 --- /dev/null +++ b/java/org/odmg/ObjectNameNotUniqueException.java @@ -0,0 +1,80 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when attempting to bind a name to an object +* when the name is already bound to another object. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see org.odmg.Database#bind +*/ + +public class ObjectNameNotUniqueException extends ODMGException +{ +/** +* Construct an instance of the exception. +*/ + public ObjectNameNotUniqueException() + { + super(); + } + +/** +* Construct an instance of the exception with a descriptive message. +* @param msg A message containing a description of the exception. +*/ + public ObjectNameNotUniqueException(String msg) + { + super(msg); + } +/* + private Object o; + private String n; + public ObjectNameNotUniqueException(Object obj, String name) + { + super(); + o = obj; + n = name; + } + + +* Get the object that was passed to Database.bind. +* @return The object that was being bound to a name. + + public Object getObject() + { + return o; + } + + +* Get the name that is not unique. +* @return The name that is already associated with another object. + + public String getName() + { + return n; + } +*/ +} + diff --git a/java/org/odmg/ObjectNotPersistentException.class b/java/org/odmg/ObjectNotPersistentException.class Binary files differnew file mode 100644 index 0000000..c3f015d --- /dev/null +++ b/java/org/odmg/ObjectNotPersistentException.class diff --git a/java/org/odmg/ObjectNotPersistentException.java b/java/org/odmg/ObjectNotPersistentException.java new file mode 100644 index 0000000..15dbfdf --- /dev/null +++ b/java/org/odmg/ObjectNotPersistentException.java @@ -0,0 +1,49 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when deleting an object that is not persistent. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class ObjectNotPersistentException extends ODMGRuntimeException { + +/** +* Construct an instance of the exception. +*/ + public ObjectNotPersistentException() + { + super(); + } + +/** +* Construct an instance of the exception. +* @param msg A string providing a description of the exception. +*/ + public ObjectNotPersistentException(String msg) + { + super(msg); + } +} diff --git a/java/org/odmg/QueryException.class b/java/org/odmg/QueryException.class Binary files differnew file mode 100644 index 0000000..dda9522 --- /dev/null +++ b/java/org/odmg/QueryException.class diff --git a/java/org/odmg/QueryException.java b/java/org/odmg/QueryException.java new file mode 100644 index 0000000..ab7a855 --- /dev/null +++ b/java/org/odmg/QueryException.java @@ -0,0 +1,50 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This is the base class for all exceptions associated with queries. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class QueryException extends ODMGException { +/** +* Constructs an instance of the exception. +*/ + public QueryException() + { + super(); + } + +/** +* Constructs an instance of the exception with a message indicating the reason +* for the exception. +* @param msg A message indicating the reason for the exception. +*/ + public QueryException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/QueryInvalidException.class b/java/org/odmg/QueryInvalidException.class Binary files differnew file mode 100644 index 0000000..59b997d --- /dev/null +++ b/java/org/odmg/QueryInvalidException.class diff --git a/java/org/odmg/QueryInvalidException.java b/java/org/odmg/QueryInvalidException.java new file mode 100644 index 0000000..25ea648 --- /dev/null +++ b/java/org/odmg/QueryInvalidException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown if the query is not a valid OQL query. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class QueryInvalidException extends QueryException +{ +/** +* Construct an instance of the exception. +*/ + public QueryInvalidException() + { + super(); + } + +/** +* Construct an instance of the exception. +* @param msg A string indicating why the <code>OQLQuery</code> instance does not +* represent a valid OQL query. +*/ + public QueryInvalidException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/QueryParameterCountInvalidException.class b/java/org/odmg/QueryParameterCountInvalidException.class Binary files differnew file mode 100644 index 0000000..906976d --- /dev/null +++ b/java/org/odmg/QueryParameterCountInvalidException.class diff --git a/java/org/odmg/QueryParameterCountInvalidException.java b/java/org/odmg/QueryParameterCountInvalidException.java new file mode 100644 index 0000000..c14fc47 --- /dev/null +++ b/java/org/odmg/QueryParameterCountInvalidException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when the number of bound parameters for a query +* does not match the number of placeholders. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class QueryParameterCountInvalidException extends QueryException +{ +/** +* Construct an instance of the exception. +*/ + public QueryParameterCountInvalidException() + { + super(); + } + +/** +* Construct an instance of the exception with a message. +* @param msg A message indicating why the exception has been thrown. +*/ + public QueryParameterCountInvalidException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/QueryParameterTypeInvalidException.class b/java/org/odmg/QueryParameterTypeInvalidException.class Binary files differnew file mode 100644 index 0000000..0c0aabb --- /dev/null +++ b/java/org/odmg/QueryParameterTypeInvalidException.class diff --git a/java/org/odmg/QueryParameterTypeInvalidException.java b/java/org/odmg/QueryParameterTypeInvalidException.java new file mode 100644 index 0000000..7ce81ea --- /dev/null +++ b/java/org/odmg/QueryParameterTypeInvalidException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when the type of a query parameter +* is not compatible with the expected type. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class QueryParameterTypeInvalidException extends QueryException +{ +/** +* Construct an instance of the exception. +*/ + public QueryParameterTypeInvalidException() + { + super(); + } + +/** +* Construct an instance of the exception with a message. +* @param msg The message explaining details of the exception. +*/ + public QueryParameterTypeInvalidException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/Transaction.class b/java/org/odmg/Transaction.class Binary files differnew file mode 100644 index 0000000..0f5095b --- /dev/null +++ b/java/org/odmg/Transaction.class diff --git a/java/org/odmg/Transaction.java b/java/org/odmg/Transaction.java new file mode 100644 index 0000000..9cfb2b8 --- /dev/null +++ b/java/org/odmg/Transaction.java @@ -0,0 +1,165 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This interfaces provides the operations necessary to perform database transactions. +* All access, creation, and modification of persistent objects and their fields +* must be done within a transaction. Before performing any database operations, +* a thread must explicitly create a transaction object or associate itself with +* an existing transaction object (by calling <code>join</code>), +* and that transaction must be open (through a call to <code>begin</code>). +* All subsequent operations by the thread, including reads, writes, and lock +* acquisitions, are done under the thread’s current transaction. +* <P> +* A thread may only operate on its current transaction. For example, +* a <code>TransactionNotInProgressException</code> is thrown if a thread attempts +* to begin, commit, checkpoint, or abort a transaction prior to joining itself +* to that transaction. +* <P> +* A transaction is either <i>open</i> or <i>closed</i>. A transaction is open if a call +* has been made to <code>begin</code>, but no call has been made to <code>commit</code> or +* <code>abort</code>. Once <code>commit</code> or <code>abort</code> is called, +* the transaction is closed. The method <code>isOpen</code> can be called to +* determine the state of the transaction. +* <P> +* Read locks are implicitly obtained on objects as they are accessed. +* Write locks are implicitly obtained as objects are modified. +* <code>Transaction</code> objects are transient, they cannot be stored in the database. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see TransactionNotInProgressException +*/ + +public interface Transaction { +/** +* Attach the caller's thread to this <code>Transaction</code> and detach the thread +* from any former <code>Transaction</code> the thread may have been associated with, +* <BR><I> not yet available in rasdaman. </BR></I> +*/ + public void join(); + +/** +* Detach the caller's thread from this <code>Transaction</code>, but do not attach +* the thread to another <code>Transaction</code>, +* <BR><I> not yet available in rasdaman. </BR></I> +*/ + public void leave(); + +/** +* Start a transaction. +* Calling <code>begin</code> multiple times on the same transaction object, +* without an intervening call to <code>commit</code> or <code>abort</code>, +* causes the exception <code>TransactionInProgressException</code> to be thrown +* on the second and subsequent calls. Operations executed before a transaction +* has been opened, or before reopening after a transaction is aborted or committed, +* have undefined results; +* these may throw a <code>TransactionNotInProgressException</code> exception. +*/ + public void begin(); + +/** +* Determine whether the transaction is open or not. +* A transaction is open if a call has been made to <code>begin</code>, +* but a subsequent call to either <code>commit</code> or <code>abort</code> +* has not been made. +* @return True if the transaction is open, otherwise false. +*/ + public boolean isOpen(); + +/** +* Commit and close the transaction. +* Calling <code>commit</code> commits to the database all persistent object +* modifications within the transaction and releases any locks held by the transaction. +* A persistent object modification is an update of any field of an existing +* persistent object, or an update or creation of a new named object in the database. +* If a persistent object modification results in a reference from an existing +* persistent object to a transient object, the transient object is moved to the +* database, and all references to it updated accordingly. Note that the act of +* moving a transient object to the database may create still more persistent +* references to transient objects, so its referents must be examined and moved as well. +* This process continues until the database contains no references to transient objects, +* a condition that is guaranteed as part of transaction commit. +* Committing a transaction does not remove from memory transient objects created +* during the transaction +*/ + public void commit(); + +/** +* Abort and close the transaction. +* Calling abort abandons all persistent object modifications and releases the +* associated locks. +* Aborting a transaction does not restore the state of modified transient objects +*/ + public void abort(); + +/** +* Commit the transaction, but reopen the transaction, retaining all locks. +* Calling <code>checkpoint</code> commits persistent object modifications made +* within the transaction since the last checkpoint to the database. +* The transaction retains all locks it held on those objects at the time the +* checkpoint was invoked. +*/ + public void checkpoint(); + +/** +* Read lock mode. +*/ + public static final int READ = 1; + +/** +* Upgrade lock mode. +*/ + public static final int UPGRADE = 2; + +/** +* Write lock mode. +*/ + public static final int WRITE = 4; + +/** +* Upgrade the lock on the given object to the given lock mode, +* <BR><I> not yet available in rasdaman. </BR></I> +* The call has no effect if the object's current lock is already at or above +* that level of lock mode. +* @param obj The object to acquire a lock on. +* @param lockMode The lock mode to acquire. The lock modes are <code>READ</code>, +* <code>UPGRADE</code>, and <code>WRITE</code>. +* @exception LockNotGrantedException Is thrown if the given lock mode could not be acquired. +*/ + public void lock(Object obj, int lockMode) + throws LockNotGrantedException; +/** +* Upgrade the lock on the given object to the given lock mode, +* <BR><I> not yet available in rasdaman. </BR></I> +* Method <code>tryLock</code> is the same as <code>lock</code> except it returns +* a boolean indicating whether the lock was granted instead of generating an exception. +* @param obj The object to acquire a lock on. +* @param lockMode The lock mode to acquire. The lock modes are <code>READ</code>, +* <code>UPGRADE</code>, and <code>WRITE</code>. +* @return True if the lock has been acquired, otherwise false. +*/ + public boolean tryLock(Object obj, int lockMode); + +} + diff --git a/java/org/odmg/TransactionAbortedException.class b/java/org/odmg/TransactionAbortedException.class Binary files differnew file mode 100644 index 0000000..d696a8a --- /dev/null +++ b/java/org/odmg/TransactionAbortedException.class diff --git a/java/org/odmg/TransactionAbortedException.java b/java/org/odmg/TransactionAbortedException.java new file mode 100644 index 0000000..0a1d0d3 --- /dev/null +++ b/java/org/odmg/TransactionAbortedException.java @@ -0,0 +1,52 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when the database asynchronously and explicitly +* aborts the user's transaction due to some failure, the user's data is reset +* just as if the user had directly called <code>Transaction.abort</code>. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class TransactionAbortedException extends ODMGRuntimeException +{ +/** +* Constructs an instance of the exception. +*/ + public TransactionAbortedException() + { + super(); + } + +/** +* Constructs an instance of the exception with the provided message. +* @param msg The message that describes the exception. +*/ + public TransactionAbortedException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/TransactionInProgressException.class b/java/org/odmg/TransactionInProgressException.class Binary files differnew file mode 100644 index 0000000..253a599 --- /dev/null +++ b/java/org/odmg/TransactionInProgressException.class diff --git a/java/org/odmg/TransactionInProgressException.java b/java/org/odmg/TransactionInProgressException.java new file mode 100644 index 0000000..1d1f908 --- /dev/null +++ b/java/org/odmg/TransactionInProgressException.java @@ -0,0 +1,51 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when a call has been made to a method that +* should not be called when a transaction is in progress. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +*/ + +public class TransactionInProgressException extends ODMGRuntimeException +{ +/** +* Constructs an instance of the exception. +*/ + public TransactionInProgressException() + { + super(); + } + +/** +* Constructs an instance of the exception with the provided message. +* @param msg The message explaining the exception. +*/ + public TransactionInProgressException(String msg) + { + super(msg); + } +} + diff --git a/java/org/odmg/TransactionNotInProgressException.class b/java/org/odmg/TransactionNotInProgressException.class Binary files differnew file mode 100644 index 0000000..2fa74e5 --- /dev/null +++ b/java/org/odmg/TransactionNotInProgressException.class diff --git a/java/org/odmg/TransactionNotInProgressException.java b/java/org/odmg/TransactionNotInProgressException.java new file mode 100644 index 0000000..9770671 --- /dev/null +++ b/java/org/odmg/TransactionNotInProgressException.java @@ -0,0 +1,53 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ +package org.odmg; + +/** +* This exception is thrown when attempting to perform an operation that +* must be performed when there is a transaction is in progress, but no +* such transaction is in progress. +* @author David Jordan (as Java Editor of the Object Data Management Group) +* @version ODMG 3.0 +* @see ODMGRuntimeException +*/ + +public class TransactionNotInProgressException extends ODMGRuntimeException +{ +/** +* Constructs an instance of the exception. +*/ + public TransactionNotInProgressException() + { + super(); + } + +/** +* Constructs an instance of the exception with the provided message. +* @param msg A message that describes the exception. +*/ + public TransactionNotInProgressException(String msg) + { + super(msg); + } +} + |