__lb__QueryEvents
authorMiloš Mulač <mulac@civ.zcu.cz>
Tue, 28 Jun 2005 08:28:18 +0000 (08:28 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Tue, 28 Jun 2005 08:28:18 +0000 (08:28 +0000)
- for sharing (compiles, type conversion functions only as stubs)

org.glite.lb.server/src/ws_query.c
org.glite.lb.server/src/ws_typeref.c.T
org.glite.lb.server/src/ws_typeref.h

index abba6fa..4a8b4e0 100644 (file)
@@ -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);
+       }
+}
index 7b2d873..d7a3ed6 100644 (file)
@@ -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;
+}
index d8fb566..e2518ee 100644 (file)
@@ -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