/** * Trigger a build without parameters * * @return {@link QueueReference} for further analysis of the queued build. * @throws IOException in case of an error. */ public QueueReference build() throws IOException { ExtractHeader location = client.post(url + "build", null, ExtractHeader.class, false); return new QueueReference(location.getLocation()); }
/** * Trigger a build with crumbFlag. * * @param crumbFlag true or false. * @return {@link QueueReference} for further analysis of the queued build. * @throws IOException in case of an error. */ public QueueReference build(boolean crumbFlag) throws IOException { ExtractHeader location = client.post(url + "build", null, ExtractHeader.class, crumbFlag); return new QueueReference(location.getLocation()); }
/** * Trigger a parameterized build with file parameters and crumbFlag * * @param params the job parameters * @param fileParams the job file parameters * @param crumbFlag determines whether crumb flag is used * @return {@link QueueReference} for further analysis of the queued build. * @throws IOException in case of an error. */ public QueueReference build(Map<String, String> params, Map<String, File> fileParams, boolean crumbFlag) throws IOException { String qs = join(Collections2.transform(params.entrySet(), new MapEntryToQueryStringPair()), "&"); ExtractHeader location = client.post(url + "buildWithParameters?" + qs,null, ExtractHeader.class, fileParams, crumbFlag); return new QueueReference(location.getLocation()); }
private QueueReference stop(JobWithDetails job, Integer buildNumber) throws IOException { ExtractHeader location = (ExtractHeader) job.getClient().post(job.getUrl() + buildNumber + "/stop", null, ExtractHeader.class); return new QueueReference(location.getLocation()); }
private QueueReference terminate(JobWithDetails job, Integer buildNumber) throws IOException { ExtractHeader location = (ExtractHeader) job.getClient().post(job.getUrl() + buildNumber + "/term", null, ExtractHeader.class); return new QueueReference(location.getLocation()); }