int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
len = (len < 1) ? 50 : len;
BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
getAuthToken(request));
BundleJobInfo jobs = bundleEngine.getBundleJobs(filter, start, len);
List<BundleJobBean> jsonJobs = jobs.getBundleJobs();
json.put(JsonTags.BUNDLE_JOBS, BundleJobBean.toJSONArray(jsonJobs, timeZoneId));
json.put(JsonTags.BUNDLE_JOB_TOTAL, jobs.getTotal());
json.put(JsonTags.BUNDLE_JOB_OFFSET, jobs.getStart());
json.put(JsonTags.BUNDLE_JOB_LEN, jobs.getLen());
}
catch (BundleEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}