bwLehrpool Masterserver
Manages authentication and sharing of virtual machines between participating institutions
Static Public Member Functions | Static Package Functions | Static Private Attributes | List of all members
org.openslx.imagemaster.db.Database Class Reference
+ Collaboration diagram for org.openslx.imagemaster.db.Database:

Static Public Member Functions

static MysqlConnection getConnection ()
 Get a connection to the database. More...
 
static void printCharsetInformation ()
 
static void printDebug ()
 
static boolean isDuplicateKeyException (SQLException e)
 

Static Package Functions

 [static initializer]
 Static initializer for setting up the database connection. More...
 
static void returnConnection (MysqlConnection connection)
 Called by a MysqlConnection when its close()-method is called, so the connection will be added to the pool of available connections again. More...
 

Static Private Attributes

static final Logger LOGGER = LogManager.getLogger( Database.class )
 
static final Queue
< MysqlConnection
pool = new ConcurrentLinkedQueue<>()
 Pool of available connections. More...
 
static final Set< MysqlConnectionbusyConnections = Collections.newSetFromMap( new ConcurrentHashMap<MysqlConnection, Boolean>() )
 Set of connections currently handed out. More...
 
static final String host
 
static final String dbname
 
static final String user
 
static final String password
 

Detailed Description

Definition at line 22 of file Database.java.

Member Function Documentation

org.openslx.imagemaster.db.Database.[static initializer] ( )
staticpackage

Static initializer for setting up the database connection.

This gets called implicitly as soon as the class loader loads the class. In most cases that happens when the class is being accessed for the first time during run time.

static MysqlConnection org.openslx.imagemaster.db.Database.getConnection ( )
static

Get a connection to the database.

If there is a valid connection in the pool, it will be returned. Otherwise, a new connection is created. If there are more than 20 busy connections, null is returned.

Returns
connection to database, or null

Definition at line 92 of file Database.java.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static boolean org.openslx.imagemaster.db.Database.isDuplicateKeyException ( SQLException  e)
static

Definition at line 181 of file Database.java.

+ Here is the caller graph for this function:

static void org.openslx.imagemaster.db.Database.printCharsetInformation ( )
static

Definition at line 154 of file Database.java.

+ Here is the call graph for this function:

static void org.openslx.imagemaster.db.Database.printDebug ( )
static

Definition at line 175 of file Database.java.

static void org.openslx.imagemaster.db.Database.returnConnection ( MysqlConnection  connection)
staticpackage

Called by a MysqlConnection when its close()-method is called, so the connection will be added to the pool of available connections again.

Parameters
connection

Definition at line 147 of file Database.java.

+ Here is the caller graph for this function:

Member Data Documentation

final Set<MysqlConnection> org.openslx.imagemaster.db.Database.busyConnections = Collections.newSetFromMap( new ConcurrentHashMap<MysqlConnection, Boolean>() )
staticprivate

Set of connections currently handed out.

Definition at line 34 of file Database.java.

final String org.openslx.imagemaster.db.Database.dbname
staticprivate

Definition at line 37 of file Database.java.

final String org.openslx.imagemaster.db.Database.host
staticprivate

Definition at line 36 of file Database.java.

final Logger org.openslx.imagemaster.db.Database.LOGGER = LogManager.getLogger( Database.class )
staticprivate

Definition at line 25 of file Database.java.

final String org.openslx.imagemaster.db.Database.password
staticprivate

Definition at line 39 of file Database.java.

final Queue<MysqlConnection> org.openslx.imagemaster.db.Database.pool = new ConcurrentLinkedQueue<>()
staticprivate

Pool of available connections.

Definition at line 29 of file Database.java.

final String org.openslx.imagemaster.db.Database.user
staticprivate

Definition at line 38 of file Database.java.


The documentation for this class was generated from the following file: