From: Miloš Mulač Date: Mon, 17 Mar 2008 16:14:08 +0000 (+0000) Subject: enable to pass notification validity from client to server (part II) X-Git-Tag: merge_313_4_dst~7 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=5c81a34eb5057d9116f8539d5a775eaf2e715b21;p=jra1mw.git enable to pass notification validity from client to server (part II) --- diff --git a/org.glite.lb.client/examples/notify.pl b/org.glite.lb.client/examples/notify.pl index 425f027..7defa0d 100755 --- a/org.glite.lb.client/examples/notify.pl +++ b/org.glite.lb.client/examples/notify.pl @@ -27,7 +27,7 @@ while (1) { select($fdin,undef,undef,undef); print "got connection\n"; - system "$notif receive -s $fd -t 3"; + system "$notif receive -s $fd -i 3"; } diff --git a/org.glite.lb.client/src/notify.c b/org.glite.lb.client/src/notify.c index 0e8c226..5d5ec2e 100644 --- a/org.glite.lb.client/src/notify.c +++ b/org.glite.lb.client/src/notify.c @@ -64,7 +64,7 @@ static void usage(char *cmd) fprintf(stderr,"\n'refresh' command usage: %s refresh [-t requested_validity ] notifid\n" " notifid Notification ID.\n", me); if ( !cmd || !strcmp(cmd, "receive") ) - fprintf(stderr,"\n'receive' command usage: %s receive [ { -s socket_fd | -a fake_addr } ] [-t timeout] [-f field1,field2,...] [notifid]\n" + fprintf(stderr,"\n'receive' command usage: %s receive [ { -s socket_fd | -a fake_addr } ] [-t requested_validity ] [-i timeout] [-f field1,field2,...] [notifid]\n" " notifid Notification ID (not used if -s specified).\n" " fake_addr Fake the client address.\n" " field1,field2,... list of status fields to print (only owner by default)\n" @@ -199,17 +199,19 @@ int main(int argc,char **argv) int c; char *field_arg = "owner",*err; - while ((c = getopt(argc-1,argv+1,"s:a:t:f:")) > 0) switch (c) { + while ((c = getopt(argc-1,argv+1,"s:a:i:f:t:")) > 0) switch (c) { case 's': if (fake_addr) { usage("receive"); return EX_USAGE; } sock = atoi(optarg); break; case 'a': if (sock >= 0) { usage("receive"); return EX_USAGE; } fake_addr = optarg; break; - case 't': + case 'i': tout.tv_sec = atoi(optarg); break; case 'f': field_arg = optarg; break; + case 't': + valid = atol(optarg); break; default: usage("receive"); return EX_USAGE; } diff --git a/org.glite.lb.common/interface/xml_parse.h b/org.glite.lb.common/interface/xml_parse.h index 1f92acc..61c72e0 100644 --- a/org.glite.lb.common/interface/xml_parse.h +++ b/org.glite.lb.common/interface/xml_parse.h @@ -59,7 +59,7 @@ extern int edg_wll_LoadRequestToXML(edg_wll_Context ctx, const edg_wll_LoadReque extern int edg_wll_IndexedAttrsRequestToXML(edg_wll_Context ctx, char **message); -extern int edg_wll_NotifRequestToXML( edg_wll_Context ctx, const char *function, const edg_wll_NotifId notifId, const char *address, edg_wll_NotifChangeOp op, edg_wll_QueryRec const * const *conditions, char **message); +extern int edg_wll_NotifRequestToXML( edg_wll_Context ctx, const char *function, const edg_wll_NotifId notifId, const char *address, edg_wll_NotifChangeOp op, time_t validity, edg_wll_QueryRec const * const *conditions, char **message); extern int edg_wll_QuerySequenceCodeToXML(edg_wll_Context ctx, glite_jobid_const_t jobId, char **message); diff --git a/org.glite.lb.common/src/xml_parse.c.T b/org.glite.lb.common/src/xml_parse.c.T index 650ae81..a5d9e64 100644 --- a/org.glite.lb.common/src/xml_parse.c.T +++ b/org.glite.lb.common/src/xml_parse.c.T @@ -2860,6 +2860,7 @@ int edg_wll_NotifRequestToXML( const edg_wll_NotifId notifId, const char *address, edg_wll_NotifChangeOp op, + time_t validity, edg_wll_QueryRec const * const *conditions, char **message) { @@ -2870,6 +2871,7 @@ int edg_wll_NotifRequestToXML( edg_wll_add_string_to_XMLBody(&pomA, edg_wll_NotifIdUnparse(notifId), "notifId", NULL); edg_wll_add_string_to_XMLBody(&pomA, address, "clientAddress", NULL); edg_wll_add_string_to_XMLBody(&pomA, edg_wll_NotifChangeOpToString(op), "notifChangeOp", NULL); + edg_wll_add_time_t_to_XMLBody(&pomA, validity, "requestedValidity", -1); if (conditions && conditions[0] && conditions[0][0].attr != EDG_WLL_QUERY_ATTR_UNDEF) edg_wll_JobQueryRecToXML(ctx, conditions, &pomB);