59 #ifndef STDBMANAGERIMPL_HH
60 #define STDBMANAGERIMPL_HH
62 #include "StDbManager.hh"
63 #include "parseXmlString.hh"
64 #include "stdb_streams.h"
66 #include "StDataBaseI.hh"
67 #include "StDbTableFactory.hh"
68 #include "StDbMessService.hh"
69 #include "StDbConfigNode.hh"
70 #include "StDbTable.h"
71 #include "StDbLogger.hh"
72 #include "StDbServiceBroker.h"
79 dbType(StDbType atype,
const char* aname): type(atype) {
80 if(aname)strcpy(name,aname);};
86 dbDomain(StDbDomain adom,
const char* aname): domain(adom) {
87 if(aname)strcpy(name,aname);};
90 #define MAX_ENV_VARS 50
94 for (
int i = 0; i < MAX_ENV_VARS; i++) {
95 envVar[i] = 0; envDef[i] = 0;
99 for(
int i=0;i<num;i++){
105 char* envVar[MAX_ENV_VARS];
106 char* envDef[MAX_ENV_VARS];
112 #ifdef ST_NO_TEMPLATE_DEF_ARGS
113 typedef list<dbType*,allocator<dbType*> > dbTypes;
114 typedef list<dbDomain*,allocator<dbDomain*> > dbDomains;
115 typedef list<StDbServer*,allocator<StDbServer*> > ServerList;
116 typedef set<std::string,allocator<std::string> > dbDomainBlacklist;
118 #if !defined(ST_NO_NAMESPACES)
121 typedef list<dbType*> dbTypes;
122 typedef list<dbDomain*> dbDomains;
123 typedef list<StDbServer*> ServerList;
124 typedef std::set<std::string> dbDomainBlacklist;
138 StDbDomain dbDomainFree;
140 dbDomainBlacklist mBlacklist;
144 bool mhasDefaultServer;
160 virtual void turnOffTimeLogging();
164 const char* configName,
int opt=0);
165 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain);
166 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain,
167 const char* configName,
int opt=0);
168 virtual StDbConfigNode* initConfig(StDbType type, StDbDomain domain,
169 unsigned int requestTime,
int opt=0);
171 unsigned int requestTime,
int opt=0);
173 virtual char* getConfigNodeName(StDbType type, StDbDomain domain);
174 virtual char* getExternalVersion(StDbType type,StDbDomain domain);
175 virtual dbEnvList* getEnvList(
const char* name);
177 virtual StDbTable* newDbTable(
const char* dbName,
const char* tabName);
181 virtual StDataBaseI* findDb(StDbType type, StDbDomain domain);
183 virtual StDataBaseI* findDb(
const char* databaseName);
185 virtual StDbServer* findServer(StDbType type, StDbDomain domain);
187 virtual StDbServer* findServer(
const char* dbType,
const char* dbDomain);
188 virtual StDbServer* findServer(
const char* databaseName);
192 virtual char* getDbTypeName(StDbType type);
193 virtual char* getDbDomainName(StDbDomain domain);
194 virtual StDbType getDbType(
const char* typeName);
195 virtual StDbDomain getDbDomain(
const char* domainName);
196 virtual char* getDbName(
const char* typeName,
197 const char* domainName);
198 virtual char* printDbName(StDbType type, StDbDomain domain);
200 virtual void blacklistDbDomain(
const char* domainName);
203 virtual void setRequestTime(
unsigned int time);
204 virtual void setRequestTime(
const char* time);
205 virtual unsigned int getUnixRequestTime();
206 virtual char* getDateRequestTime();
207 virtual unsigned int getUnixCheckTime();
208 virtual char* getDateCheckTime();
209 virtual void setStoreTime(
unsigned int time);
210 virtual void setStoreTime(
const char* time);
211 virtual unsigned int getUnixStoreTime();
212 virtual char* getDateStoreTime();
215 virtual bool getDataBaseInfo(
const char* dbname,
216 char*& type,
char*& domain);
217 virtual bool getDataBaseInfo(
const char* dbname,
218 StDbType& type, StDbDomain& domain);
222 virtual bool fetchDbTable(
StDbTable* table);
223 virtual bool fetchDbTable(
StDbTable* table,
char* whereClause);
225 virtual bool storeDbTable(
StDbTable* table,
bool commitWhenDone=
true);
226 virtual bool storeAllTables(
StDbConfigNode* node,
bool commitWhenDone=
true);
228 int& configID,
bool commitWhenDone=
true);
242 virtual void closeConnection(
StDbNode* node);
244 virtual void printTimeStats();
247 short xmlInputSource;
250 #ifndef NoXmlTreeReader
257 virtual void initTypes();
258 virtual void initDomains();
259 virtual void addDbType(StDbType type,
const char* typeName);
260 virtual void addDbDomain(StDbDomain domain,
const char* domainName);
263 virtual StDbType newDbType(
const char* typeName);
264 virtual StDbDomain newDbDomain(
const char* domainName);
266 virtual void deleteServers();
267 virtual void deleteTypes();
268 virtual void deleteDomains();
272 virtual void findServersXml(ifstream& is);
273 virtual char* findServerString(ifstream& is);
274 virtual char* getNextName(
char*& name);
virtual void closeAllConnections()
node commits
virtual bool commitAllNodes(StDbConfigNode *node)
table commits
virtual bool rollBack(StDbNode *node)
for node data
virtual bool commitAllTables(StDbConfigNode *node)
for table data
virtual void lookUpServers()
virtual bool rollBackAllNodes(StDbConfigNode *node)
for table data