|
||||||||||
| 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 Hudson 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 Hudson.
Once installed, it's the implementor'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)
AdministrativeMonitors are bound to URL by
Hudson.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/hudson/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.
Hudson.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. |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
equals, 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.
| Method Detail |
|---|
public String getUrl()
public String getDisplayName()
getDisplayName in interface ModelObjectpublic final String getSearchUrl()
SearchItemSearchItem.
getSearchUrl in interface SearchItem
public void disable(boolean value)
throws IOException
IOExceptionpublic 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
IOExceptionpublic static ExtensionList<AdministrativeMonitor> all()
AdministrativeMonitor instances.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||