- private Map convertJob(JobQueue.Job aJob) {
- Map result = new HashMap();
- ProducerJob producerJob = (ProducerJob) aJob.getData();
-
- result.put("identifier", aJob.getIdentifier());
- result.put("factory", producerJob.getFactoryName());
- result.put("verb", producerJob.getVerb());
- result.put("priority", new Integer(aJob.getPriority()));
- result.put("status", convertStatus(aJob));
- result.put("lastchange", new DateToMapAdapter(aJob.getLastChange()));
-
- return result;
- }
-
- private void convertJobList(List aSourceJobList, List aDestination) {
- Iterator i = aSourceJobList.iterator();
+ private Map convertJob(JobQueue.JobInfo aJob) {
+ try {
+ Map result = new HashMap();
+ result.put("identifier", aJob.getIdentifier());
+ result.put("description", aJob.getDescription());
+ result.put("priority", new Integer(aJob.getPriority()));
+ result.put("runningtime", new Double( (double) aJob.getRunningTime() / 1000));
+ result.put("status", convertStatus(aJob));
+ result.put("lastchange", new GeneratorFormatAdapters.DateFormatAdapter(aJob.getLastChange(), MirPropertiesConfiguration.instance().getString("Mir.DefaultTimezone")));
+ result.put("finished", new Boolean(
+ aJob.getStatus() == JobQueue.STATUS_PROCESSED ||
+ aJob.getStatus() == JobQueue.STATUS_CANCELLED ||
+ aJob.getStatus() == JobQueue.STATUS_ABORTED));