123 #ifndef STDBMANAGER_HH
124 #define STDBMANAGER_HH
127 #include "StString.h"
129 #include "stdb_streams.h"
132 #include "StDbDefs.hh"
134 #include "StDbMessService.hh"
163 char* mstringDup(
const char* str);
175 const char* configName,
int opt=0) =0;
176 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain) =0;
177 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain,
178 const char* configName,
int opt=0) =0;
179 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain,
180 unsigned int requestTime,
int opt=0) =0;
182 unsigned int requestTime,
int opt=0) =0;
184 virtual char* getConfigNodeName(StDbType t, StDbDomain d) =0;
185 virtual char* getExternalVersion(StDbType t,StDbDomain d) =0;
186 virtual dbEnvList* getEnvList(
const char* name) =0;
189 virtual StDbTable* newDbTable(
const char* dbName,
const char* tName)=0;
193 virtual StDataBaseI* findDb(StDbType type, StDbDomain domain) =0;
195 virtual StDataBaseI* findDb(
const char* databaseName) =0;
196 virtual StDbServer* findServer(StDbType type, StDbDomain domain) =0;
198 virtual StDbServer* findServer(
const char* type,
const char* domain) =0;
199 virtual StDbServer* findServer(
const char* databaseName) =0;
203 virtual char* getDbTypeName(StDbType type) =0;
204 virtual char* getDbDomainName(StDbDomain domain) =0;
205 virtual StDbType getDbType(
const char* typeName) =0;
206 virtual StDbDomain getDbDomain(
const char* domainName) =0;
207 virtual char* getDbName(
const char* typeName,
const char* domName)=0;
208 virtual char* printDbName(StDbType type, StDbDomain domain) =0;
210 virtual void blacklistDbDomain(
const char* domainName) =0;
213 virtual void setRequestTime(
unsigned int time) =0;
214 virtual void setRequestTime(
const char* time) =0;
215 virtual unsigned int getUnixRequestTime() =0;
216 virtual char* getDateRequestTime() =0;
217 virtual unsigned int getUnixCheckTime() =0;
218 virtual char* getDateCheckTime() =0;
219 virtual void setStoreTime(
unsigned int time) =0;
220 virtual void setStoreTime(
const char* time) =0;
221 virtual unsigned int getUnixStoreTime() =0;
222 virtual char* getDateStoreTime() =0;
225 virtual bool getDataBaseInfo(
const char* dbname,
226 char*& type,
char*& domain) =0;
227 virtual bool getDataBaseInfo(
const char* dbname,
228 StDbType& type, StDbDomain& domain) =0;
231 virtual bool IsValid(
StDbTable* table) =0;
232 virtual bool fetchDbTable(
StDbTable* table) =0;
233 virtual bool fetchDbTable(
StDbTable* table,
char* whereClause) =0;
235 virtual bool storeDbTable(
StDbTable* table,
bool commitWhenDone=
true) =0;
237 bool commitWhenDone=
true) =0;
239 int& configID,
bool commitWhenDone=
true) =0;
244 virtual bool rollBack(
StDbNode* node) =0;
245 virtual bool rollBack(
StDbTable* table) =0;
250 virtual void closeAllConnections() =0;
252 virtual void closeConnection(
StDbNode* node) =0;
254 virtual void printTimeStats() =0;
257 virtual bool IsVerbose()
const;
258 virtual void setVerbose(
bool isVerbose);
259 virtual bool IsQuiet()
const ;
260 virtual void setQuiet(
bool isQuiet);
261 virtual void turnOffTimeLogging();
262 virtual void updateMessLevel();
265 virtual int printInfo(
const char* m1, StDbMessLevel ml,
266 int lineNumber=0,
const char* className=
" ",
267 const char* methodName=
" ") ;
268 virtual int printInfo(
const char* m1,
const char* m2,
269 StDbMessLevel ml,
int lineNumber=0,
270 const char* className=
" ",
271 const char* methodName=
" ");
273 virtual char* userName();
274 virtual char* pWord();
275 virtual void setUser(
const char* userName,
const char* pWord);
284 inline bool StDbManager::IsVerbose()
const {
return misVerbose;};
285 inline void StDbManager::setVerbose(
bool isVerbose){
286 misVerbose=isVerbose;
290 inline bool StDbManager::IsQuiet()
const {
return misQuiet;};
291 inline void StDbManager::setQuiet(
bool isQuiet){
293 if(isQuiet) misVerbose=
false;
296 inline void StDbManager::updateMessLevel(){
299 if(misVerbose)
Messenger->setMessLevel(dbMDebug);
307 inline char* StDbManager::userName() {
return muserName; }
308 inline char* StDbManager::pWord() {
return mpWord; }
bool misQuiet
3 levels of verbosity: verbose, normal, quiet.
StDbManager()
flag for logging timing
StDbMessService * Messenger
where normal=!misVerbose && !misQuiet
static StDbManager * Instance()
strdup(..) is not ANSI