select($fdin,undef,undef,undef);
print "got connection\n";
- system "$notif receive -s $fd -t 3";
+ system "$notif receive -s $fd -i 3";
}
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"
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;
}
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);
const edg_wll_NotifId notifId,
const char *address,
edg_wll_NotifChangeOp op,
+ time_t validity,
edg_wll_QueryRec const * const *conditions,
char **message)
{
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);