Various CMDline options to set notification flags
authorZdeněk Šustr <sustr4@cesnet.cz>
Mon, 4 Jul 2011 09:10:59 +0000 (09:10 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Mon, 4 Jul 2011 09:10:59 +0000 (09:10 +0000)
org.glite.lb.client/src/notify.c

index df10e43..5ce7d6e 100644 (file)
@@ -50,16 +50,19 @@ static void usage(char *cmd)
                        me);
        }
        if ( !cmd || !strcmp(cmd, "new") )
-               fprintf(stderr,"\n'new' command usage: %s new [ { -s socket_fd | -a fake_addr } -t requested_validity -j jobid  { -o owner | -O }  -n network_server -v virtual_organization --states state1,state2,... -c -f flags]\n"
+               fprintf(stderr,"\n'new' command usage: %s new [ { -s socket_fd | -a fake_addr } -t requested_validity -j jobid  { -o owner | -O }  -n network_server -v virtual_organization --states state1,state2,... -c -B -T -E -f flags]\n"
                        "    jobid              Job ID to connect notif. reg. with\n"
                        "    owner              Match this owner DN\n"
                        "    requested_validity Validity of notification req. in seconds\n"
-                       "    flags              0 - return basic status, 1 - return also JDL in status\n"
-                       "                       256 - bootstrap stream (send all existing jobs too)\n"
+                       "    flags              Numeric flags, can be also represented by cmdline options bellow\n"
                        "    network_server     Match only this network server (WMS entry point)\n"
                        "    -O                 Match owner - credentials are retrieved from environment\n"
                        "    -c                 Match only on state change\n"
                        "    -S | --state       Match on events resulting in listed (coma-delimited) states\n"
+                       "    -J | --jdl         Attach JDL to job status being returned\n"
+                       "    -B | --bootstrap   Also send past events matching conditions\n"
+                       "    -T | --terminal    Notify only when a job reaches terminal state\n"
+                       "    -E | --summary     Same as -T plus attach a summary of all job's Events\n"
                        , me);
        if ( !cmd || !strcmp(cmd, "bind") )
                fprintf(stderr,"\n'bind' command usage: %s bind [ { -s socket_fd | -a fake_addr } -t requested_validity ] notifids \n"
@@ -133,6 +136,10 @@ int main(int argc,char **argv)
                 edg_wll_GssStatus      gss_code;
                static struct option long_options[] = {
                        {"state", required_argument, 0, 'S'},
+                       {"jdl", no_argument, 0, 'J'},
+                       {"bootstrap", no_argument, 0, 'B'},
+                       {"terminal", no_argument, 0, 'T'},
+                       {"summary", no_argument, 0, 'E'},
                        {0, 0, 0, 0}};
                int option_index = 0;
                char *single, *statelist, *notif_server;
@@ -144,7 +151,7 @@ int main(int argc,char **argv)
                conditions = (edg_wll_QueryRec **)calloc(MAX_NEW_CONDS + 1,sizeof(edg_wll_QueryRec *));
                conditions[0] = (edg_wll_QueryRec *)calloc(2,sizeof(edg_wll_QueryRec));
 
-               while ((c = getopt_long(argc-1,argv+1,"j:o:v:n:s:a:t:f:cOS:",long_options,&option_index)) > 0) { switch (c) {
+               while ((c = getopt_long(argc-1,argv+1,"j:o:v:n:s:a:t:f:cOS:JBTE",long_options,&option_index)) > 0) { switch (c) {
                        case 'j':
                                conditions[i] = (edg_wll_QueryRec *)calloc(2,sizeof(edg_wll_QueryRec));
                                conditions[i][0].attr = EDG_WLL_QUERY_ATTR_JOBID;
@@ -196,7 +203,15 @@ int main(int argc,char **argv)
                        case 't':
                                valid = time(NULL) + atol(optarg); break;
                        case 'f':
-                               flags = atoi(optarg); break;
+                               flags |= atoi(optarg); break;
+                       case 'J':
+                               flags |= EDG_WLL_STAT_CLASSADS; break;
+                       case 'B':
+                               flags |= EDG_WLL_NOTIF_BOOTSTRAP; break;
+                       case 'T':
+                               flags |= EDG_WLL_NOTIF_TERMINAL_STATES; break;
+                       case 'E':
+                               flags |= EDG_WLL_NOTIF_TERMINAL_STATES | EDG_WLL_NOTIF_EVENT_SUMMARY; break;
                        case 'c':
                                conditions[i] = (edg_wll_QueryRec *)calloc(2,sizeof(edg_wll_QueryRec));
                                conditions[i][0].attr = EDG_WLL_QUERY_ATTR_STATUS;