11 #ifndef TX_EVENT_LOG_H
12 #define TX_EVENT_LOG_H
16 #include "TxUCMConstants.h"
72 virtual void writeDown(
const std::string& message)=0;
82 virtual void writeDown(
const char *message);
138 virtual void setContext (
const std::string& context)=0;
145 virtual void logStart (
const std::string& key,
const std::string& value)=0;
146 void logStart (
const char *key = TxUCMConstants::appStart,
147 const char *value =
"application started");
158 virtual void setJobSubmitLocation (
const std::string& url)=0;
159 void setJobSubmitLocation (
const char *url);
169 virtual void logJobAttribute (
const std::string& key,
const std::string& value)=0;
178 virtual void logTask (
unsigned int size=1)=0;
191 virtual void logTask (
const std::string& taskAttributes)=0;
192 void logTask (
const char *taskAttributes);
200 virtual void setJobSubmitState (State state)=0;
211 virtual void setJobSubmitID (
const std::string& ID)=0;
212 void setJobSubmitID (
const char *ID);
224 virtual void logEvent (
const std::string& logMsg,
225 Level level = LEVEL_INFO,
226 Stage stage = STATUS,
227 const std::string& msgContext = TxUCMConstants::defaultContext)=0;
230 Level level = LEVEL_INFO,
231 Stage stage = STATUS,
232 const char *msgContext = TxUCMConstants::defaultContext);
245 virtual void logEvent (
const std::string& userKey,
246 const std::string& userValue,
247 Level level = LEVEL_INFO,
248 Stage stage = STATUS,
249 const std::string& msgContext = TxUCMConstants::defaultContext)=0;
251 const char *userValue,
252 Level level = LEVEL_INFO,
253 Stage stage = STATUS,
254 const char *msgContext = TxUCMConstants::defaultContext);
260 virtual void logEnd (
const std::string& key,
const std::string& value)=0;
261 void logEnd (
const char *key = TxUCMConstants::appEnd,
262 const char *value =
"application ended");
267 virtual StUcmTasks *getTaskList (
int limit,
int offset) = 0;
272 virtual StUcmJobs *getJobList(
int limit);
273 virtual StUcmJobs *getJobList(
int limit,
int offset);
275 virtual int getJobId(
const char *requester,
const char *taskBrokerId,
int jobBrokerId) = 0;
281 virtual StUcmEvents *getEventList(
int limit,
int offset);
284 virtual int queryTableSize(
const char *tableName);
285 virtual int queryTableSize(
const char *tableName,
const char *where)=0;
286 virtual int queryTableSize(
const char *tableName,
const StRecord *where)=0;
293 virtual void setDbJobID (
int dbJobID)=0;
296 #ifndef TXEVENT_DEFAULT_IMPLEMENTAION
297 #define TXEVENT_DEFAULT_IMPLEMENTAION(classname) \
298 StUcmTasks *classname::getTaskList () \
299 { return TxEventLog::getTaskList() ; } \
300 StUcmTasks *classname::getTaskList (int limit) \
301 { return TxEventLog::getTaskList(limit); } \
302 StUcmJobs *classname::getJobList () \
303 { return TxEventLog::getJobList() ; } \
304 StUcmJobs *classname::getJobList (StRecord *task) \
305 { return TxEventLog::getJobList(task) ; } \
306 StUcmJobs *classname::getJobList (int limit) \
307 { return TxEventLog::getJobList(limit); } \
308 StUcmJobs *classname::getJobList (StRecord *task,int limit) \
309 { return TxEventLog::getJobList(task,limit); } \
310 StUcmJobs *classname::getJobList (int limit,int offset) \
311 { return TxEventLog::getJobList(limit,offset); } \
312 StUcmEvents *classname::getEventList () \
313 { return TxEventLog::getEventList() ; } \
314 StUcmEvents *classname::getEventList (StRecord *job) \
315 { return TxEventLog::getEventList(job) ; } \
316 StUcmEvents *classname::getEventList (int limit) \
317 { return TxEventLog::getEventList(limit); } \
318 StUcmEvents *classname::getEventList (StRecord *job,int limit) \
319 { return TxEventLog::getEventList(job,limit); } \
320 StUcmEvents *classname::getEventList (int limit,int offset) \
321 { return TxEventLog::getEventList(limit,offset); } \
322 int classname::queryTableSize (const char *table_name)\
323 { return TxEventLog::queryTableSize(table_name); } \
324 void classname::writeDown(const char *message) \
325 { return TxEventLog::writeDown(message); }
327 #define TXEVENT_DEFAULT_IMPLEMENTAION_2(classname) \
328 int classname::getJobId (const char *requester, const char *taskBrokerId, int jobBrokerId)\
329 { assert(0 && "getJobId has not been implemented yet"); \
331 StUcmTasks *classname::getTaskList (int limit, int offset) \
332 { assert(0 && "getTaskList has not been implemented yet"); \
334 StUcmJobs *classname::getJobList (StRecord *task,int limit, int offset) \
335 { assert(0 && task && limit && offset && "getJobList has not been implemented yet"); \
337 StUcmEvents *classname::getEventList (StRecord *job,int limit, int offset) \
338 { assert(0 && job && limit && offset&& "getEventList has not been implemented yet"); \
340 int classname::queryTableSize (const char *table_name, const char *where) \
341 { assert(0 && table_name && where && "queryTableSize has not been implemented yet"); \
343 int classname::queryTableSize (const char *table_name, const StRecord *where) \
344 { assert(0 && table_name && where && "queryTableSize has not been implemented yet"); \
346 void classname::setDbJobID (int bJobID) \
347 { assert(0 && bJobID && "setDbJobID has not been implemented yet"); }
virtual void setBrokerTaskID(const std::string &brokerTaskID)=0
virtual void setEnvBrokerJobID(const std::string &envBrokerJobID)=0
virtual void logStart(const std::string &key, const std::string &value)=0
virtual void logTask(unsigned int size=1)=0
virtual void logEnd(const std::string &key, const std::string &value)=0
virtual void setRequesterName(const std::string &requester)=0
virtual void setBrokerJobID(int brokerJobID)=0
virtual void logJobSubmitLocation(const std::string &url)=0
virtual void logJobAttribute(const std::string &key, const std::string &value)=0
virtual void setEnvBrokerTaskID(const std::string &envBrokerTaskID)=0
virtual void logJobSubmitState(State state)=0
virtual void logEvent(const std::string &logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)=0
virtual void setContext(const std::string &context)=0
virtual void logJobSubmitID(const std::string &ID)=0