/** * Updates the job definition from the new SchedulerJobInfo * * @param info: Updated info object. * @return number of rows updated. */ public int updateJob(SchedulerJobInfo info) { try { return store.updateJob(info.getId().getHandleIdString(), info.getJob(), info.getModifiedOn()); } catch (SQLException e) { log.error("Error while updating job for {}", info.getId().getHandleIdString(), e); return 0; } }
/** * Updates the job status form the new SchedulerJobInfo * * @param info: Updated info objects * @return number of rows updated. */ public int updateJobStatus(SchedulerJobInfo info) { try { return store.updateJobStatus(info.getId().getHandleIdString(), info.getJobState().name(), info.getModifiedOn()); } catch (SQLException e) { log.error("Error while updating job status for {}", info.getId().getHandleIdString(), e); return 0; } }
/** * Inserts the Job info object into job table * * @param jobInfo * @return number of rows inserted. * @throws SQLException */ public int insertIntoJobTable(SchedulerJobInfo jobInfo) throws SQLException { String insertSQL = "INSERT INTO " + JOB_TABLE + " VALUES(?,?,?,?,?,?,?)"; JAXBElement<XJob> xmlJob = jobFactory.createJob(jobInfo.getJob()); return runner.update(insertSQL, jobInfo.getId().toString(), ToXMLString.toString(xmlJob), jobInfo.getUserName(), jobInfo.getJobState().name(), jobInfo.getCreatedOn(), jobInfo.getModifiedOn(), jobInfo.getJob().getName()); }