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
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.AdministrativeMonitor
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponsedoAct(org.kohsuke.stapler.StaplerRequest2 req) Depending on whether the user said "yes" or "no", send them to the right place.voidThis web method requires POST, admin rights and nonnull repo.voiddoIgnore(GitHubRepositoryName repo) This web method requires POST, admin rights and nonnull repo.get()booleanbooleanChecks that repo is registered in this monitorvoidregisterProblem(GitHubRepositoryName repo, Throwable throwable) Registers problems.voidRemoves repo from known problems mapvoidsave()Save the settings to a file.Methods inherited from class hudson.model.AdministrativeMonitor
all, checkRequiredPermission, disable, doDisable, getRequiredPermission, getSearchUrl, getTarget, getUrl, hasPermissionToDisplay, hasRequiredPermission, isEnabled, isSecurityMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
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:
-
registerProblem(GitHubRepositoryName, String)
-
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:
getDisplayNamein interfaceModelObject- Overrides:
getDisplayNamein classAdministrativeMonitor
-
isActivated
public boolean isActivated()- Specified by:
isActivatedin classAdministrativeMonitor
-
doAct
public org.kohsuke.stapler.HttpResponse doAct(org.kohsuke.stapler.StaplerRequest2 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 ofignoredlist -
get
- Returns:
- instance of administrative monitor to register/resolve/ignore/check hook problems
-