edg_wll_Event ** events
);
+
+/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_QueryEventsProxy(
+ edg_wll_Context context,
+ const edg_wll_QueryRec * job_conditions,
+ const edg_wll_QueryRec * event_conditions,
+ edg_wll_Event ** events
+);
+
+int edg_wll_QueryEventsExtProxy(
+ edg_wll_Context context,
+ const edg_wll_QueryRec ** job_conditions,
+ const edg_wll_QueryRec ** event_conditions,
+ edg_wll_Event ** events
+);
+
/**
* General query on jobs.
* Return jobs (and possibly their states) for which an event satisfying the conditions
edg_wll_JobStat ** states
);
+
+/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_QueryJobsProxy(
+ edg_wll_Context context,
+ const edg_wll_QueryRec * conditions,
+ int flags,
+ edg_wlc_JobId ** jobs,
+ edg_wll_JobStat ** states
+);
+
+int edg_wll_QueryJobsExtProxy(
+ edg_wll_Context context,
+ const edg_wll_QueryRec ** conditions,
+ int flags,
+ edg_wlc_JobId ** jobs,
+ edg_wll_JobStat ** states
+);
+
+
/**
* Bitmasks for edg_wll_JobStatus() flags argument.
* Settings these flags causes the status calls to retrieve additional
);
/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_JobStatusProxy(
+ edg_wll_Context context,
+ const edg_wlc_JobId jobid,
+ int flags,
+ edg_wll_JobStat *status
+);
+
+/**
* Return all events related to a single job.
* Convenience wrapper around edg_wll_Query()
* \param context IN: context to work with
edg_wll_Event ** events
);
+
+/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_JobLogProxy(
+ edg_wll_Context context,
+ const edg_wlc_JobId jobId,
+ edg_wll_Event ** events
+);
+
/**
* All current user's jobs.
* \param context IN: context to work with
edg_wll_JobStat ** states
);
+
+/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_UserJobsProxy(
+ edg_wll_Context context,
+ edg_wlc_JobId ** jobs,
+ edg_wll_JobStat ** states
+);
+
/**
* Server supported indexed attributes
* \see DataGrid-01-TEN-0125
/**
+ * Query LBProxy and use plain communication
+ */
+int edg_wll_QueryListener(
+ edg_wll_Context context,
+ edg_wlc_JobId jobId,
+ const char * name,
+ char ** host,
+ uint16_t * port
+);
+
+/**
* Ask LB Proxy server for sequence number
* \param context IN: context to work with
* \param jobId IN: job to query
const edg_wll_QueryRec **event_conditions,
edg_wll_Event **eventsOut)
{
- int error = 0;
char *response = NULL,
*message = NULL,
*send_mess = NULL;
goto err;
}
- if ((error = set_server_name_and_port(ctx,job_conditions)))
- goto err; // XXX is it fatal??
-
ctx->p_tmp_timeout = ctx->p_query_timeout;
- error = edg_wll_http_send_recv(ctx, "POST /queryEvents HTTP/1.1",request_headers,send_mess,
- &response,NULL,&message);
- if ( error != 0 )
- goto err;
+
+ if (ctx->isProxy) {
+ ctx->isProxy = 0;
+ if (edg_wll_http_send_recv_proxy(ctx, "POST /queryEvents HTTP/1.1",
+ request_headers,send_mess, &response,NULL,&message))
+ goto err;
+ }
+ else {
+ if (set_server_name_and_port(ctx,job_conditions))
+ goto err; // XXX is it fatal??
+
+ if (edg_wll_http_send_recv(ctx, "POST /queryEvents HTTP/1.1",
+ request_headers,send_mess, &response,NULL,&message))
+ goto err;
+ }
if (http_check_status(ctx,response))
goto err;
goto err;
}
- if (set_server_name_and_port(ctx, conditions))
- goto err;
-
ctx->p_tmp_timeout = ctx->p_query_timeout;
- if (edg_wll_http_send_recv(ctx, "POST /queryJobs HTTP/1.1",request_headers,send_mess,
- &response,NULL,&message))
- goto err;
+ if (ctx->isProxy){
+ ctx->isProxy = 0;
+ if (edg_wll_http_send_recv_proxy(ctx, "POST /queryJobs HTTP/1.1",
+ request_headers,send_mess,&response,NULL,&message))
+ goto err;
+ }
+ else {
+ if (set_server_name_and_port(ctx, conditions))
+ goto err;
+
+ if (edg_wll_http_send_recv(ctx, "POST /queryJobs HTTP/1.1",
+ request_headers,send_mess,&response,NULL,&message))
+ goto err;
+ }
if (http_check_status(ctx,response))
goto err;
goto err;
}
- // ctx->p_tmp_timeout = ctx->p_query_timeout; // not used
+ ctx->p_tmp_timeout = ctx->p_query_timeout;
error = edg_wll_http_send_recv_proxy(ctx, "POST /querySequenceCode HTTP/1.1",
request_headers, send_mess, &response, NULL, &message);
return(error);
}
+
+
+/******************************************************************
+ * Proxy wrappers
+ */
+
+
+int edg_wll_QueryEventsExtProxy(
+ edg_wll_Context ctx,
+ const edg_wll_QueryRec **job_conditions,
+ const edg_wll_QueryRec **event_conditions,
+ edg_wll_Event **eventsOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_QueryEventsExt(ctx, job_conditions, event_conditions, eventsOut);
+}
+
+
+
+int edg_wll_QueryEventsProxy(
+ edg_wll_Context ctx,
+ const edg_wll_QueryRec *job_conditions,
+ const edg_wll_QueryRec *event_conditions,
+ edg_wll_Event **eventsOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_QueryEvents(ctx, job_conditions, event_conditions, eventsOut);
+}
+
+
+
+int edg_wll_QueryJobsExtProxy(
+ edg_wll_Context ctx,
+ const edg_wll_QueryRec ** conditions,
+ int flags,
+ edg_wlc_JobId ** jobsOut,
+ edg_wll_JobStat ** statesOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_QueryJobsExt(ctx, conditions, flags, jobsOut, statesOut);
+}
+
+
+
+int edg_wll_QueryJobsProxy(
+ edg_wll_Context ctx,
+ const edg_wll_QueryRec * conditions,
+ int flags,
+ edg_wlc_JobId ** jobsOut,
+ edg_wll_JobStat ** statesOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_QueryJobs(ctx, conditions, flags, jobsOut, statesOut);
+}
+
+
+int edg_wll_UserJobsProxy(
+ edg_wll_Context ctx,
+ edg_wlc_JobId **jobsOut,
+ edg_wll_JobStat **statesOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_UserJobs(ctx, jobsOut, statesOut);
+}
+
+int edg_wll_JobLogProxy(
+ edg_wll_Context ctx,
+ edg_wlc_JobId job,
+ edg_wll_Event **eventsOut)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_JobLog(ctx, job, eventsOut);
+}
+
+int edg_wll_JobStatusProxy(
+ edg_wll_Context ctx,
+ edg_wlc_JobId job,
+ int flags,
+ edg_wll_JobStat *stat)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_JobStatus(ctx, job, flags, stat);
+}
+
+
+
+int edg_wll_QueryListenerProxy(
+ edg_wll_Context ctx,
+ edg_wlc_JobId job,
+ const char *name,
+ char** host,
+ uint16_t *port)
+{
+ ctx->isProxy = 1;
+
+ return edg_wll_QueryListener(ctx, job, name, host, port);
+}