- server side implementation of notification flags
authorMiloš Mulač <mulac@civ.zcu.cz>
Thu, 23 Oct 2008 13:08:25 +0000 (13:08 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Thu, 23 Oct 2008 13:08:25 +0000 (13:08 +0000)
org.glite.lb.server/src/il_notification.c
org.glite.lb.server/src/il_notification.h
org.glite.lb.server/src/notif_match.c

index 48fcb8c..1d3e002 100644 (file)
@@ -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) {
index 78754f0..45b396e 100644 (file)
@@ -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);
 
index b1d715f..c38ba95 100644 (file)
@@ -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<sizeof(jobc)/sizeof(jobc[0]); i++) free(jobc[i]);