public void addParameters(String jobID, List<Parameter> params) throws JobNotFoundException, JobPersistenceException, TransientException { log.debug("addParameters: " + jobID + "," + toString(params)); JobDAO dao = getDAO(); dao.addParameters(jobID, params); } private String toString(List list)
public void delete(String jobID) throws JobPersistenceException, TransientException { JobDAO dao = getDAO(); dao.delete(jobID); }
public Job get(String jobID) throws JobNotFoundException, JobPersistenceException, TransientException { JobDAO dao = getDAO(); return dao.get(jobID); }
startTransaction(); DetailInsertStatementCreator disc = new DetailInsertStatementCreator(); for (Parameter p : params) prof.checkpoint("DetailInsertStatementCreator"); commitTransaction(); prof.checkpoint("commit.DetailInsertStatementCreator"); try rollbackTransaction(); prof.checkpoint("rollback.DetailInsertStatementCreator"); rollbackTransaction();
public Object extractData(ResultSet rs) throws SQLException, DataAccessException { if (rs.next()) return ExecutionPhase.valueOf(getString(rs, jobSchema.jobTable, "executionPhase")); return null; }
public Iterator<JobRef> iterator(String appname, List<ExecutionPhase> phases, Date after, Integer last) throws JobPersistenceException, TransientException { JobDAO dao = getDAO(); return dao.iterator(appname, phases, after, last); }
public ExecutionPhase getPhase(String jobID) throws JobNotFoundException, JobPersistenceException, TransientException { JobDAO dao = getDAO(); return dao.getPhase(jobID); }
public void getDetails(Job job) throws JobPersistenceException, TransientException { JobDAO dao = getDAO(); dao.getDetails(job); }
protected JobDAO getDAO() throws JobPersistenceException { try { DataSource ds = getDataSource(); JobDAO.JobSchema js = getJobSchema(); return new JobDAO(ds, js, identityManager, idGenerator); } catch(NamingException ex) { throw new JobPersistenceException("failed to find/create DataSource", ex); } finally { } }
/** * Load all stored Parameter(s) and Result(s) into the specified job. * * @param job * @throws JobPersistenceException * @throws TransientException */ public void getDetails(Job job) throws JobPersistenceException, TransientException { log.debug("getDetails: " + job.getID()); expectPersistentJob(job); try { JobDetailSelectStatementCreator sc = new JobDetailSelectStatementCreator(); sc.setJobID(job.getID()); jdbc.query(sc, new DetailExtractor(jobSchema, job)); // ignore unnecessary return value prof.checkpoint("JobDetailSelectStatementCreator"); } catch(Throwable t) { if (DBUtil.isTransientDBException(t)) throw new TransientException("failed to get job details: " + job.getID(), t); else throw new JobPersistenceException("failed to get job details: " + job.getID(), t); } }
startTransaction(); JobPhaseUpdateStatementCreator sc = new JobPhaseUpdateStatementCreator(); sc.setValues(jobID, start, end, error, date); commitTransaction(); prof.checkpoint("commit.JobPhaseUpdateStatementCreator"); rollbackTransaction(); prof.checkpoint("rollback.JobPhaseUpdateStatementCreator"); rollbackTransaction();
public void mapAndStoreRow(ResultSet rs) throws SQLException { String type = rs.getString("type"); String name = rs.getString("name"); String value = getString(rs, jobSchema.detailTable, "value"); if (TYPE_PARAMETER.equals(type)) { job.getParameterList().add(new Parameter(name, value)); } else if (TYPE_RESULT.equals(type)) { try { URI uri = new URI(value); job.getResultsList().add(new Result(name, uri)); } catch(URISyntaxException ex) { throw new IllegalStateException("failed to convert " + value + " to a URI"); } } else throw new IllegalStateException("unexpected type in param table: " + type); } }
/** * Iterate over the jobs owned by the user in the subject contained in the * access control context. * * @param phases Show only these phases * @param after Only show jobs after this time * @param last Show the last <i>last</i> jobs, ordererd by startTime ascending * @return job iterator * @throws JobPersistenceException * @throws TransientException */ public Iterator<JobRef> iterator(String appname, List<ExecutionPhase> phases, Date after, Integer last) throws TransientException, JobPersistenceException { AccessControlContext acContext = AccessController.getContext(); Subject subject = Subject.getSubject(acContext); return iterator(subject, appname, phases, after, last); }
startTransaction(); prof.checkpoint("start.JobPutStatementCreator"); commitTransaction(); prof.checkpoint("commit.JobPutStatementCreator"); try rollbackTransaction(); prof.checkpoint("rollback.JobPutStatementCreator"); rollbackTransaction();
String eMsg = getString(rs, jobSchema.jobTable, "error_summaryMessage"); String et = getString(rs, jobSchema.jobTable, "error_type"); ErrorType eType = null; if (et != null) try String surl = getString(rs, jobSchema.jobTable, "error_documentURL"); errorUrl = new URL(surl); String runID = getString(rs, jobSchema.jobTable, "runID"); String requestPath = getString(rs, jobSchema.jobTable, "requestPath"); String remoteIP = getString(rs, jobSchema.jobTable, "remoteIP"); String content = getString(rs, jobSchema.jobTable, "jobInfo_content"); String contentType = getString(rs, jobSchema.jobTable, "jobInfo_contentType");