Class GitLabClientImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.oauth.gitlab.GitLabClientImpl
-
- All Implemented Interfaces:
GitLabClient
public class GitLabClientImpl extends Object implements GitLabClient
-
-
Constructor Summary
Constructors Constructor Description GitLabClientImpl(String gitLabUrl, SSLTrustStoreProvider sslTrustStoreProvider, WebLinks webLinks, com.google.gson.Gson gson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair<JsonAccessToken,JsonUser>
completeAuthorization(String clientId, String secret, String code, String redirectUrl)
String
getAuthorizeUrl(String clientId, String redirectUrl, String state)
BufferedImage
getAvatar(String email, String accessToken)
List<GitLabBranch>
getBranchesForRepository(RefreshableToken token, String repositoryName)
JsonUser
getGitLabUser(String accessToken)
List<JsonGroup>
getGitLabUserGroups(String accessToken)
String
getRedirectUri(OAuthConnectionDescriptor connectionDescriptor)
List<GitLabRepositoryOwner>
getRepositoriesByOwners(RefreshableToken token)
Pair<List<GitLabRepository>,String>
getRepositoriesPage(RefreshableToken token, String pageId, String pageSize, String searchQuery)
GitLabRepository
getRepository(RefreshableToken token, String repositoryName)
JsonAccessToken
refreshToken(String clientId, String secret, String refreshToken, String redirectUrl)
-
-
-
Field Detail
-
API_PATH
public static final String API_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GitLabClientImpl
public GitLabClientImpl(@NotNull String gitLabUrl, @NotNull SSLTrustStoreProvider sslTrustStoreProvider, @NotNull WebLinks webLinks, @NotNull com.google.gson.Gson gson)
-
-
Method Detail
-
getRepositoriesByOwners
public List<GitLabRepositoryOwner> getRepositoriesByOwners(@NotNull RefreshableToken token)
- Specified by:
getRepositoriesByOwners
in interfaceGitLabClient
-
getRepositoriesPage
@NotNull public Pair<List<GitLabRepository>,String> getRepositoriesPage(@NotNull RefreshableToken token, @Nullable String pageId, @Nullable String pageSize, @Nullable String searchQuery)
- Specified by:
getRepositoriesPage
in interfaceGitLabClient
- Returns:
- pair of all repositories from the specified page and the id of the next page (or null if no next page).
-
getRepository
@Nullable public GitLabRepository getRepository(@NotNull RefreshableToken token, @NotNull String repositoryName)
- Specified by:
getRepository
in interfaceGitLabClient
-
completeAuthorization
public Pair<JsonAccessToken,JsonUser> completeAuthorization(@NotNull String clientId, @NotNull String secret, @NotNull String code, @NotNull String redirectUrl) throws Exception
- Specified by:
completeAuthorization
in interfaceGitLabClient
- Throws:
Exception
-
refreshToken
public JsonAccessToken refreshToken(@NotNull String clientId, @NotNull String secret, @NotNull String refreshToken, @NotNull String redirectUrl)
- Specified by:
refreshToken
in interfaceGitLabClient
-
getGitLabUser
@NotNull public JsonUser getGitLabUser(@NotNull String accessToken) throws FailureToObtainTokenException
- Specified by:
getGitLabUser
in interfaceGitLabClient
- Throws:
FailureToObtainTokenException
-
getAvatar
@Nullable public BufferedImage getAvatar(@Nullable String email, @NotNull String accessToken)
- Specified by:
getAvatar
in interfaceGitLabClient
-
getGitLabUserGroups
@NotNull public List<JsonGroup> getGitLabUserGroups(@NotNull String accessToken)
- Specified by:
getGitLabUserGroups
in interfaceGitLabClient
-
getBranchesForRepository
@NotNull public List<GitLabBranch> getBranchesForRepository(RefreshableToken token, String repositoryName)
- Specified by:
getBranchesForRepository
in interfaceGitLabClient
-
getAuthorizeUrl
public String getAuthorizeUrl(@NotNull String clientId, @NotNull String redirectUrl, @NotNull String state)
- Specified by:
getAuthorizeUrl
in interfaceGitLabClient
-
getRedirectUri
@NotNull public String getRedirectUri(@NotNull OAuthConnectionDescriptor connectionDescriptor)
- Specified by:
getRedirectUri
in interfaceGitLabClient
-
-