/** * POST PHASE=ABORTED to the Job's phase endpoint. */ @Override public void run() { URL url; try { url = new URL(jobURL.toExternalForm() + "/phase"); } catch (MalformedURLException e) { System.out.println("Unable to create URL to Job " + jobURL.toExternalForm() + " because " + e.getMessage()); return; } HttpPost post = new HttpPost(url, parameters, true); post.run(); if (post.getThrowable()!= null) { System.out.println("Failed to abort Job " + jobURL.toExternalForm() + " because " + post.getThrowable().getMessage()); return; } System.out.println("Successfully aborted Job " + jobURL.toExternalForm()); }
if (post.getThrowable() != null) throw new RuntimeException("Unable to run job because " + post.getThrowable().getLocalizedMessage());
if (httpPost.getThrowable() != null) log.debug("Unable to post transfer because ", httpPost.getThrowable()); throw new RuntimeException("Unable to post transfer because " + httpPost.getThrowable().getMessage());
protected final URL createAsyncParamJob(String jobName, Map<String, Object> params) { URL jobListURL = getJobListURL(); HttpPost post = new HttpPost(jobListURL, params, false); if (subject != null) { Subject.doAs(subject, new RunnableAction(post)); } else { post.run(); } if (post.getThrowable() != null) { Assert.fail("failed to create job: " + jobName + " reason: " + post.getThrowable()); } URL ret = post.getRedirectURL(); Assert.assertNotNull("redirectURL", ret); log.info(jobName + " created " + ret); return ret; }
VOSClientUtil.checkFailure(httpPost.getThrowable());
Throwable error = transfer.getThrowable(); if (error != null)
post.run(); if (post.getThrowable() != null) { Assert.fail("failed to set PHASE=RUN for " + jobURL + " reason: " + post.getThrowable());
if (httpPost.getThrowable() != null) log.debug("Unable to post transfer because ", httpPost.getThrowable()); throw new RuntimeException("Unable to post transfer because " + httpPost.getThrowable().getMessage());
VOSClientUtil.checkFailure(httpPost.getThrowable());
/** * Create and execute a synchronous job specified by parameters. * * @param jobName name to be logged * @param params parameters for this job * @return */ protected final JobResultWrapper createAndExecuteSyncParamJobPOST(String jobName, Map<String, Object> params) { URL jobListURL = getJobListURL(); JobResultWrapper ret = new JobResultWrapper(jobName); try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); log.info(jobName); HttpPost doit = new HttpPost(jobListURL, params, bos); if (subject != null) { Subject.doAs(subject, new RunnableAction(doit)); } else { doit.run(); } ret.job = null; // no formal way to get jobID ret.throwable = doit.getThrowable(); ret.responseCode = doit.getResponseCode(); ret.contentType = doit.getResponseContentType(); ret.contentEncoding = doit.getResponseContentEncoding(); ret.syncOutput = bos.toByteArray(); } finally { } return ret; }
Throwable error = transfer.getThrowable(); if (error != null)