/** * 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(); }
boolean followRedirects = false; HttpPost post = new HttpPost(url, content, contentType, followRedirects);
HttpPost httpPost = new HttpPost(vospaceURL, nodeContent, false);
HttpPost httpPost = new HttpPost(vospaceURL, transferContent, false);
parameters.put("PHASE", "RUN"); HttpPost transfer = new HttpPost(phaseURL, parameters, false); if (transListener != null) { transfer.setTransferListener(transListener);
URL phaseURL = new URL(jobURL.toExternalForm() + "/phase"); log.info(jobName + " execute " + phaseURL); HttpPost post = new HttpPost(phaseURL, params, false); if (subject != null) { Subject.doAs(subject, new RunnableAction(post));
HttpPost httpPost = new HttpPost(url, nodeContent, false);
/** * 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; }
log.debug("updateGroup: " + groupXML); HttpPost transfer = new HttpPost(updateGroupURL, groupXML.toString(), "application/xml", false); transfer.setSSLSocketFactory(getSSLSocketFactory());