From: Miloš Mulač Date: Tue, 28 Jun 2005 08:28:18 +0000 (+0000) Subject: __lb__QueryEvents X-Git-Tag: Root_glite-deployment-lb_branch_2_0_0~18 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=1771a569623e4417c7286c7a7f58de045d1d8c42;p=jra1mw.git __lb__QueryEvents - for sharing (compiles, type conversion functions only as stubs) --- diff --git a/org.glite.lb.server/src/ws_query.c b/org.glite.lb.server/src/ws_query.c index abba6fa..4a8b4e0 100644 --- a/org.glite.lb.server/src/ws_query.c +++ b/org.glite.lb.server/src/ws_query.c @@ -26,6 +26,7 @@ static void freeQueryRecsExt(edg_wll_QueryRec **qr); static void freeJobIds(edg_wlc_JobId *jobs); static void freeJobStats(edg_wll_JobStat *stats); +static void freeEvents(edg_wll_Event *events); SOAP_FMAC5 int SOAP_FMAC6 __lb__GetVersion( @@ -118,6 +119,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb__UserJobs( struct _lbe__UserJobs *in, struct _lbe__UserJobsResponse *out) { + return SOAP_OK; } #if 0 @@ -139,6 +141,55 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb__QueryEvents( struct _lbe__QueryEvents *in, struct _lbe__QueryEventsResponse *out) { + edg_wll_Context ctx = (edg_wll_Context) glite_gsplugin_get_udata(soap); + edg_wll_QueryRec **job_conditions; + edg_wll_QueryRec **event_conditions; + edg_wll_Event *events; + int ret = SOAP_OK; + + + edg_wll_ResetError(ctx); + if ( edg_wll_SoapToQueryCondsExt(*in->jobConditions, in->__sizejobConditions, + &job_conditions) ) + { + edg_wll_SetError(ctx, ENOMEM, "Couldn't create internal structures"); + edg_wll_ErrToFault(ctx, soap); + ret = SOAP_FAULT; + goto cleanup; + } + + if ( edg_wll_SoapToQueryCondsExt(*in->eventConditions, in->__sizeeventConditions, + &event_conditions) ) + { + edg_wll_SetError(ctx, ENOMEM, "Couldn't create internal structures"); + edg_wll_ErrToFault(ctx, soap); + ret = SOAP_FAULT; + goto cleanup; + } + + + if (edg_wll_QueryEventsServer(ctx, ctx->noAuth, + (const edg_wll_QueryRec **)job_conditions, + (const edg_wll_QueryRec **)event_conditions, + &events)) + { + edg_wll_ErrToFault(ctx, soap); + ret = SOAP_FAULT; + goto cleanup; + } + + if (edg_wll_EventsQueryResToSoap(soap, events, out) != SOAP_OK) + { + ret = SOAP_FAULT; + goto cleanup; + } + +cleanup: + freeQueryRecsExt(job_conditions); + freeQueryRecsExt(event_conditions); + freeEvents(events); + + return ret; } @@ -177,3 +228,16 @@ static void freeJobStats(edg_wll_JobStat *stats) { free(stats); } } + + +static void freeEvents(edg_wll_Event *events) +{ + int i; + + if (events != NULL) { + for (i=0; events[i].type != EDG_WLL_EVENT_UNDEF; i++) + edg_wll_FreeEvent(&(events[i])); + edg_wll_FreeEvent(&(events[i])); /* free last line */ + free(events); + } +} diff --git a/org.glite.lb.server/src/ws_typeref.c.T b/org.glite.lb.server/src/ws_typeref.c.T index 7b2d873..d7a3ed6 100644 --- a/org.glite.lb.server/src/ws_typeref.c.T +++ b/org.glite.lb.server/src/ws_typeref.c.T @@ -618,3 +618,14 @@ int edg_wll_JobsQueryResToSoap( return SOAP_OK; } + +int edg_wll_EventsQueryResToSoap( + struct soap *soap, + edg_wll_Event *events, + struct _lbe__QueryEventsResponse *out) +{ + + //XXX: needs flash + + return SOAP_OK; +} diff --git a/org.glite.lb.server/src/ws_typeref.h b/org.glite.lb.server/src/ws_typeref.h index d8fb566..e2518ee 100644 --- a/org.glite.lb.server/src/ws_typeref.h +++ b/org.glite.lb.server/src/ws_typeref.h @@ -62,6 +62,10 @@ extern int edg_wll_JobsQueryResToSoap(struct soap *, edg_wll_JobStat *, struct _lbe__QueryJobsResponse *); +extern int edg_wll_EventsQueryResToSoap(struct soap *, + edg_wll_Event *, + struct _lbe__QueryEventsResponse *); + #ifdef __cplusplus } #endif