DatabaseAccessManager#
- public class DatabaseAccessManager#
Manages the read and write access to the database.
- Author:
tf
Methods#
acquireReadAccess#
- public Access acquireReadAccess(TransactionInterface t)#
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.
- Parameters:
t – the
TransactionInterfacewhich requests the read access
- Throws:
- Returns:
Accessobject which holds and abstract away all connection details.
acquireWriteAccess#
- public Access acquireWriteAccess(WriteTransactionInterface wt)#
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.
- Parameters:
wt –
the
WriteTransactionInterfacewhich request the acquisition of the write access.
- Throws:
- Returns:
Accessobject which holds and abstract away all connection details.
getAccountAccess#
- public static Access getAccountAccess(AccessControlTransaction t)#
Special access to be used for
AccessControlTransactions, mainly authentication and authorization.- Parameters:
t
getInfoAccess#
getInitAccess#
- public static Access getInitAccess(Initialization initialization)#
Special access to be used during the
Initializationof the caosdb server.- Parameters:
initialization
getInstance#
- public static DatabaseAccessManager getInstance()#
reserveWriteAccess#
- public Access reserveWriteAccess(WriteTransactionInterface wt)#
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.
- Parameters:
wt –
the
WriteTransactionInterfacewhich request the reservation of the write access.
- Throws:
- Returns:
Accessobject which holds and abstract away all connection details.