00001 #ifndef _EDG_WORKLOAD_LOGGING_CLIENT_CONTEXT_H
00002 #define _EDG_WORKLOAD_LOGGING_CLIENT_CONTEXT_H
00003
00009 #include "glite/wmsutils/exception/exception_codes.h"
00010 #include "glite/wmsutils/jobid/cjobid.h"
00011
00012 #ident "$Header: /cvs/jra1mw/org.glite.lb.client-interface/interface/context.h,v 1.16.12.1 2006/02/17 10:12:14 zsalvet Exp $"
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00025 typedef struct _edg_wll_Context *edg_wll_Context;
00026
00028 typedef enum _edg_wll_ContextParam {
00029 EDG_WLL_PARAM_HOST,
00030 EDG_WLL_PARAM_SOURCE,
00031 EDG_WLL_PARAM_INSTANCE,
00032 EDG_WLL_PARAM_LEVEL,
00033 EDG_WLL_PARAM_DESTINATION,
00034 EDG_WLL_PARAM_DESTINATION_PORT,
00035 EDG_WLL_PARAM_LOG_TIMEOUT,
00036 EDG_WLL_PARAM_LOG_SYNC_TIMEOUT,
00037 EDG_WLL_PARAM_QUERY_SERVER,
00038 EDG_WLL_PARAM_QUERY_SERVER_PORT,
00039 EDG_WLL_PARAM_QUERY_SERVER_OVERRIDE,
00040 EDG_WLL_PARAM_QUERY_TIMEOUT,
00041 EDG_WLL_PARAM_QUERY_JOBS_LIMIT,
00042 EDG_WLL_PARAM_QUERY_EVENTS_LIMIT,
00043 EDG_WLL_PARAM_QUERY_RESULTS,
00044 EDG_WLL_PARAM_QUERY_CONNECTIONS,
00045 EDG_WLL_PARAM_NOTIF_SERVER,
00046 EDG_WLL_PARAM_NOTIF_SERVER_PORT,
00047 EDG_WLL_PARAM_NOTIF_TIMEOUT,
00048 EDG_WLL_PARAM_X509_PROXY,
00049 EDG_WLL_PARAM_X509_KEY,
00050 EDG_WLL_PARAM_X509_CERT,
00051 EDG_WLL_PARAM_LBPROXY_STORE_SOCK,
00052 EDG_WLL_PARAM_LBPROXY_SERVE_SOCK,
00053 EDG_WLL_PARAM_LBPROXY_USER,
00054 EDG_WLL_PARAM_JPREG_TMPDIR,
00055 EDG_WLL_PARAM__LAST,
00056 } edg_wll_ContextParam;
00057
00059 typedef enum _edg_wll_QueryResults {
00060 EDG_WLL_QUERYRES_UNDEF,
00061 EDG_WLL_QUERYRES_NONE,
00062 EDG_WLL_QUERYRES_ALL,
00063 EDG_WLL_QUERYRES_LIMITED,
00064 EDG_WLL_QUERYRES__LAST
00065 } edg_wll_QueryResults;
00066
00068 typedef enum _edg_wll_Source {
00069 EDG_WLL_SOURCE_NONE,
00070 EDG_WLL_SOURCE_USER_INTERFACE,
00071 EDG_WLL_SOURCE_NETWORK_SERVER,
00072 EDG_WLL_SOURCE_WORKLOAD_MANAGER,
00073 EDG_WLL_SOURCE_BIG_HELPER,
00074 EDG_WLL_SOURCE_JOB_SUBMISSION,
00075 EDG_WLL_SOURCE_LOG_MONITOR,
00076 EDG_WLL_SOURCE_LRMS,
00077 EDG_WLL_SOURCE_APPLICATION,
00078 EDG_WLL_SOURCE__LAST
00079 } edg_wll_Source;
00080
00083 #define EDG_WLL_SOURCE_WM_PROXY EDG_WLL_SOURCE_NETWORK_SERVER
00084
00085
00090 int edg_wll_InitContext(edg_wll_Context *context);
00091
00096 void edg_wll_FreeContext(edg_wll_Context context);
00097
00105 int edg_wll_SetParam(
00106 edg_wll_Context context,
00107 edg_wll_ContextParam param,
00108 ...
00109 );
00110
00111 struct timeval;
00112
00120 int edg_wll_SetParamInt(edg_wll_Context ctx,edg_wll_ContextParam param,int val);
00121
00129 int edg_wll_SetParamString(edg_wll_Context ctx,edg_wll_ContextParam param,const char *val);
00130
00138 int edg_wll_SetParamTime(edg_wll_Context ctx,edg_wll_ContextParam param,const struct timeval *val);
00139
00147 int edg_wll_GetParam(
00148 edg_wll_Context context,
00149 edg_wll_ContextParam param,
00150 ...
00151 );
00152
00153
00160
00161
00162 typedef enum _edg_wll_ErrorCode {
00164 EDG_WLL_ERROR_BASE = GLITE_WMS_LOGGING_ERROR_BASE,
00165 EDG_WLL_ERROR_PARSE_BROKEN_ULM,
00166 EDG_WLL_ERROR_PARSE_EVENT_UNDEF,
00167 EDG_WLL_ERROR_PARSE_MSG_INCOMPLETE,
00168 EDG_WLL_ERROR_PARSE_KEY_DUPLICITY,
00169 EDG_WLL_ERROR_PARSE_KEY_MISUSE,
00170 EDG_WLL_ERROR_PARSE_OK_WITH_EXTRA_FIELDS,
00172 EDG_WLL_ERROR_XML_PARSE,
00173 EDG_WLL_ERROR_SERVER_RESPONSE,
00174 EDG_WLL_ERROR_JOBID_FORMAT,
00175 EDG_WLL_ERROR_DB_CALL,
00177 EDG_WLL_ERROR_URL_FORMAT,
00178 EDG_WLL_ERROR_MD5_CLASH,
00179 EDG_WLL_ERROR_GSS,
00180 EDG_WLL_ERROR_DNS,
00181 EDG_WLL_ERROR_NOJOBID,
00182 EDG_WLL_ERROR_NOINDEX,
00183 EDG_WLL_IL_PROTO,
00184 EDG_WLL_IL_SYS,
00185 EDG_WLL_IL_EVENTS_WAITING,
00186 EDG_WLL_ERROR_COMPARE_EVENTS,
00187 EDG_WLL_ERROR_SQL_PARSE,
00188 } edg_wll_ErrorCode;
00189
00200 int edg_wll_Error(
00201 edg_wll_Context context,
00202 char **errText,
00203 char **errDesc
00204 );
00205
00208 char * edg_wll_SourceToString(edg_wll_Source src);
00209
00213 edg_wll_Source edg_wll_StringToSource(const char *name);
00214
00217 char * edg_wll_QResultToString(edg_wll_QueryResults res);
00218
00222 edg_wll_QueryResults edg_wll_StringToQResult(const char *name);
00223
00227 #define EDG_WLL_SEQ_NORMAL 1
00228 #define EDG_WLL_SEQ_DUPLICATE 11
00229
00233 #define EDG_WLL_SEQ_BIGHELPER_INITIAL "UI=2:NS=0:WM=0:BH=1:JSS=0:LM=0:LRMS=0:APP=0"
00234
00236 char * edg_wll_GetSequenceCode(
00237 const edg_wll_Context context
00238 );
00239
00243 int edg_wll_GetLoggingJob(
00244 const edg_wll_Context context,
00245 edg_wlc_JobId *jobid_out
00246 );
00247
00248
00249
00250
00251
00252 #ifdef __cplusplus
00253 }
00254 #endif
00255
00256 #endif