/** v1 service implementation to get a JSONObject representation of a job from its external ID */ @SuppressWarnings("unchecked") private JSONObject getWorkflowJobIdForExternalId(HttpServletRequest request, String externalId) throws XServletException { JSONObject json = new JSONObject(); try { DagEngine dagEngine = Services.get() .get(DagEngineService.class) .getDagEngine(getUser(request), getAuthToken(request)); String jobId = dagEngine.getJobIdForExternalId(externalId); json.put(JsonTags.JOB_ID, jobId); } catch (DagEngineException ex) { throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex); } return json; }