![JAR search and dependency download from the Maven repository](/logo.png)
com.clarolab.bamboo.client.BambooApiClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bamboo-rest-api-client Show documentation
Show all versions of bamboo-rest-api-client Show documentation
This library allows to extract information from projects, plans and builds on Bamboo
package com.clarolab.bamboo.client;
import com.clarolab.bamboo.utils.Constants;
import com.clarolab.http.client.HttpClient;
import com.google.common.base.Strings;
import lombok.Builder;
import lombok.Getter;
import lombok.extern.java.Log;
@Log
public class BambooApiClient {
@Getter
private HttpClient httpClient;
@Builder
public BambooApiClient(String baseUrl, String userName, String password){
if(willBeGuestAccessEnabled(userName, password))
this.httpClient = HttpClient.builder().baseUrl(baseUrl).notAuth(true).build();
else
this.httpClient = HttpClient.builder().baseUrl(baseUrl).userName(userName).userPasswordOrToken(password).build();
Constants.setBambooApiClient(this);
}
private boolean willBeGuestAccessEnabled(String userName, String password){
return Strings.isNullOrEmpty(userName) && Strings.isNullOrEmpty(password);
}
public boolean isGuestAccessEnabled(){
return Strings.isNullOrEmpty(httpClient.getUserName()) && Strings.isNullOrEmpty(httpClient.getUserPasswordOrToken());
}
// public T perform(String request, Class classOfT) throws Exception {
// return httpClient.get(request, classOfT);
// }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy