|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.AbstractModelObject
hudson.model.AdministrativeMonitor
public abstract class AdministrativeMonitor
Checks the health of a subsystem of Jenkins and if there's something that requires administrator's attention, notify the administrator.
Plugins who wish to contribute such notifications can implement this
class and put Extension
on it to register it to Jenkins.
Once installed, it's the implementer's responsibility to perform
monitoring and activate/deactivate the monitor accordingly. Sometimes
this can be done by updating a flag from code (see SCMTrigger
for one such example), while other times it's more convenient to do
so by running some code periodically (for this, use Trigger.timer
)
AdministrativeMonitor
s are bound to URL by Jenkins.getAdministrativeMonitor(String)
.
See getUrl()
.
isActivated()
returns true, Hudson will use the message.jelly
view of this object to render the warning text. This happens in the
http://SERVER/jenkins/manage page. This view should typically render
a DIV box with class='error' or class='warning' with a human-readable text
inside it. It often also contains a link to a page that provides more details
about the problem.
Jenkins.administrativeMonitors
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary | |
---|---|
String |
id
Human-readable ID of this monitor, which needs to be unique within the system. |
Constructor Summary | |
---|---|
protected |
AdministrativeMonitor()
|
protected |
AdministrativeMonitor(String id)
|
Method Summary | |
---|---|
static ExtensionList<AdministrativeMonitor> |
all()
All registered AdministrativeMonitor instances. |
void |
disable(boolean value)
Mark this monitor as disabled, to prevent this from showing up in the UI. |
void |
doDisable(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
URL binding to disable this monitor. |
String |
getDisplayName()
|
String |
getSearchUrl()
Returns the URL of this item relative to the parent SearchItem . |
String |
getUrl()
Returns the URL of this monitor, relative to the context path, like "administrativeMonitor/foobar". |
abstract boolean |
isActivated()
Returns true if this monitor is activated and wants to produce a warning message. |
boolean |
isEnabled()
Returns true if this monitor isn't disabled earlier. |
Methods inherited from class hudson.model.AbstractModelObject |
---|
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final String id
This ID is used to remember persisted setting for this monitor, so the ID should remain consistent beyond the Hudson JVM lifespan.
Constructor Detail |
---|
protected AdministrativeMonitor(String id)
protected AdministrativeMonitor()
Method Detail |
---|
public String getUrl()
public String getDisplayName()
getDisplayName
in interface ModelObject
public final String getSearchUrl()
SearchItem
SearchItem
.
getSearchUrl
in interface SearchItem
public void disable(boolean value) throws IOException
IOException
public boolean isEnabled()
isn't disabled
earlier.
This flag implements the ability for the admin to say "no thank you" to the monitor that he wants to ignore.
public abstract boolean isActivated()
This method is called from the HTML rendering thread, so it should run efficiently.
public void doDisable(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOException
public static ExtensionList<AdministrativeMonitor> all()
AdministrativeMonitor
instances.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |