.. java:import:: java.util.concurrent Semaphore .. java:import:: java.util.concurrent.atomic AtomicInteger .. java:import:: java.util.concurrent.locks ReentrantLock .. java:import:: org.caosdb.server.database.access Access .. java:import:: org.caosdb.server.database.access AccessControlAccess .. java:import:: org.caosdb.server.database.access InfoAccess .. java:import:: org.caosdb.server.database.access InitAccess .. java:import:: org.caosdb.server.database.access TransactionAccess .. java:import:: org.caosdb.server.transaction AccessControlTransaction .. java:import:: org.caosdb.server.transaction TransactionInterface .. java:import:: org.caosdb.server.transaction WriteTransactionInterface .. java:import:: org.caosdb.server.utils Info .. java:import:: org.caosdb.server.utils Initialization .. java:import:: org.caosdb.server.utils Releasable DatabaseAccessManager ===================== .. java:package:: org.caosdb.server.database :noindex: .. java:type:: public class DatabaseAccessManager Manages the read and write access to the database. :author: tf Methods ------- acquireReadAccess ^^^^^^^^^^^^^^^^^ .. java:method:: public Access acquireReadAccess(TransactionInterface t) throws InterruptedException :outertype: DatabaseAccessManager Acquire read access. This method returns the Access object as soon as there are no active write permits. The returned Access object can be used to read in the data base back-end. Read access can be acquired parallel to other threads having read access or while another thread has \ *reserved*\ write access. As soon as any thread has requested to \ *acquire*\ write access, all other threads have to wait. :param t: the \ :java:ref:`TransactionInterface`\ which requests the read access :throws InterruptedException: :return: \ :java:ref:`Access`\ object which holds and abstract away all connection details. acquireWriteAccess ^^^^^^^^^^^^^^^^^^ .. java:method:: public Access acquireWriteAccess(WriteTransactionInterface wt) throws InterruptedException :outertype: DatabaseAccessManager Acquire write access. This method returns the Access object as soon as all already acquired read access permits have been released. When the write access is acquired, no other access can be acquired (read or write). The returned Access object can be used to read and write in the data base back-end. :param wt: - the \ :java:ref:`WriteTransactionInterface`\ which request the acquisition of the write access. :throws InterruptedException: :return: \ :java:ref:`Access`\ object which holds and abstract away all connection details. getAccountAccess ^^^^^^^^^^^^^^^^ .. java:method:: public static Access getAccountAccess(AccessControlTransaction t) :outertype: DatabaseAccessManager Special access to be used for \ :java:ref:`AccessControlTransaction`\ s, mainly authentication and authorization. :param t: getInfoAccess ^^^^^^^^^^^^^ .. java:method:: public static Access getInfoAccess(Info i) :outertype: DatabaseAccessManager Special access to be used by \ :java:ref:`Info`\ . :param i: getInitAccess ^^^^^^^^^^^^^ .. java:method:: public static Access getInitAccess(Initialization initialization) :outertype: DatabaseAccessManager Special access to be used during the \ :java:ref:`Initialization`\ of the caosdb server. :param initialization: getInstance ^^^^^^^^^^^ .. java:method:: public static DatabaseAccessManager getInstance() :outertype: DatabaseAccessManager reserveWriteAccess ^^^^^^^^^^^^^^^^^^ .. java:method:: public Access reserveWriteAccess(WriteTransactionInterface wt) throws InterruptedException :outertype: DatabaseAccessManager Reserve write access. This method returns the Access object as soon as there is no other reserved or acquired write access. The returned Access object can be used to read in the data base back-end. The reservation has no effect on granting of read access permits, but only one thread may at any time reserve or acquire write access. :param wt: - the \ :java:ref:`WriteTransactionInterface`\ which request the reservation of the write access. :throws InterruptedException: :return: \ :java:ref:`Access`\ object which holds and abstract away all connection details. whoHasReservedWriteAccess ^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Thread whoHasReservedWriteAccess() :outertype: DatabaseAccessManager Return the thread which has successfully reserved write access. This is the thread which will be the next to actually acquire write access.