COMMONLIB:=-lglite_jp_common
SRVCOMMONLIB:=-lglite_jp_server_common
BONESLIB:=-lglite_lb_server_bones
-TRIOLIB:=-lglite_lb_trio
+TRIOLIB:=-lglite_jp_trio
ifneq (${mysql_prefix},/usr)
ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
${LINK} -o $@ -export-dynamic ${OBJS} ${BONESLIB} ${TRIOLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS} ${MYSQLIB} ${SRVCOMMONLIB}
${example}: ${EXA_OBJS}
- ${LINK} -o $@ ${EXA_OBJS} ${GSOAPLIB} ${GLOBUS_LIBS}
+ ${LINK} -o $@ ${EXA_OBJS} ${GSOAPLIB} ${GLOBUS_LIBS} ${COMMONLIB} ${TRIOLIB}
jpis-db-internal: jpis-db-internal.o db_ops.o conf.o context.o
${LINK} -o $@ $+ ${COMMONLIB} ${SRVCOMMONLIB} ${GLOBUS_LIBS}
#include <assert.h>
#include <glite/security/glite_gsplugin.h>
+#include "glite/jp/strmd5.h"
#include "jpis_H.h"
#include "jpis_.nsmap"
soap_set_namespaces(soap, jpis__namespaces);
soap_register_plugin(soap,glite_gsplugin);
+goto query;
// test calls of server functions
{
// this call is issued by JPPS
//XXX : need to register feed with feedid in.feedId in DB
//this one work only because such feed in conf.c (umbar)
- in.feedId = soap_strdup(soap, "-PSJ1xMg9Ngd62-Lm-mitg");
+ //in.feedId = soap_strdup(soap, str2md5("http://localhost:8901"));
+ in.feedId = soap_strdup(soap, "12345");
in.feedDone = false_;
in.__sizejobAttributes = 1;
in.jobAttributes = soap_malloc(soap,
rec->attributes[0] = soap_malloc(soap, sizeof(*(rec->attributes[0])));
rec->attributes[0]->name = soap_strdup(soap, "http://egee.cesnet.cz/en/Schema/JP/System:owner");
rec->attributes[0]->value = soap_malloc(soap, sizeof(*(rec->attributes[0]->value)));
- rec->attributes[0]->value->string = soap_strdup(soap, "S:Ja");
+ rec->attributes[0]->value->string = soap_strdup(soap, "CertSubj");
rec->attributes[0]->value->blob = NULL;
rec->attributes[0]->timestamp = 333;
rec->attributes[0]->origin = jptype__attrOrig__SYSTEM;
rec->attributes[1] = soap_malloc(soap, sizeof(*(rec->attributes[1])));
rec->attributes[1]->name = soap_strdup(soap, "http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus");
rec->attributes[1]->value = soap_malloc(soap, sizeof(*(rec->attributes[0]->value)));
- rec->attributes[1]->value->string = soap_strdup(soap, "S:Done");
+ rec->attributes[1]->value->string = soap_strdup(soap, "Done");
rec->attributes[1]->value->blob = NULL;
rec->attributes[1]->timestamp = 333;
rec->attributes[1]->origin = jptype__attrOrig__SYSTEM;
check_fault(soap,
soap_call___jpsrv__UpdateJobs(soap,server,"",&in,&out));
}
+query:
{
// this call is issued by user
struct _jpelem__QueryJobs in;
struct jptype__indexQuery *cond;
struct jptype__indexQueryRecord *rec;
struct _jpelem__QueryJobsResponse out;
+ int i, j;
in.__sizeconditions = 1;
memset(rec, 0, sizeof(*rec));
rec->op = jptype__queryOp__EQUAL;
rec->value = soap_malloc(soap, sizeof(*(rec->value)));
- rec->value->string = soap_strdup(soap, "Cancelled");
+ rec->value->string = soap_strdup(soap, "Done");
rec->value->blob = NULL;
*(cond->record) = rec;
check_fault(soap,
soap_call___jpsrv__QueryJobs(soap, server, "",&in,&out));
+
+ for (j=0; j<out.__sizejobs; j++) {
+ printf("jobid = %s\n",out.jobs[j]->jobid);
+ for (i=0; i<out.jobs[j]->__sizeattributes; i++) {
+ printf("\t%s = %s\n",
+ out.jobs[j]->attributes[i]->name,
+ out.jobs[j]->attributes[i]->value->string);
+ }
+ }
}
return 0;
conf->attrs[16] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:lastStatusHistory");
conf->attrs[17] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:fullStatusHistory");
- conf->indexed_attrs = calloc(9, sizeof(*conf->indexed_attrs));
+ conf->indexed_attrs = calloc(8, sizeof(*conf->indexed_attrs));
conf->indexed_attrs[0] = strdup("http://egee.cesnet.cz/en/Schema/JP/System:owner");
conf->indexed_attrs[1] = strdup("http://egee.cesnet.cz/en/Schema/JP/System:jobId");
conf->indexed_attrs[2] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:user");
conf->indexed_attrs[3] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus");
- conf->indexed_attrs[4] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:aTag");
- conf->indexed_attrs[5] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:UIHost");
- conf->indexed_attrs[6] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:CE");
- conf->indexed_attrs[7] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:RB");
+ conf->indexed_attrs[4] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:UIHost");
+ conf->indexed_attrs[5] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:CE");
+ conf->indexed_attrs[6] = strdup("http://egee.cesnet.cz/en/Schema/LB/Attributes:RB");
// XXX: some plugin names should come here in future
conf->plugins = NULL;
conf->feeds = calloc(2, sizeof(*(conf->feeds)));
conf->feeds[0] = calloc(1, sizeof(**(conf->feeds)));
- conf->feeds[0]->PS_URL = strdup("http://umbar.ics.muni.cz:8901");
-// conf->feeds[0]->PS_URL = strdup("http://localhost:8901");
+// conf->feeds[0]->PS_URL = strdup("http://umbar.ics.muni.cz:8901");
+ conf->feeds[0]->PS_URL = strdup("http://localhost:8901");
// all job since Epoche
conf->feeds[0]->query = calloc(2,sizeof(*conf->feeds[0]->query));
i = 0;
while ( (ret = glite_jp_db_fetchrow(stmt, &fv)) > 0 ) {
av = realloc(av, (i+1) * sizeof(*av));
- av[i] = soap_malloc(soap, sizeof(*av[i]));
+ av[i] = soap_malloc(soap, sizeof(**av));
+ memset(av[i], 0, sizeof(**av));
memset(&jav,0,sizeof(jav));
if (glite_jp_attrval_from_db(ctx->jpctx, fv, &jav)) goto err;
av[i]->name = soap_strdup(soap, attr_name);
+ av[i]->value = soap_malloc(soap, sizeof(*(av[i]->value)));
+ memset(av[i]->value, 0, sizeof(*(av[i]->value)));
if (jav.binary) {
av[i]->value->blob = soap_malloc(soap, sizeof(*(av[i]->value->blob)));
+ memset(av[i]->value->blob, 0, sizeof(*(av[i]->value->blob)));
av[i]->value->blob->__ptr = soap_malloc(soap, jav.size);
memcpy(av[i]->value->blob->__ptr, jav.value, jav.size);
av[i]->value->blob->__size = jav.size;
/* sizeattributes & attributes */
size = 0;
- for (j=0; in->__sizeattributes; j++) {
+ for (j=0; j < in->__sizeattributes; j++) {
if (get_attr(soap, ctx, jobid, in->attributes[j], &jr) ) goto err;
if (jr.__sizeattributes > 0) {
av = realloc(av, (size + jr.__sizeattributes) * sizeof(*av));
- for (i=0; i<jr.__sizeattributes; i++)
- av[size+i] = jr.attributes[i];
- //memcpy(av[size], jr.attributes[0], jr.__sizeattributes * sizeof(*av));
+ memcpy(&av[size], jr.attributes, jr.__sizeattributes * sizeof(*(jr.attributes)));
size += jr.__sizeattributes;
free(jr.attributes);
}