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)StringgetAuthorizeUrl(String clientId, String redirectUrl, String state)BufferedImagegetAvatar(String email, String accessToken)List<GitLabBranch>getBranchesForRepository(RefreshableToken token, String repositoryName)JsonUsergetGitLabUser(String accessToken)List<JsonGroup>getGitLabUserGroups(String accessToken)StringgetRedirectUri(OAuthConnectionDescriptor connectionDescriptor)List<GitLabRepositoryOwner>getRepositoriesByOwners(RefreshableToken token)Pair<List<GitLabRepository>,String>getRepositoriesPage(RefreshableToken token, String pageId, String pageSize, String searchQuery)GitLabRepositorygetRepository(RefreshableToken token, String repositoryName)JsonAccessTokenrefreshToken(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:
getRepositoriesByOwnersin interfaceGitLabClient
-
getRepositoriesPage
@NotNull public Pair<List<GitLabRepository>,String> getRepositoriesPage(@NotNull RefreshableToken token, @Nullable String pageId, @Nullable String pageSize, @Nullable String searchQuery)
- Specified by:
getRepositoriesPagein 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:
getRepositoryin interfaceGitLabClient
-
completeAuthorization
public Pair<JsonAccessToken,JsonUser> completeAuthorization(@NotNull String clientId, @NotNull String secret, @NotNull String code, @NotNull String redirectUrl) throws Exception
- Specified by:
completeAuthorizationin interfaceGitLabClient- Throws:
Exception
-
refreshToken
public JsonAccessToken refreshToken(@NotNull String clientId, @NotNull String secret, @NotNull String refreshToken, @NotNull String redirectUrl)
- Specified by:
refreshTokenin interfaceGitLabClient
-
getGitLabUser
@NotNull public JsonUser getGitLabUser(@NotNull String accessToken) throws FailureToObtainTokenException
- Specified by:
getGitLabUserin interfaceGitLabClient- Throws:
FailureToObtainTokenException
-
getAvatar
@Nullable public BufferedImage getAvatar(@Nullable String email, @NotNull String accessToken)
- Specified by:
getAvatarin interfaceGitLabClient
-
getGitLabUserGroups
@NotNull public List<JsonGroup> getGitLabUserGroups(@NotNull String accessToken)
- Specified by:
getGitLabUserGroupsin interfaceGitLabClient
-
getBranchesForRepository
@NotNull public List<GitLabBranch> getBranchesForRepository(RefreshableToken token, String repositoryName)
- Specified by:
getBranchesForRepositoryin interfaceGitLabClient
-
getAuthorizeUrl
public String getAuthorizeUrl(@NotNull String clientId, @NotNull String redirectUrl, @NotNull String state)
- Specified by:
getAuthorizeUrlin interfaceGitLabClient
-
getRedirectUri
@NotNull public String getRedirectUri(@NotNull OAuthConnectionDescriptor connectionDescriptor)
- Specified by:
getRedirectUriin interfaceGitLabClient
-
-