Class GitLabHookCreator
- java.lang.Object
-
- io.jenkins.plugins.gitlabbranchsource.GitLabHookCreator
-
public class GitLabHookCreator extends Object
-
-
Constructor Summary
Constructors Constructor Description GitLabHookCreator()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
createSystemHookWhenMissing(GitLabServer server, com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
static org.gitlab4j.api.models.ProjectHook
createWebHook()
static String
createWebHookWhenMissing(org.gitlab4j.api.GitLabApi gitLabApi, String project, String hookUrl, String secretToken)
static String
getHookUrl(boolean isWebHook)
Deprecated.usegetHookUrl(GitLabServer,boolean)
insteadstatic String
getHookUrl(GitLabServer server, boolean isWebHook)
static boolean
isTokenEqual(String str1, String str2)
static void
register(GitLabSCMSource source, GitLabHookRegistration webhookMode, GitLabHookRegistration systemhookMode)
static void
register(jenkins.scm.api.SCMNavigatorOwner owner, GitLabSCMNavigator navigator, GitLabHookRegistration systemhookMode)
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
-
-
Method Detail
-
register
public static void register(jenkins.scm.api.SCMNavigatorOwner owner, GitLabSCMNavigator navigator, GitLabHookRegistration systemhookMode)
-
register
public static void register(GitLabSCMSource source, GitLabHookRegistration webhookMode, GitLabHookRegistration systemhookMode)
-
createSystemHookWhenMissing
public static void createSystemHookWhenMissing(GitLabServer server, com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
-
getHookUrl
@Deprecated public static String getHookUrl(boolean isWebHook)
Deprecated.usegetHookUrl(GitLabServer,boolean)
instead
-
getHookUrl
public static String getHookUrl(GitLabServer server, boolean isWebHook)
- Parameters:
server
- theGitLabServer
for which the hooks URL would be created. If notnull
and it has aGitLabServer.getHooksRootUrl()
, then the hook URL will be based on this root URL. Otherwise, the hook URL will be based onJenkins.getRootUrl()
.isWebHook
-true
to get the webhook URL,false
for the systemhook URL- Returns:
- a webhook or systemhook URL
-
createWebHook
public static org.gitlab4j.api.models.ProjectHook createWebHook()
-
createWebHookWhenMissing
public static String createWebHookWhenMissing(org.gitlab4j.api.GitLabApi gitLabApi, String project, String hookUrl, String secretToken) throws org.gitlab4j.api.GitLabApiException
- Throws:
org.gitlab4j.api.GitLabApiException
-
-