Index: services/stax/service/STAX.java
===================================================================
RCS file: /cvsroot/staf/src/staf/services/stax/service/STAX.java,v
retrieving revision 1.192
diff -r1.192 STAX.java
766a767,768
>             fListParser.addOption("TOTAL", 1,
>                                   STAFCommandParser.VALUENOTALLOWED);
821a824
>             fListParser.addOptionNeed("TOTAL", "JOBS");
1605c1608
<                 "LIST      JOBS | SETTINGS | MACHINECACHE |" +
---
>                 "LIST      JOBS [TOTAL] | SETTINGS | MACHINECACHE |" +
3410a3414,3418
>             
>             if (parseResult.optionTimes("TOTAL") != 0)
>             {
>                 // Create output for LIST JOBS TOTAL request which returns
>                 // the number of STAX jobs currently running
3412,3416c3420,3423
<             mc.setMapClassDefinition(fJobInfoMapClass);
<             List<Map<String, Object>> jobList =
<                 new ArrayList<Map<String, Object>>();
< 
<             synchronized (fJobMap)
---
>                 return new STAFResult(
>                     STAFResult.Ok, String.valueOf(fJobMap.size()));
>             }
>             else
3418c3425,3432
<                 for (STAXJob job : fJobMap.values())
---
>                 // Create output for LIST JOBS requewt which returns a
>                 // list of the STAX jobs currently running
> 
>                 mc.setMapClassDefinition(fJobInfoMapClass);
>                 List<Map<String, Object>> jobList =
>                     new ArrayList<Map<String, Object>>();
> 
>                 synchronized (fJobMap)
3420,3421c3434,3437
<                     Map<String, Object> jobInfoMap =
<                         new TreeMap<String, Object>();
---
>                     for (STAXJob job : fJobMap.values())
>                     {
>                         Map<String, Object> jobInfoMap =
>                             new TreeMap<String, Object>();
3423,3424c3439,3440
<                     jobInfoMap.put("staf-map-class-name",
<                                    fJobInfoMapClass.name());
---
>                         jobInfoMap.put("staf-map-class-name",
>                                        fJobInfoMapClass.name());
3426,3427c3442,3443
<                     jobInfoMap.put("jobID",
<                                    String.valueOf(job.getJobNumber()));
---
>                         jobInfoMap.put("jobID",
>                                        String.valueOf(job.getJobNumber()));
3429,3430c3445,3446
<                     if (!job.getJobName().equals(""))
<                         jobInfoMap.put("jobName", job.getJobName());
---
>                         if (!job.getJobName().equals(""))
>                             jobInfoMap.put("jobName", job.getJobName());
3432,3433c3448,3449
<                     jobInfoMap.put("startTimestamp", job.getStartTimestamp().
<                                    getTimestampString());
---
>                         jobInfoMap.put("startTimestamp", job.getStartTimestamp().
>                                        getTimestampString());
3435c3451
<                     jobInfoMap.put("function", job.getStartFunction());
---
>                         jobInfoMap.put("function", job.getStartFunction());
3437c3453
<                     jobInfoMap.put("state", job.getStateAsString());
---
>                         jobInfoMap.put("state", job.getStateAsString());
3439,3441c3455,3457
<                     jobList.add(jobInfoMap);
<                 }
<             } // end synchronized (fJobMap)
---
>                         jobList.add(jobInfoMap);
>                     }
>                 } // end synchronized (fJobMap)
3443c3459,3460
<             mc.setRootObject(jobList);
---
>                 mc.setRootObject(jobList);
>             }
Index: services/stax/docs/userguide/staxug.html
===================================================================
RCS file: /cvsroot/staf/src/staf/services/stax/docs/userguide/staxug.html,v
retrieving revision 1.277
diff -r1.277 staxug.html
7267,7268c7267,7269
< LIST - Lists all currently running jobs or specific information about a single
< job, or the settings for the STAX service, or the file cache.</li>
---
> LIST - Lists all currently running jobs, or the number of jobs currently running,
> or specific information about a single job, or the settings for the STAX service,
> or the file cache.</li>
7358c7359
< LIST      JOBS | SETTINGS | MACHINECACHE |
---
> LIST      JOBS [TOTAL] | SETTINGS | MACHINECACHE |
9311c9312
< LIST JOBS | SETTINGS | MACHINECACHE |
---
> LIST JOBS [TOTAL] | SETTINGS | MACHINECACHE |
9318,9319c9319,9320
< <p><tt>JOBS</tt> lists
< the jobs that are currently running.
---
> <p><tt>JOBS</tt> lists the jobs that are currently running.
> <p><tt>JOBS TOTAL</tt> returns the number of jobs that are currently running.
9381,9383c9382,9384
< The result buffer for a <tt>LIST JOBS</tt> request will contain a marshalled
< <tt>&lt;List> of &lt;Map:STAF/Service/STAX/JobInfo></tt> representing the jobs
< that are currently running.  The map is defined as follows:
---
> The result buffer for a <tt>LIST JOBS</tt> request (without the TOTAL option)
> will contain a marshalled <tt>&lt;List> of &lt;Map:STAF/Service/STAX/JobInfo></tt>
> representing the jobs that are currently running.  The map is defined as follows:
9444a9446,9450
> <li><tt><b>LIST JOBS TOTAL</b></tt>
> <p>
> The result buffer for a <tt>LIST JOBS TOTAL</tt> request will contain the number
> of jobs that are currently running.
> <p>
10427c10433
< The result buffer for a <tt>LIST JOBS</tt>
---
> The result buffer for a <tt>LIST JOB &lt;Job ID> SUBJOBS</tt>
10598a10605,10613
> <b>Goal:</b> Get a count of the number of jobs currently running.
> <p><55>&nbsp; LIST JOBS TOTAL</tt>
> <p><b>Output:</b>
> If 5 jobs are currently running, the result would look like:
> <pre>
> 5
> </pre>
> <p>
> <li>
Index: test/STAFTest.xml
===================================================================
RCS file: /cvsroot/staf/src/staf/test/STAFTest.xml,v
retrieving revision 1.353
diff -r1.353 STAFTest.xml
18409a18410,18416
>         # *** LIST JOBS TOTAL Tests ***
> 
>         [ 'STD:STAX', STAXService, 'LIST JOBS TOTAL',
>           [ STAFRC.Ok ], None,
>           "string.atoi(STAFResult) > 0"
>         ],
> 