/** * 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()); }
/** * Submit login data to the service. * @param payload The payload information. * @param out The response stream. * @return Response status code. */ int post(final Map<String, Object> payload, final OutputStream out) { final HttpPost post = new HttpPost(lookupLoginURL(), payload, out); post.run(); return post.getResponseCode(); }
HttpPost httpPost = new HttpPost(vospaceURL, nodeContent, false); httpPost.run();
HttpPost httpPost = new HttpPost(vospaceURL, transferContent, false); httpPost.run();
transfer.setTransferListener(transListener); transfer.run();
Subject.doAs(subject, new RunnableAction(post)); } else { post.run();
HttpPost httpPost = new HttpPost(url, nodeContent, false); httpPost.run();
/** * 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; }
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; }
httpPost.run();
transfer.setSSLSocketFactory(getSSLSocketFactory()); transfer.setTransferListener(this); transfer.run();