use of org.apache.oozie.DagEngine in project oozie by apache.
the class CallbackServlet method doGet.
/**
* GET callback
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String queryString = request.getQueryString();
CallbackService callbackService = Services.get().get(CallbackService.class);
if (!callbackService.isValid(queryString)) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0402, queryString);
}
String actionId = callbackService.getActionId(queryString);
if (actionId == null) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0402, queryString);
}
log = XLog.getLog(getClass());
setLogInfo(actionId);
log.debug("Received a CallbackServlet.doGet() with query string " + queryString);
DagEngine dagEngine = Services.get().get(DagEngineService.class).getSystemDagEngine();
try {
log.info(XLog.STD, "callback for action [{0}]", actionId);
dagEngine.processCallback(actionId, callbackService.getExternalStatus(queryString), null);
} catch (DagEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}
}
use of org.apache.oozie.DagEngine in project oozie by apache.
the class V0JobServlet method resumeJob.
/*
* v0 service method to resume a job
*/
@Override
protected void resumeJob(HttpServletRequest request, HttpServletResponse response) throws XServletException, IOException {
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request));
String jobId = getResourceName(request);
try {
dagEngine.resume(jobId);
} catch (DagEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}
}
use of org.apache.oozie.DagEngine in project oozie by apache.
the class V0JobServlet method killJob.
/*
* v0 service method to kill a job
*/
@Override
protected JSONObject killJob(HttpServletRequest request, HttpServletResponse response) throws XServletException, IOException {
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request));
String jobId = getResourceName(request);
try {
dagEngine.kill(jobId);
} catch (DagEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}
return null;
}
use of org.apache.oozie.DagEngine in project oozie by apache.
the class V0JobServlet method startJob.
/*
* v0 service method to start a job
*/
@Override
protected void startJob(HttpServletRequest request, HttpServletResponse response) throws XServletException, IOException {
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request));
String jobId = getResourceName(request);
try {
dagEngine.start(jobId);
} catch (DagEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}
}
use of org.apache.oozie.DagEngine in project oozie by apache.
the class V0JobServlet method suspendJob.
/*
* v0 service method to suspend a job
*/
@Override
protected void suspendJob(HttpServletRequest request, HttpServletResponse response) throws XServletException, IOException {
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request));
String jobId = getResourceName(request);
try {
dagEngine.suspend(jobId);
} catch (DagEngineException ex) {
throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
}
}
Aggregations