From de272bcaeff799ed23c3325db3e774df9b601433 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Thu, 23 Oct 2008 13:08:25 +0000 Subject: [PATCH] - server side implementation of notification flags --- org.glite.lb.server/src/il_notification.c | 13 ++++++++++--- org.glite.lb.server/src/il_notification.h | 2 ++ org.glite.lb.server/src/notif_match.c | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/org.glite.lb.server/src/il_notification.c b/org.glite.lb.server/src/il_notification.c index 48fcb8c..1d3e002 100644 --- a/org.glite.lb.server/src/il_notification.c +++ b/org.glite.lb.server/src/il_notification.c @@ -154,13 +154,20 @@ edg_wll_NotifJobStatus(edg_wll_Context context, const char *host, int port, const char *owner, + int flags, int expires, const edg_wll_JobStat notif_job_stat) { - int ret=0; - char *xml_data, *xml_esc_data=NULL; + int ret=0; + char *xml_data, *xml_esc_data=NULL; + edg_wll_JobStat stat = notif_job_stat; - if(edg_wll_JobStatusToXML(context, notif_job_stat, &xml_data)) + + if (flags == 0) { + stat.jdl = NULL; + } + + if(edg_wll_JobStatusToXML(context, stat, &xml_data)) goto out; if((xml_esc_data = glite_lbu_EscapeXML(xml_data)) == NULL) { diff --git a/org.glite.lb.server/src/il_notification.h b/org.glite.lb.server/src/il_notification.h index 78754f0..45b396e 100644 --- a/org.glite.lb.server/src/il_notification.h +++ b/org.glite.lb.server/src/il_notification.h @@ -58,6 +58,7 @@ edg_wll_NotifSend(edg_wll_Context context, * \param host,port address to deliver the notification to. * \param owner DN of the registration owner, this will be verified * against client's certificate + * \param flags verbosity of returned status * \param notif_job_stat structure describing job status * \see edg_wll_NotifSend() */ @@ -67,6 +68,7 @@ edg_wll_NotifJobStatus(edg_wll_Context context, const char *host, int port, const char *owner, + int flags, int expires, const edg_wll_JobStat notif_job_stat); diff --git a/org.glite.lb.server/src/notif_match.c b/org.glite.lb.server/src/notif_match.c index b1d715f..c38ba95 100644 --- a/org.glite.lb.server/src/notif_match.c +++ b/org.glite.lb.server/src/notif_match.c @@ -29,7 +29,7 @@ int edg_wll_NotifExpired(edg_wll_Context,const char *); int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *stat) { edg_wll_NotifId nid = NULL; - char *jobq,*ju = NULL,*jobc[5]; + char *jobq,*ju = NULL,*jobc[6]; glite_lbu_Statement jobs = NULL; int ret,i; time_t expires,now = time(NULL); @@ -81,7 +81,7 @@ int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *stat) } trio_asprintf(&jobq, - "select distinct n.notifid,n.destination,n.valid,u.cert_subj,n.conditions " + "select distinct n.notifid,n.destination,n.valid,u.cert_subj,n.conditions,n.flags " "from notif_jobs j,users u,notif_registrations n " "where j.notifid=n.notifid and n.userid=u.userid " " and (j.jobid = '%|Ss' or j.jobid = '%|Ss' %s) %s", @@ -127,7 +127,7 @@ int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *stat) /* XXX: only temporary hack!!! */ ctx->p_instance = strdup(""); - if ( edg_wll_NotifJobStatus(ctx, nid, dest, port, jobc[3], expires, *stat) ) + if ( edg_wll_NotifJobStatus(ctx, nid, dest, port, jobc[3], atoi(jobc[5]), expires, *stat) ) { free(dest); for (i=0; i