|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.db.DataRepositoryPool
public class DataRepositoryPool
Created: Sep 4, 2010 2:13:22 PM
| Constructor Summary | |
|---|---|
DataRepositoryPool()
|
|
| Method Summary | |
|---|---|
void |
addRepo(DataRepository repo)
Method description |
boolean |
checkTable(String tableName)
Method description |
boolean |
checkTable(String tableName,
String createTableQuery)
The method checks whether a table for the given name exists in the database and if it does not, it automatically creates it. |
void |
commit()
Commits current transaction on the DataRepository connection. |
Statement |
createStatement(tigase.xmpp.BareJID user_id)
Method description |
void |
endTransaction()
Ends current transaction on the DataRepository connection. |
PreparedStatement |
getPreparedStatement(tigase.xmpp.BareJID user_id,
String stIdKey)
Method description |
String |
getResourceUri()
Method description |
void |
initPreparedStatement(String stIdKey,
String query)
Method description |
void |
initRepository(String resource_uri,
Map<String,String> params)
Method description |
void |
release(Statement stmt,
ResultSet rs)
Method description |
void |
releaseRepoHandle(DataRepository repo)
|
void |
rollback()
Rolls back started transaction on the DataRepository connection. |
void |
startTransaction()
Starts transaction on the DataRepository connection. |
DataRepository |
takeRepo(tigase.xmpp.BareJID user_id)
Method description |
DataRepository |
takeRepoHandle(tigase.xmpp.BareJID user_id)
Returns DataRepository instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataRepositoryPool()
| Method Detail |
|---|
public void addRepo(DataRepository repo)
repo - public DataRepository takeRepo(tigase.xmpp.BareJID user_id)
public DataRepository takeRepoHandle(tigase.xmpp.BareJID user_id)
DataRepositoryDataRepository instance. If this is a repository pool
then it returns particular instance from the pool. It this is a real
repository instance it returns itself. This is exclusive take, no other
thread may use this handle until it is returned to the pool.
takeRepoHandle in interface DataRepositoryuser_id - is user account ID for which we acquire the handle.
public void releaseRepoHandle(DataRepository repo)
releaseRepoHandle in interface DataRepository
public boolean checkTable(String tableName)
throws SQLException
checkTable in interface DataRepositorytableName -
SQLException
public boolean checkTable(String tableName,
String createTableQuery)
throws SQLException
DataRepository
checkTable in interface DataRepositorytableName - is a String value of the table name to checkcreateTableQuery - is a String with the query to create table
true boolean value if the table exist in
the database and false if the table was not found.
SQLException - if there was a problem accessing database.
public Statement createStatement(tigase.xmpp.BareJID user_id)
throws SQLException
createStatement in interface DataRepositorySQLException
public PreparedStatement getPreparedStatement(tigase.xmpp.BareJID user_id,
String stIdKey)
throws SQLException
getPreparedStatement in interface DataRepositorystIdKey -
SQLExceptionpublic String getResourceUri()
getResourceUri in interface DataRepository
public void initPreparedStatement(String stIdKey,
String query)
throws SQLException
initPreparedStatement in interface DataRepositorystIdKey - query -
SQLException
public void initRepository(String resource_uri,
Map<String,String> params)
throws SQLException
initRepository in interface DataRepositoryresource_uri - params -
SQLException
public void release(Statement stmt,
ResultSet rs)
release in interface DataRepositorystmt - rs -
public void startTransaction()
throws SQLException
DataRepository
startTransaction in interface DataRepositorySQLException
public void commit()
throws SQLException
DataRepository
commit in interface DataRepositorySQLException
public void rollback()
throws SQLException
DataRepository
rollback in interface DataRepositorySQLException
public void endTransaction()
throws SQLException
DataRepository
endTransaction in interface DataRepositorySQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||