tmp.progress = rs.getInt(13); tmp.sessionID = rs.getString(14); tmp.state = State.valueOf(rs.getString(15)); tmp.userName = rs.getString(16); tmp.jd_id = rs.getInt(17);
@Override public Boolean hasSucceeded(int requestId) { DbConn cnx = Helpers.getNewDbSession(); try { State s = State.valueOf(cnx.runSelectSingle("history_select_state_by_id", String.class, requestId)); return s.equals(State.ENDED); } catch (NoResultException e) { return null; } finally { Helpers.closeQuietly(cnx); } }
/** * Create an History object from a {@link JobInstance}. * */ public static void create(DbConn cnx, JobInstance ji, State finalState, Calendar endDate) { JobDef jd = ji.getJD(); Node n = ji.getNode(); Queue q = ji.getQ(); if (endDate == null) { cnx.runUpdate("history_insert", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(), ji.getEmail(), ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(), jd.getModule(), n == null ? null : n.getName(), ji.getParentId(), ji.getProgress(), q == null ? null : q.getName(), 0, ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), n == null ? null : n.getId(), ji.getQueue(), ji.isFromSchedule(), ji.getPriority()); } else { cnx.runUpdate("history_insert_with_end_date", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(), ji.getEmail(), endDate, ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(), jd.getModule(), n.getName(), ji.getParentId(), ji.getProgress(), q.getName(), 0, ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), ji.getNode().getId(), ji.getQueue(), ji.isFromSchedule(), ji.getPriority()); } }
tmp.progress = rs.getInt(13); tmp.sessionID = rs.getString(14); tmp.state = State.valueOf(rs.getString(15)); tmp.userName = rs.getString(16); tmp.jd_id = rs.getInt(17);
@Override public Boolean hasSucceeded(int requestId) { DbConn cnx = Helpers.getNewDbSession(); try { State s = State.valueOf(cnx.runSelectSingle("history_select_state_by_id", String.class, requestId)); return s.equals(State.ENDED); } catch (NoResultException e) { return null; } finally { Helpers.closeQuietly(cnx); } }
/** * Create an History object from a {@link JobInstance}. * */ public static void create(DbConn cnx, JobInstance ji, State finalState, Calendar endDate) { JobDef jd = ji.getJD(); Node n = ji.getNode(); Queue q = ji.getQ(); if (endDate == null) { cnx.runUpdate("history_insert", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(), ji.getEmail(), ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(), jd.getModule(), n == null ? null : n.getName(), ji.getParentId(), ji.getProgress(), q == null ? null : q.getName(), 0, ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), n == null ? null : n.getId(), ji.getQueue(), ji.isFromSchedule(), ji.getPriority()); } else { cnx.runUpdate("history_insert_with_end_date", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(), ji.getEmail(), endDate, ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(), jd.getModule(), n.getName(), ji.getParentId(), ji.getProgress(), q.getName(), 0, ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), ji.getNode().getId(), ji.getQueue(), ji.isFromSchedule(), ji.getPriority()); } }
currentState = State.valueOf(writer.toString());
startingState = State.valueOf(runRequest.getStartState().toString());