00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef SESSION_IMPL_H
00017 #define SESSION_IMPL_H
00018 #include<DatabaseManager.h>
00019 #include<UserManager.h>
00020 #include<Session.h>
00021
00022 class DatabaseManagerImpl;
00023 class Database;
00024
00025 class SessionImpl : public Session
00026 {
00027 DatabaseManagerImpl *dbMgr;
00028 UserManager *uMgr;
00029
00030 char userName[IDENTIFIER_LENGTH];
00031 bool isAuthenticated;
00032 bool isDba;
00033
00034 public:
00035 SessionImpl()
00036 {
00037 dbMgr = NULL; uMgr = NULL;
00038 }
00039 ~SessionImpl()
00040 {
00041 close();
00042 }
00043
00044
00045 DbRetVal initSystemDatabase();
00046
00047 DbRetVal destroySystemDatabase();
00048
00049 DbRetVal open(const char*username, const char*password);
00050 DbRetVal close();
00051
00052 DatabaseManager* getDatabaseManager();
00053 UserManager* getUserManager();
00054
00055 DbRetVal startTransaction(IsolationLevel level);
00056 DbRetVal commit();
00057 DbRetVal rollback();
00058
00059 DbRetVal readConfigFile();
00060 Database* getSystemDatabase();
00061 private:
00062 DbRetVal authenticate(const char *username, const char *password);
00063 };
00064
00065 #endif