Class GitHubHookRegisterProblemMonitor
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.AdministrativeMonitor
org.jenkinsci.plugins.github.admin.GitHubHookRegisterProblemMonitor
- All Implemented Interfaces:
ExtensionPoint
,ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,org.kohsuke.stapler.StaplerProxy
@Extension
public class GitHubHookRegisterProblemMonitor
extends AdministrativeMonitor
implements Saveable
Administrative monitor to track problems of registering/removing hooks for GH.
Holds non-savable map of repo->message and persisted list of ignored projects.
Anyone can register new problem with
registerProblem(GitHubRepositoryName, Throwable)
and check
repo for problems with isProblemWith(GitHubRepositoryName)
Has own page with table with problems and ignoring list in global management section. Link to this page
is visible if any problem or ignored repo is registered- Since:
- 1.17.0
- Author:
- lanwen (Merkushev Kirill)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.AdministrativeMonitor
id
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponse
doAct
(org.kohsuke.stapler.StaplerRequest req) Depending on whether the user said "yes" or "no", send them to the right place.void
This web method requires POST, admin rights and nonnull repo.void
doIgnore
(GitHubRepositoryName repo) This web method requires POST, admin rights and nonnull repo.get()
boolean
boolean
Checks that repo is registered in this monitorvoid
registerProblem
(GitHubRepositoryName repo, Throwable throwable) Registers problems.void
Removes repo from known problems mapvoid
save()
Save the settings to a file.Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getRequiredPermission, getSearchUrl, getTarget, getUrl, isEnabled, isSecurity
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Constructor Details
-
GitHubHookRegisterProblemMonitor
public GitHubHookRegisterProblemMonitor()
-
-
Method Details
-
getProblems
- Returns:
- Immutable copy of map with repo->problem message content
-
registerProblem
Registers problems. For messageThrowable.getMessage()
will be used- Parameters:
repo
- full named GitHub repo, if null nothing will be donethrowable
- exception with message about problem, if null nothing will be done- See Also:
-
resolveProblem
Removes repo from known problems map- Parameters:
repo
- full named GitHub repo, if null nothing will be done
-
isProblemWith
Checks that repo is registered in this monitor- Parameters:
repo
- full named GitHub repo- Returns:
- true if repo is in the map
-
getIgnored
- Returns:
- immutable copy of list with ignored repos
-
getDisplayName
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classAdministrativeMonitor
-
isActivated
public boolean isActivated()- Specified by:
isActivated
in classAdministrativeMonitor
-
doAct
public org.kohsuke.stapler.HttpResponse doAct(org.kohsuke.stapler.StaplerRequest req) throws IOException Depending on whether the user said "yes" or "no", send them to the right place.- Throws:
IOException
-
doIgnore
This web method requires POST, admin rights and nonnull repo. Responds with redirect to monitor page- Parameters:
repo
- to be ignored. Never null
-
doDisignore
This web method requires POST, admin rights and nonnull repo. Responds with redirect to monitor page- Parameters:
repo
- to be disignored. Never null
-
save
public void save()Save the settings to a file. Called on each change ofignored
list -
get
- Returns:
- instance of administrative monitor to register/resolve/ignore/check hook problems
-