All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.chavaillaz.client.jenkins.okhttp.OkHttpPipelineApi Maven / Gradle / Ivy
package com.chavaillaz.client.jenkins.okhttp;
import java.util.concurrent.CompletableFuture;
import com.chavaillaz.client.jenkins.JenkinsAuthentication;
import com.chavaillaz.client.jenkins.api.PipelineApi;
import com.chavaillaz.client.jenkins.domain.folder.Path;
import com.chavaillaz.client.jenkins.domain.job.pipeline.Actions;
import com.chavaillaz.client.jenkins.domain.job.pipeline.Artifacts;
import com.chavaillaz.client.jenkins.domain.job.pipeline.Node;
import com.chavaillaz.client.jenkins.domain.job.pipeline.NodeLog;
import com.chavaillaz.client.jenkins.domain.job.pipeline.Run;
import com.chavaillaz.client.jenkins.domain.job.pipeline.Runs;
import okhttp3.OkHttpClient;
/**
* Implementation of {@link PipelineApi} for OkHttp.
*/
public class OkHttpPipelineApi extends AbstractOkHttpClient implements PipelineApi {
/**
* Creates a new pipeline client based on OkHttp client.
*
* @param client The OkHttp client to use
* @param baseUrl The URL of Jenkins
* @param authentication The authentication method
*/
public OkHttpPipelineApi(OkHttpClient client, String baseUrl, JenkinsAuthentication authentication) {
super(client, baseUrl, authentication);
}
@Override
public CompletableFuture getRunHistory(Path path, String pipelineName, String branchName) {
return sendAsync(requestBuilder(URL_RUN_HISTORY, path, pipelineName, branchName).get(), Runs.class);
}
@Override
public CompletableFuture getRun(Path path, String pipelineName, String branchName, long buildNumber) {
return sendAsync(requestBuilder(URL_RUN_DETAILS, path, pipelineName, branchName, buildNumber).get(), Run.class);
}
@Override
public CompletableFuture getRunPendingActions(Path path, String pipelineName, String branchName, long buildNumber) {
return sendAsync(requestBuilder(URL_RUN_ACTIONS, path, pipelineName, branchName, buildNumber).get(), Actions.class);
}
@Override
public CompletableFuture getRunArtifacts(Path path, String pipelineName, String branchName, long buildNumber) {
return sendAsync(requestBuilder(URL_RUN_ARTIFACTS, path, pipelineName, branchName, buildNumber).get(), Artifacts.class);
}
@Override
public CompletableFuture getRunNode(Path path, String pipelineName, String branchName, long buildNumber, String nodeId) {
return sendAsync(requestBuilder(URL_RUN_STAGE_DETAILS, path, pipelineName, branchName, buildNumber, nodeId).get(), Node.class);
}
@Override
public CompletableFuture getRunNodeLog(Path path, String pipelineName, String branchName, long buildNumber, String nodeId) {
return sendAsync(requestBuilder(URL_RUN_STAGE_LOGS, path, pipelineName, branchName, buildNumber, nodeId).get(), NodeLog.class);
}
}