|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mega.gasp.platform.impl.DBManagerImpl
DBManager contains all the methods requiring an acces to the GASP DB.
Field Summary | |
private org.apache.log4j.Category |
cat
|
private java.sql.Connection |
connection
|
private javax.sql.DataSource |
dataSource
|
private java.lang.String |
dbUrl
|
private boolean |
isDBConnectivityOK
|
Constructor Summary | |
DBManagerImpl(PropertiesReader propertiesReader)
|
Method Summary | |
void |
closeDBConnection()
Close the DB connection. |
int |
generateActorID()
Generate a DB persistant Actor ID. |
Actor |
getActorIfAuthentificationOK(int aID,
java.lang.String username,
java.lang.String password)
Verify if the login authentification of an Actor is valid then return the authentified actor or null. |
boolean |
isDBConnectionOK()
Verify if the connection to the GASP DB is ok. |
private boolean |
isUserAllowed(java.sql.Statement statement,
java.lang.String uid,
int appID)
Determine by search the table rights if the user have the rigths to play the application appID. |
void |
openDBConnection()
Open a DB connection. |
int |
registerNewActor(java.lang.String uid,
int appID,
java.lang.String username,
java.lang.String password)
Register a new actor for the double (uid,appID) if the user have the appropriate rights. |
void |
saveLastUsedPseudo(int actorID,
java.lang.String pseudoName)
Saves in the DB the last used pseudo. |
private int |
userAlreadyRegistered(java.sql.Statement statement,
java.lang.String uid,
int appID)
Determine by search the table rights if the user have already an actorID. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.apache.log4j.Category cat
private java.sql.Connection connection
private javax.sql.DataSource dataSource
private java.lang.String dbUrl
private boolean isDBConnectivityOK
Constructor Detail |
public DBManagerImpl(PropertiesReader propertiesReader)
Method Detail |
public boolean isDBConnectionOK()
isDBConnectionOK
in interface DBManager
public void openDBConnection()
public void closeDBConnection()
public int generateActorID()
generateActorID
in interface DBManager
public Actor getActorIfAuthentificationOK(int aID, java.lang.String username, java.lang.String password)
getActorIfAuthentificationOK
in interface DBManager
aID
- the actor IDusername
- password
-
public int registerNewActor(java.lang.String uid, int appID, java.lang.String username, java.lang.String password)
registerNewActor
in interface DBManager
uid
- appID
- username
- password
-
private int userAlreadyRegistered(java.sql.Statement statement, java.lang.String uid, int appID)
statement
- the Statement of DBuid
- the User IDappID
- the Application ID
private boolean isUserAllowed(java.sql.Statement statement, java.lang.String uid, int appID)
statement
- the Statement of DBuid
- the User IDappID
- the Application ID
public void saveLastUsedPseudo(int actorID, java.lang.String pseudoName)
saveLastUsedPseudo
in interface DBManager
actorID
- pseudoName
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |