conf->attrs[2] = strdup("location");
conf->attrs[3] = strdup("jobid");
- conf->PS_list = calloc(2, sizeof(*conf->PS_list));
- conf->PS_list[0] = strdup("http://localhost:8901");
-
conf->indexed_attrs = calloc(3, sizeof(*conf->indexed_attrs));
conf->indexed_attrs[0] = strdup("owner");
conf->indexed_attrs[1] = strdup("location");
// XXX: some plugin names should come here in future
conf->plugins = NULL;
+
+ /* ask for one feed */
+ conf->feeds = calloc(2, sizeof(*(conf->feeds)));
+
+ conf->feeds[0] = calloc(1, sizeof(**(conf->feeds)));
+ conf->feeds[0]->PS_URL = strdup("http://localhost:8901");
+
// all job since Epoche
- conf->query = calloc(2,sizeof(*conf->query));
- conf->query[0] = calloc(2,sizeof(**conf->query));
- conf->query[0][0].attr = strdup("date");
- conf->query[0][0].op = GLITE_JP_QUERYOP_GREATER;
- conf->query[0][0].value = strdup("0");
+ conf->feeds[0]->query = calloc(2,sizeof(*conf->feeds[0]->query));
+ conf->feeds[0]->query[0] = calloc(2,sizeof(**conf->feeds[0]->query));
+ conf->feeds[0]->query[0][0].attr = strdup("date");
+ conf->feeds[0]->query[0][0].op = GLITE_JP_QUERYOP_GREATER;
+ conf->feeds[0]->query[0][0].value = strdup("0");
+
+ conf->feeds[0]->history = 0;
+ conf->feeds[0]->continuous = 1;
+
+ conf->feeds[1] = NULL;
- conf->continuous = 1;
*configuration = conf;
#include "glite/jp/types.h"
+typedef struct _glite_jp_is_feed {
+ char *PS_URL; //URLs of Primary Storage servers
+ glite_jp_query_rec_t **query; // query to Primary Server (aka filter)
+ int history, // type of query
+ continuous;
+} glite_jp_is_feed;
+
+
typedef struct _glite_jp_is_conf {
// all I need to get from comman line options and configuration file
// arrays are zero-terminated
char **attrs; // atributes to obtain
- char **PS_list; // URLs of Primary Storage servers
char **indexed_attrs; // list of indexed atributes
char **plugins; // list of plugin.so's
- glite_jp_query_rec_t **query; // query to Primary Server
-
- int history, continuous; // type of query
+ glite_jp_is_feed **feeds; // null terminated list of feeds
} glite_jp_is_conf;
/* PS WSDL client calls */
/*----------------------*/
+static int find_dest_index(glite_jp_is_conf *conf, char *dest)
+{
+ int i;
+
+ for (i=0; conf->feeds[i]; i++)
+ if (!strcmp(dest, conf->feeds[i]->PS_URL)) return(i);
+
+ return -1;
+}
+
// call PS FeedIndex for a given destination
void MyFeedIndex(glite_jp_is_conf *conf, char *dest)
struct jptype__primaryQuery query;
struct jptype__stringOrBlob value;
// struct xsd__base64Binary blob;
- int i;
+ int i, dest_index;
struct soap *soap = soap_new();
in.__sizeattributes = i;
in.attributes = conf->attrs;
- for (in.__sizeconditions=0; conf->query[in.__sizeconditions]; in.__sizeconditions++);
+ if ((dest_index = find_dest_index(conf, dest)) < 0) goto err;
+
+ for (i=0; conf->feeds[dest_index]->query[i]; i++);
+ in.__sizeconditions = i;
in.conditions = malloc(in.__sizeconditions * sizeof(*in.conditions));
- for (i=0; conf->query[i]; i++) {
- if (glite_jpis_QueryCondToSoap(soap, conf->query[i], &(in.conditions[i])) != SOAP_OK) {
+ for (i=0; conf->feeds[dest_index]->query[i]; i++) {
+ if (glite_jpis_QueryCondToSoap(soap, conf->feeds[dest_index]->query[i],
+ &(in.conditions[i])) != SOAP_OK) {
printf("MyFeedIndex() - error during conds conversion\n");
goto err;
}
}
- in.history = conf->history;
- in.continuous = conf->continuous;
+ in.history = conf->feeds[dest_index]->history;
+ in.continuous = conf->feeds[dest_index]->continuous;
//if (!check_fault(soap,soap_call_jpsrv___FeedIndex(soap,dest,"",
if (soap_call___jpsrv__FeedIndex(soap,dest,"", &in, &out)) {